Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
c053fb0
Merge pull request #18 from kurtmckee/releases
kurtmckee Dec 16, 2023
4a87de3
Run `tox -e update`
kurtmckee Jan 9, 2024
ca4374d
Update copyrights
kurtmckee Jan 9, 2024
02eca79
Merge pull request #20 from kurtmckee/updates
kurtmckee Jan 9, 2024
0e98eec
Run `tox -e update`; fix a typo
kurtmckee Feb 5, 2024
523ec80
Update the copyright years in the LICENSE
kurtmckee Feb 5, 2024
c274bb5
Test against Python 3.13
kurtmckee Feb 5, 2024
013d1f7
Add a changelog fragment
kurtmckee Feb 5, 2024
7c0f28f
Merge pull request #21 from kurtmckee/updates
kurtmckee Feb 5, 2024
837545c
Bump the github-actions group with 1 update
dependabot[bot] Mar 1, 2024
939d157
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 1, 2024
b6d9786
Merge pull request #22 from kurtmckee/dependabot/github_actions/githu…
kurtmckee Mar 4, 2024
20630b8
Bump the github-actions group with 2 updates
dependabot[bot] Apr 1, 2024
2bc67b5
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 1, 2024
441b8af
[pre-commit.ci] pre-commit autoupdate
pre-commit-ci[bot] Apr 1, 2024
9da5b37
Merge pull request #24 from kurtmckee/pre-commit-ci-update-config
kurtmckee Apr 2, 2024
d414678
Revert a change that affects the README example block
kurtmckee Apr 2, 2024
4dbebff
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 2, 2024
7be8e7e
Merge pull request #23 from kurtmckee/dependabot/github_actions/githu…
kurtmckee Apr 2, 2024
fd1c2be
Bump actions/checkout from 4.1.2 to 4.1.4 in the github-actions group
dependabot[bot] May 1, 2024
fcf66ce
Merge pull request #25 from kurtmckee/dependabot/github_actions/githu…
kurtmckee May 2, 2024
e8c9f34
[pre-commit.ci] pre-commit autoupdate
pre-commit-ci[bot] May 6, 2024
48aadd1
Merge pull request #26 from kurtmckee/pre-commit-ci-update-config
kurtmckee May 7, 2024
ddb5daa
Update some things
kurtmckee May 11, 2024
b502dc6
Migrate code tests in CI to a reusable workflow
kurtmckee May 11, 2024
8dda8d1
Merge pull request #27 from kurtmckee/reusable-workflow
kurtmckee May 11, 2024
94600f4
Rename `.yml` file extensions
kurtmckee May 11, 2024
c717b50
Merge pull request #28 from kurtmckee/mv-yml-files
kurtmckee May 11, 2024
661e403
Bump actions/checkout from 4.1.4 to 4.1.5 in the github-actions group
dependabot[bot] May 11, 2024
14cb78e
Merge pull request #29 from kurtmckee/dependabot/github_actions/githu…
kurtmckee May 11, 2024
6cbbb43
Bump actions/checkout from 4.1.5 to 4.1.6 in the github-actions group
dependabot[bot] Jun 1, 2024
51b9ae5
Merge pull request #30 from kurtmckee/dependabot/github_actions/githu…
kurtmckee Jun 1, 2024
46c1fd6
[pre-commit.ci] pre-commit autoupdate
pre-commit-ci[bot] Jun 3, 2024
8bb805c
Merge pull request #31 from kurtmckee/pre-commit-ci-update-config
kurtmckee Jun 4, 2024
d94580e
Upgrade an example to GraalPy 24.x
kurtmckee Jun 4, 2024
2ed3d3f
Fix broken link rendering in the GitHub web interface
kurtmckee Jun 4, 2024
128f94d
Merge pull request #32 from kurtmckee/updates
kurtmckee Jun 4, 2024
b2d6bb2
Bump actions/checkout from 4.1.6 to 4.1.7 in the github-actions group
dependabot[bot] Jul 1, 2024
c8b1091
Merge pull request #33 from kurtmckee/dependabot/github_actions/githu…
kurtmckee Jul 2, 2024
1994ba5
[pre-commit.ci] pre-commit autoupdate
pre-commit-ci[bot] Jul 2, 2024
e63661d
Merge pull request #34 from kurtmckee/pre-commit-ci-update-config
kurtmckee Jul 2, 2024
c86151a
Run `tox run -m update`
kurtmckee Jul 29, 2024
b4a6966
Merge pull request #35 from kurtmckee/updates
kurtmckee Jul 29, 2024
a9719c2
Run `tox run -m update`
kurtmckee Aug 6, 2024
a608c27
Merge pull request #37 from kurtmckee/updates
kurtmckee Aug 6, 2024
8380745
Lint action workflows; fix reported issues
kurtmckee Aug 20, 2024
9f236d1
Run `tox run -m update`
kurtmckee Aug 20, 2024
e956b0f
Merge pull request #38 from kurtmckee/updates
kurtmckee Aug 20, 2024
233c57a
[pre-commit.ci] pre-commit autoupdate
pre-commit-ci[bot] Sep 2, 2024
5059731
Merge pull request #39 from kurtmckee/pre-commit-ci-update-config
kurtmckee Sep 3, 2024
cb606b8
Remove the now-unnecessary tox v3 `isolated_build` option
kurtmckee Sep 6, 2024
8264b1d
Merge pull request #40 from kurtmckee/rm-isolated-build
kurtmckee Sep 6, 2024
61798db
Remove the redundant tox `skip_missing_interpreters` setting
kurtmckee Sep 26, 2024
ab8c7d5
Merge pull request #41 from kurtmckee/rm-skip_missing_interpreters
kurtmckee Sep 26, 2024
a7ea028
Bump the github-actions group with 2 updates
dependabot[bot] Oct 1, 2024
1ebbbce
Merge pull request #42 from kurtmckee/dependabot/github_actions/githu…
kurtmckee Oct 2, 2024
55cb84f
Bump actions/checkout from 4.2.0 to 4.2.2 in the github-actions group
dependabot[bot] Nov 1, 2024
095f963
Merge pull request #43 from kurtmckee/dependabot/github_actions/githu…
kurtmckee Nov 1, 2024
79b1d8a
Update tools and configurations
kurtmckee Nov 1, 2024
64a30f8
Update the README
kurtmckee Nov 1, 2024
ae7c754
Merge pull request #44 from kurtmckee/updates
kurtmckee Nov 1, 2024
148c471
[pre-commit.ci] pre-commit autoupdate
pre-commit-ci[bot] Nov 5, 2024
bfa6569
Merge pull request #45 from kurtmckee/pre-commit-ci-update-config
kurtmckee Nov 5, 2024
9ad948e
Bump kurtmckee/github-workflows in the github-actions group
dependabot[bot] Nov 5, 2024
1b09ec4
Merge pull request #46 from kurtmckee/dependabot/github_actions/githu…
kurtmckee Nov 5, 2024
13d197a
[pre-commit.ci] pre-commit autoupdate
pre-commit-ci[bot] Dec 3, 2024
09c24ea
Merge pull request #47 from kurtmckee/pre-commit-ci-update-config
kurtmckee Dec 3, 2024
1842ef4
[pre-commit.ci] pre-commit autoupdate
pre-commit-ci[bot] Jan 7, 2025
7d9dfa0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 7, 2025
18aacdd
Merge pull request #48 from kurtmckee/pre-commit-ci-update-config
kurtmckee Jan 7, 2025
e4d1fb9
Update pre-commit hooks; switch to plain editorconfig-checker
kurtmckee Jan 27, 2025
de48879
Merge pull request #49 from kurtmckee/updates
kurtmckee Jan 27, 2025
c7d2df1
Bump kurtmckee/github-workflows in the github-actions group
dependabot[bot] Feb 1, 2025
1c634a7
Merge pull request #50 from kurtmckee/dependabot/github_actions/githu…
kurtmckee Feb 3, 2025
e1e44d0
[pre-commit.ci] pre-commit autoupdate
pre-commit-ci[bot] Feb 4, 2025
45c77bd
Merge pull request #51 from kurtmckee/pre-commit-ci-update-config
kurtmckee Feb 4, 2025
c62b7e6
[pre-commit.ci] pre-commit autoupdate
pre-commit-ci[bot] Mar 3, 2025
e8b80d9
Merge pull request #52 from kurtmckee/pre-commit-ci-update-config
kurtmckee Mar 4, 2025
4ad34c8
Support CPython 3.13 and PyPy 3.11; test against CPython 3.14
kurtmckee Mar 6, 2025
d600250
Merge pull request #53 from kurtmckee/updates
kurtmckee Mar 6, 2025
584d7c8
Migrate to PEP 621 metadata
kurtmckee Mar 6, 2025
e5e531f
Merge pull request #54 from kurtmckee/update-pyproject.toml
kurtmckee Mar 6, 2025
e6a90e0
Update project metadata
kurtmckee Mar 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
18 changes: 10 additions & 8 deletions .github/workflows/readme_example.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is a part of the detect-pythons project.
# https://github.com/kurtmckee/detect-pythons
# Copyright 2023 Kurt McKee <contactme@kurtmckee.org>
# Copyright 2023-2025 Kurt McKee <contactme@kurtmckee.org>
# SPDX-License-Identifier: MIT

