Skip to content

Commit 38187a5

Browse files
authored
Merge pull request #17 from kurtmckee/release-1.1.0
Release 1.1.0
2 parents cd21936 + 9e70217 commit 38187a5

18 files changed

+481
-362
lines changed

.github/FUNDING.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github: "kurtmckee"
2+
ko_fi: "kurtmckee"

.github/workflows/readme_example.yaml

+51-6
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,29 @@ on:
2626

2727
jobs:
2828
readme_example:
29-
name: "Test README code (${{ matrix.os.name }})"
29+
name: "Verify (${{ matrix.os.name }})"
3030
strategy:
3131
matrix:
3232
os:
3333
- name: "Linux"
3434
runner: "ubuntu-latest"
3535
- name: "macOS"
3636
runner: "macos-latest"
37-
- name: "Windows"
38-
runner: "windows-latest"
37+
# Temporarily disable Windows here because GraalPy doesn't support it yet.
38+
# Windows can be reintegrated here when GraalPy supports Windows.
39+
# - name: "Windows"
40+
# runner: "windows-latest"
3941
fail-fast: false
4042

4143
runs-on: "${{ matrix.os.runner }}"
4244
steps:
4345
# START_README_EXAMPLE_BLOCK
44-
- uses: "actions/setup-python@v4"
46+
- uses: "actions/setup-python@v5"
4547
with:
4648
python-version: |
47-
pypy3.10
48-
3.11
49+
graalpy-23.1
50+
pypy-3.10
51+
3.12
4952
5053
- uses: "kurtmckee/detect-pythons@v1"
5154

@@ -77,3 +80,45 @@ jobs:
7780
- name: "Run the test suite against all installed Pythons"
7881
run: "${{ env.venv-path }}/tox"
7982
# END_README_EXAMPLE_BLOCK
83+
84+
duplicate-for-windows-without-graalpy:
85+
# This duplicate exists solely to avoid testing GraalPy on Windows.
86+
# It is anticipated that GraalPy will be available for Windows April 2024.
87+
name: "Verify (Windows)"
88+
runs-on: "windows-latest"
89+
steps:
90+
- uses: "actions/setup-python@v5"
91+
with:
92+
python-version: |
93+
pypy-3.10
94+
3.12
95+
96+
- uses: "kurtmckee/detect-pythons@v1"
97+
98+
- uses: "actions/cache@v3"
99+
id: "restore-cache"
100+
with:
101+
# You may need to augment the list of files to hash.
102+
# For example, you might add 'requirements/*.txt' or 'pyproject.toml'.
103+
key: "${{ hashFiles('.python-identifiers') }}"
104+
path: |
105+
.tox/
106+
.venv/
107+
108+
- name: "Identify .venv path"
109+
shell: "bash"
110+
run: "echo 'venv-path=.venv/${{ runner.os == 'Windows' && 'Scripts' || 'bin' }}' >> $GITHUB_ENV"
111+
112+
- name: "Create a virtual environment"
113+
if: "steps.restore-cache.outputs.cache-hit == false"
114+
run: |
115+
python -m venv .venv
116+
${{ env.venv-path }}/python -m pip install --upgrade pip setuptools wheel
117+
118+
# You may need to customize what gets installed next.
119+
# However, tox is able to run test suites against multiple Pythons,
120+
# so it's a helpful tool for efficient testing.
121+
${{ env.venv-path }}/pip install tox
122+
123+
- name: "Run the test suite against all installed Pythons"
124+
run: "${{ env.venv-path }}/tox"

.github/workflows/test.yaml

+98-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
name: "🔬 Test"
22

33
on:
4+
pull_request: null
45
push:
56
branches:
67
- "main"
8+
- "releases"
79

810
jobs:
9-
test:
10-
name: "Test on ${{ matrix.os.name }}"
11+
tox:
12+
name: "Tox (${{ matrix.os.name }})"
1113

1214
strategy:
1315
matrix:
@@ -22,16 +24,103 @@ jobs:
2224