# This workflow exists for several purposes:
Expand Down Expand Up @@ -46,13 +46,13 @@ jobs:
- uses: "actions/setup-python@v5"
with:
python-version: |
graalpy-23.1
pypy-3.10
3.12
graalpy-24
pypy-3.11
3.13

- uses: "kurtmckee/detect-pythons@v1"

- uses: "actions/cache@v3"
- uses: "actions/cache@v4"
id: "restore-cache"
with:
# You may need to augment the list of files to hash.
Expand All @@ -64,7 +64,8 @@ jobs:

- name: "Identify .venv path"
shell: "bash"
run: "echo 'venv-path=.venv/${{ runner.os == 'Windows' && 'Scripts' || 'bin' }}' >> $GITHUB_ENV"
run: |
echo 'venv-path=.venv/${{ runner.os == 'Windows' && 'Scripts' || 'bin' }}' >> "$GITHUB_ENV"

- name: "Create a virtual environment"
if: "steps.restore-cache.outputs.cache-hit == false"
Expand Down Expand Up @@ -95,7 +96,7 @@ jobs:

- uses: "kurtmckee/detect-pythons@v1"

- uses: "actions/cache@v3"
- uses: "actions/cache@v4"
id: "restore-cache"
with:
# You may need to augment the list of files to hash.
Expand All @@ -107,7 +108,8 @@ jobs:

- name: "Identify .venv path"
shell: "bash"
run: "echo 'venv-path=.venv/${{ runner.os == 'Windows' && 'Scripts' || 'bin' }}' >> $GITHUB_ENV"
run: |
echo 'venv-path=.venv/${{ runner.os == 'Windows' && 'Scripts' || 'bin' }}' >> "$GITHUB_ENV"

- name: "Create a virtual environment"
if: "steps.restore-cache.outputs.cache-hit == false"
Expand Down
97 changes: 39 additions & 58 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "🔬 Test"
name: "🧪 Test"

on:
pull_request: null
Expand All @@ -8,70 +8,52 @@ on:
- "releases"

jobs:
tox:
name: "Tox (${{ matrix.os.name }})"
code:
name:
"Code (${{
(startswith(matrix.runner, 'ubuntu') && 'Linux')
|| (startswith(matrix.runner, 'macos') && 'macOS')
|| (startswith(matrix.runner, 'windows') && 'Windows')
}})"

strategy:
matrix:
os:
- name: "Linux"
runner: "ubuntu-latest"
- name: "macOS"
runner: "macos-latest"
- name: "Windows"
runner: "windows-latest"
fail-fast: false
matrix:
runner:
- "ubuntu-latest"
- "macos-latest"
- "windows-latest"

# Each operating system should test all Python interpreters simultaneously.
#
# Note: The CPython interpreter versions should be in ascending order
# because the last-listed version will be the default CPython version.
#
include:
- cpythons:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
cpython-beta: "3.14"
pypys:
- "3.8"
- "3.9"
- "3.10"
- "3.11"

uses: "kurtmckee/github-workflows/.github/workflows/tox.yaml@ca26472ada33aa277527450aa46436f530e3d2c1" # v1.4
with:
config: "${{ toJSON(matrix) }}"

runs-on: "${{ matrix.os.runner }}"
steps:
- name: "Checkout the repository"
uses: "actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11" # v4.1.1