2325
runs-on: "${{ matrix.os.runner }}"
2426
steps:
25-
- name: "Use it!"
26-
id: "detector"
27-
uses: "kurtmckee/detect-pythons@main"
27+
- name: "Checkout the repository"
28+
uses: "actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11" # v4.1.1
2829

29-
- name: "Print it!"
30+
- name: "Setup Pythons"
31+
uses: "actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c" # v5.0.0
32+
with:
33+
python-version: |
34+
pypy3.8
35+
pypy3.9
36+
pypy3.10
37+
3.8
38+
3.9
39+
3.10
40+
3.11
41+
3.12
42+
allow-prereleases: true
43+
cache: "pip"
44+
45+
- name: "Detect Pythons"
46+
uses: "./"
47+
48+
- name: "Restore cache"
49+
id: "restore-cache"
50+
uses: "actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84" # v3.3.2
51+
with:
52+
path: |
53+
.tox/
54+
.venv
55+
key: "tox-os=${{ matrix.os.runner }}-hash=${{ hashFiles('.python-identifiers', 'tox.ini') }}"
56+
57+
- name: "Identify .venv path"
3058
shell: "bash"
59+
run: "echo 'venv-path=.venv/${{ runner.os == 'Windows' && 'Scripts' || 'bin' }}' >> $GITHUB_ENV"
60+
61+
- name: "Create a virtual environment"
62+
if: "steps.restore-cache.outputs.cache-hit == false"
3163
run: |
32-
echo '${{ steps.detector.outputs.python-identifiers }}'
64+
python -m venv .venv
65+
${{ env.venv-path }}/python -m pip install --upgrade pip setuptools wheel
66+
${{ env.venv-path }}/pip install tox
67+
68+
- name: "Run the test suite"
69+
run: "${{ env.venv-path }}/tox"
70+
71+
inputs:
72+
name: "Inputs (${{ matrix.os.name }})"
73+
74+
strategy:
75+
matrix:
76+
os:
77+
- name: "Linux"
78+
runner: "ubuntu-latest"
79+
- name: "macOS"
80+
runner: "macos-latest"
81+
- name: "Windows"
82+
runner: "windows-latest"
83+
fail-fast: false
84+
85+
runs-on: "${{ matrix.os.runner }}"
86+
steps:
87+
- name: "Checkout the repository"
88+
uses: "actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11" # v4.1.1
89+
90+
- name: "Test: Disable output file"
91+
uses: "./"
92+
with:
93+
identifiers-filename: ""
94+
95+
- name: "Verify: Disable output file"
96+
shell: "bash"
97+
run: |
98+
if [[ -e .python-identifiers ]]; then
99+
exit 1
100+
fi
101+
102+
- name: "Test: Default output filename"
103+
uses: "./"
104+
105+
- name: "Verify: Default output filename"
106+
shell: "bash"
107+
run: |
108+
if [[ ! -e .python-identifiers ]]; then
109+
exit 1
110+
else
111+
rm ".python-identifiers"
112+
fi
113+
114+
- name: "Test: Custom output filename"
115+
uses: "./"
116+
with:
117+
identifiers-filename: "favored-filename.txt"
33118

34-
- name: "Display it!"
119+
- name: "Verify: Custom output filename"
35120
shell: "bash"
36121
run: |
37-
cat .python-identifiers
122+
if [[ ! -e "favored-filename.txt" ]]; then
123+
exit 1
124+
else
125+
rm "favored-filename.txt"
126+
fi

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
__pycache__
2+
.coverage*
3+
.tox/

.pre-commit-config.yaml

+18-21
Original file line numberDiff line numberDiff line change
@@ -10,43 +10,45 @@ repos:
1010
- repo: "https://github.com/pre-commit/pre-commit-hooks"
1111
rev: "v4.5.0"
1212
hooks:
13-
- id: "trailing-whitespace"
14-
- id: "end-of-file-fixer"
1513
- id: "check-yaml"
1614
- id: "check-added-large-files"
15+
- id: "end-of-file-fixer"
16+
- id: "mixed-line-ending"
17+
args:
18+
- "--fix=lf"
19+
- id: "trailing-whitespace"
20+
21+
- repo: "https://github.com/kurtmckee/chipshot"
22+
rev: "v0.7.0"
23+
hooks:
24+
- id: "update-headers"
1725