- name: "Setup Pythons"
uses: "actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c" # v5.0.0
with:
python-version: |
pypy3.8
pypy3.9
pypy3.10
3.8
3.9
3.10
3.11
3.12
allow-prereleases: true
cache: "pip"

- name: "Detect Pythons"
uses: "./"

- name: "Restore cache"
id: "restore-cache"
uses: "actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84" # v3.3.2
with:
path: |
.tox/
.venv
key: "tox-os=${{ matrix.os.runner }}-hash=${{ hashFiles('.python-identifiers', 'tox.ini') }}"

- name: "Identify .venv path"
shell: "bash"
run: "echo 'venv-path=.venv/${{ runner.os == 'Windows' && 'Scripts' || 'bin' }}' >> $GITHUB_ENV"

- name: "Create a virtual environment"
if: "steps.restore-cache.outputs.cache-hit == false"
run: |
python -m venv .venv
${{ env.venv-path }}/python -m pip install --upgrade pip setuptools wheel
${{ env.venv-path }}/pip install tox

- name: "Run the test suite"
run: "${{ env.venv-path }}/tox"

inputs:
name: "Inputs (${{ matrix.os.name }})"

strategy:
fail-fast: false
matrix:
os:
- name: "Linux"
Expand All @@ -80,12 +62,11 @@ jobs:
runner: "macos-latest"
- name: "Windows"
runner: "windows-latest"
fail-fast: false

runs-on: "${{ matrix.os.runner }}"
steps:
- name: "Checkout the repository"
uses: "actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11" # v4.1.1
uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683" # v4.2.2

- name: "Test: Disable output file"
uses: "./"
Expand Down
33 changes: 23 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
ci:
autoupdate_schedule: "monthly"

default_language_version:
python: "python3.13"

repos:
- repo: "meta"
hooks:
- id: "check-hooks-apply"
- id: "check-useless-excludes"

- repo: "https://github.com/pre-commit/pre-commit-hooks"
rev: "v4.5.0"
rev: "v5.0.0"
hooks:
- id: "check-yaml"
- id: "check-added-large-files"
Expand All @@ -23,34 +26,39 @@ repos:
hooks:
- id: "update-headers"

- repo: "https://github.com/sirosen/slyp"
rev: 0.8.2
hooks:
- id: "slyp"

- repo: "https://github.com/psf/black-pre-commit-mirror"
rev: "23.12.0"
rev: "25.1.0"
hooks:
- id: "black"

- repo: "https://github.com/pycqa/isort"
rev: "5.13.2"
rev: "6.0.1"
hooks:
- id: "isort"

- repo: "https://github.com/pycqa/flake8"
rev: "6.1.0"
rev: "7.1.2"
hooks:
- id: "flake8"
additional_dependencies:
- "flake8-bugbear==23.12.2"
- "flake8-bugbear==24.12.12"

- repo: "https://github.com/editorconfig-checker/editorconfig-checker.python"
rev: "2.7.3"
- repo: "https://github.com/editorconfig-checker/editorconfig-checker"
rev: "v3.2.0"
hooks:
- id: "editorconfig-checker"
# The README contain YAML samples indented with 2 spaces.
# The README contains YAML samples indented with 2 spaces.
# The .editorconfig file requires 4 spaces for indentation,
# so this pre-commit hook will ignore the README.
exclude: "README.rst"

- repo: "https://github.com/shellcheck-py/shellcheck-py"
rev: "v0.9.0.6"
rev: "v0.10.0.1"
hooks:
- id: "shellcheck"
args:
Expand All @@ -66,7 +74,12 @@ repos:
pass_filenames: false

- repo: "https://github.com/python-jsonschema/check-jsonschema"
rev: "0.27.3"
rev: "0.31.2"
hooks:
- id: "check-github-workflows"
- id: "check-dependabot"

- repo: "https://github.com/rhysd/actionlint"
rev: "v1.7.7"
hooks:
- id: "actionlint"
19 changes: 18 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
..
This file is a part of the detect-pythons project.
https://github.com/kurtmckee/detect-pythons
Copyright 2023 Kurt McKee <contactme@kurtmckee.org>
Copyright 2023-2025 Kurt McKee <contactme@kurtmckee.org>
SPDX-License-Identifier: MIT