1826
- repo: "https://github.com/psf/black-pre-commit-mirror"
19-
rev: "23.10.1"
27+
rev: "23.12.0"
2028
hooks:
2129
- id: "black"
2230

2331
- repo: "https://github.com/pycqa/isort"
24-
rev: "5.12.0"
32+
rev: "5.13.2"
2533
hooks:
2634
- id: "isort"
2735

2836
- repo: "https://github.com/pycqa/flake8"
2937
rev: "6.1.0"
3038
hooks:
3139
- id: "flake8"
40+
additional_dependencies:
41+
- "flake8-bugbear==23.12.2"
3242

3343
- repo: "https://github.com/editorconfig-checker/editorconfig-checker.python"
3444
rev: "2.7.3"
3545
hooks:
3646
- id: "editorconfig-checker"
37-
# The README contains YAML syntax that is indented with 2 spaces.
38-
# The .editorconfig file will continue to require 4 spaces,
39-
# and this pre-commit hook will ignore the README.
47+
# The README contain YAML samples indented with 2 spaces.
48+
# The .editorconfig file requires 4 spaces for indentation,
49+
# so this pre-commit hook will ignore the README.
4050
exclude: "README.rst"
4151

42-
- repo: "local"
43-
hooks:
44-
- id: "sync-identify-code"
45-
name: "Synchronize identify.py source code into 'detector.sh'"
46-
language: "python"
47-
entry: "python src/detect_pythons/sync_identify_code.py"
48-
files: "^src/detect_pythons/identify.py$"
49-
5052
- repo: "https://github.com/shellcheck-py/shellcheck-py"
5153
rev: "v0.9.0.6"
5254
hooks:
@@ -56,11 +58,6 @@ repos:
5658

5759
- repo: "local"
5860
hooks:
59-
- id: "sync-detector-code"
60-
name: "Synchronize detector source code into 'action.yml'"
61-
language: "python"
62-
entry: "python src/detect_pythons/sync_detector_code.py"
63-
files: "^src/detect_pythons/detector.*$"
6461
- id: "sync-readme-example"
6562
name: "Synchronize a functional example into the README"
6663
language: "python"
@@ -69,7 +66,7 @@ repos:
6966
pass_filenames: false
7067

7168
- repo: "https://github.com/python-jsonschema/check-jsonschema"
72-
rev: "0.27.0"
69+
rev: "0.27.3"
7370
hooks:
7471
- id: "check-github-workflows"
7572
- id: "check-dependabot"

CHANGELOG.rst

+32-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
.. This file is a part of the detect-pythons project.
2-
.. https://github.com/kurtmckee/detect-pythons
3-
.. Copyright 2023 Kurt McKee <[email protected]>
4-
.. SPDX-License-Identifier: MIT
1+
..
2+
This file is a part of the detect-pythons project.
3+
https://github.com/kurtmckee/detect-pythons
4+
Copyright 2023 Kurt McKee <[email protected]>
5+
SPDX-License-Identifier: MIT
56
67
..
78
STOP!
@@ -23,6 +24,33 @@ Please see the fragment files in the `changelog.d directory`_.
2324

2425
.. scriv-insert-here
2526
27+
.. _changelog-1.1.0:
28+
29+
1.1.0 - 2023-12-16
30+
==================
31+
32+
Python support
33+
--------------
34+
35+
* Document that GraalPy is a supported interpreter, and test it.
36+
37+
* Locally test against early Python 3.13 versions.
38+
39+
Changed
40+
-------
41+
42+
* ``None`` should no longer appear in the identifier
43+
for Python interpreters missing an ``EXT_SUFFIX`` sysconfig value.
44+
45+
* Simplify how the action runs.
46+
47+
Previously, the underlying shell scripts were embedded directly into ``action.yml``.
48+
49+
Documentation
50+
-------------
51+
52+
* Document current ``macos-latest`` runner variability.
53+
2654
.. _changelog-1.0.0:
2755

2856
1.0.0 - 2023-10-26

0 commit comments

Comments
 (0)