..
Expand All @@ -24,6 +24,23 @@ Please see the fragment files in the `changelog.d directory`_.

.. scriv-insert-here

.. _changelog-1.1.1:

1.1.1 - 2025-03-06
==================

Python support
--------------

* Support CPython 3.13 and PyPy 3.11.
* Test against early versions of Python 3.14.

Development
-----------

* Migrate to PEP 621 project metadata.
* Migrate to a reusable CI workflow.

.. _changelog-1.1.0:

1.1.0 - 2023-12-16
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright 2023 Kurt McKee <contactme@kurtmckee.org>
Copyright 2023-2025 Kurt McKee <contactme@kurtmckee.org>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
45 changes: 13 additions & 32 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
..
This file is a part of the detect-pythons project.
https://github.com/kurtmckee/detect-pythons
Copyright 2023 Kurt McKee <contactme@kurtmckee.org>
Copyright 2023-2025 Kurt McKee <contactme@kurtmckee.org>
SPDX-License-Identifier: MIT

Detect Python interpreters
Expand Down Expand Up @@ -52,13 +52,13 @@ and tox test environments stored in ``.tox/``.
- uses: "actions/setup-python@v5"
with:
python-version: |
graalpy-23.1
pypy-3.10
3.12
graalpy-24
pypy-3.11
3.13

- uses: "kurtmckee/detect-pythons@v1"

- uses: "actions/cache@v3"
- uses: "actions/cache@v4"
id: "restore-cache"
with:
# You may need to augment the list of files to hash.
Expand All @@ -70,7 +70,8 @@ and tox test environments stored in ``.tox/``.

- name: "Identify .venv path"
shell: "bash"
run: "echo 'venv-path=.venv/${{ runner.os == 'Windows' && 'Scripts' || 'bin' }}' >> $GITHUB_ENV"
run: |
echo 'venv-path=.venv/${{ runner.os == 'Windows' && 'Scripts' || 'bin' }}' >> "$GITHUB_ENV"

- name: "Create a virtual environment"
if: "steps.restore-cache.outputs.cache-hit == false"
Expand Down Expand Up @@ -153,8 +154,8 @@ System CPython interpreters
---------------------------

GitHub's Linux and macOS runners have system CPython interpreters installed.
These are available at paths like ``/usr/bin/python``,
which contains no useful information.
These are available at paths which contain no useful information,
like ``/usr/bin/python``.

For these interpreters, the interpreter is executed
and the value of ``sysconfig.get_config_var("EXT_SUFFIX")`` is extracted.
Expand All @@ -166,31 +167,11 @@ This results in a value like the following:
"Linux", "``.cpython-310-x86_64-linux-gnu.so``"
"macOS", "``.cpython-311-darwin.so``"


macOS runner variability
------------------------

At the time of writing, GitHub's macOS runners sometimes have CPython 2.7 pre-installed.
CPython 2.7 doesn't have an ``EXT_SUFFIX`` config value,
so ``detect-pythons`` constructs one.
Extremely old Python versions might not have an ``EXT_SUFFIX`` value.
For example, CPython 2.7 doesn't have this value.
If this is detected then an equivalent value is constructed.

.. csv-table::
:header: "Platform", "Constructed ``EXT_SUFFIX`` equivalent"

"macOS 12.6", "``.cpython-27-darwin-x86_64``"

Note that CPython 2.7 is only installed *sometimes*; sometimes it isn't.
This is because ``macos-latest`` is sometimes macOS 12.6, and sometimes it's macOS 12.7.
See `actions/runner-images#8642`_ for more information.

When using ``detect-pythons`` to help with cache-busting,
this variability means that you may see two caches appear in regular use
for your macOS-based workflows;
one that is valid when CPython 2.7 is pre-installed,
and another that is valid when it *isn't* installed.


.. Links
.. -----
..
.. _actions/runner-images#8642: https://github.com/actions/runner-images/issues/8642
"macOS", "``.cpython-27-darwin-x86_64``"
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is a part of the detect-pythons project.
# https://github.com/kurtmckee/detect-pythons
# Copyright 2023 Kurt McKee <contactme@kurtmckee.org>
# Copyright 2023-2025 Kurt McKee <contactme@kurtmckee.org>
# SPDX-License-Identifier: MIT

author: "Kurt McKee"
Expand Down
Loading