Skip to content

Commit

Permalink
Merge pull request #17 from kurtmckee/release-1.1.0
Browse files Browse the repository at this point in the history
Release 1.1.0
  • Loading branch information
kurtmckee authored Dec 16, 2023
2 parents cd21936 + 9e70217 commit 38187a5
Show file tree
Hide file tree
Showing 18 changed files with 481 additions and 362 deletions.
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: "kurtmckee"
ko_fi: "kurtmckee"
57 changes: 51 additions & 6 deletions .github/workflows/readme_example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,29 @@ on:

jobs:
readme_example:
name: "Test README code (${{ matrix.os.name }})"
name: "Verify (${{ matrix.os.name }})"
strategy:
matrix:
os:
- name: "Linux"
runner: "ubuntu-latest"
- name: "macOS"
runner: "macos-latest"
- name: "Windows"
runner: "windows-latest"
# Temporarily disable Windows here because GraalPy doesn't support it yet.
# Windows can be reintegrated here when GraalPy supports Windows.
# - name: "Windows"
# runner: "windows-latest"
fail-fast: false

runs-on: "${{ matrix.os.runner }}"
steps:
# START_README_EXAMPLE_BLOCK
- uses: "actions/setup-python@v4"
- uses: "actions/setup-python@v5"
with:
python-version: |
pypy3.10
3.11
graalpy-23.1
pypy-3.10
3.12
- uses: "kurtmckee/detect-pythons@v1"

Expand Down Expand Up @@ -77,3 +80,45 @@ jobs:
- name: "Run the test suite against all installed Pythons"
run: "${{ env.venv-path }}/tox"
# END_README_EXAMPLE_BLOCK

duplicate-for-windows-without-graalpy:
# This duplicate exists solely to avoid testing GraalPy on Windows.
# It is anticipated that GraalPy will be available for Windows April 2024.
name: "Verify (Windows)"
runs-on: "windows-latest"
steps:
- uses: "actions/setup-python@v5"
with:
python-version: |
pypy-3.10
3.12
- uses: "kurtmckee/detect-pythons@v1"

- uses: "actions/cache@v3"
id: "restore-cache"
with:
# You may need to augment the list of files to hash.
# For example, you might add 'requirements/*.txt' or 'pyproject.toml'.
key: "${{ hashFiles('.python-identifiers') }}"
path: |
.tox/
.venv/
- 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
# You may need to customize what gets installed next.
# However, tox is able to run test suites against multiple Pythons,
# so it's a helpful tool for efficient testing.
${{ env.venv-path }}/pip install tox
- name: "Run the test suite against all installed Pythons"
run: "${{ env.venv-path }}/tox"
107 changes: 98 additions & 9 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
name: "🔬 Test"

on:
pull_request: null
push:
branches:
- "main"
- "releases"

jobs:
test:
name: "Test on ${{ matrix.os.name }}"
tox:
name: "Tox (${{ matrix.os.name }})"

strategy:
matrix:
Expand All @@ -22,16 +24,103 @@ jobs:

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

- name: "Print it!"
- 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: |
echo '${{ steps.detector.outputs.python-identifiers }}'
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:
matrix:
os:
- name: "Linux"
runner: "ubuntu-latest"
- name: "macOS"
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

- name: "Test: Disable output file"
uses: "./"
with:
identifiers-filename: ""

- name: "Verify: Disable output file"
shell: "bash"
run: |
if [[ -e .python-identifiers ]]; then
exit 1
fi
- name: "Test: Default output filename"
uses: "./"

- name: "Verify: Default output filename"
shell: "bash"
run: |
if [[ ! -e .python-identifiers ]]; then
exit 1
else
rm ".python-identifiers"
fi
- name: "Test: Custom output filename"
uses: "./"
with:
identifiers-filename: "favored-filename.txt"

- name: "Display it!"
- name: "Verify: Custom output filename"
shell: "bash"
run: |
cat .python-identifiers
if [[ ! -e "favored-filename.txt" ]]; then
exit 1
else
rm "favored-filename.txt"
fi
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
__pycache__
.coverage*
.tox/
39 changes: 18 additions & 21 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,43 +10,45 @@ repos:
- repo: "https://github.com/pre-commit/pre-commit-hooks"
rev: "v4.5.0"
hooks:
- id: "trailing-whitespace"
- id: "end-of-file-fixer"
- id: "check-yaml"
- id: "check-added-large-files"
- id: "end-of-file-fixer"
- id: "mixed-line-ending"
args:
- "--fix=lf"
- id: "trailing-whitespace"

- repo: "https://github.com/kurtmckee/chipshot"
rev: "v0.7.0"
hooks:
- id: "update-headers"

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

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

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

- repo: "https://github.com/editorconfig-checker/editorconfig-checker.python"
rev: "2.7.3"
hooks:
- id: "editorconfig-checker"
# The README contains YAML syntax that is indented with 2 spaces.
# The .editorconfig file will continue to require 4 spaces,
# and this pre-commit hook will ignore the README.
# The README contain 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: "local"
hooks:
- id: "sync-identify-code"
name: "Synchronize identify.py source code into 'detector.sh'"
language: "python"
entry: "python src/detect_pythons/sync_identify_code.py"
files: "^src/detect_pythons/identify.py$"

- repo: "https://github.com/shellcheck-py/shellcheck-py"
rev: "v0.9.0.6"
hooks:
Expand All @@ -56,11 +58,6 @@ repos:

- repo: "local"
hooks:
- id: "sync-detector-code"
name: "Synchronize detector source code into 'action.yml'"
language: "python"
entry: "python src/detect_pythons/sync_detector_code.py"
files: "^src/detect_pythons/detector.*$"
- id: "sync-readme-example"
name: "Synchronize a functional example into the README"
language: "python"
Expand All @@ -69,7 +66,7 @@ repos:
pass_filenames: false

- repo: "https://github.com/python-jsonschema/check-jsonschema"
rev: "0.27.0"
rev: "0.27.3"
hooks:
- id: "check-github-workflows"
- id: "check-dependabot"
36 changes: 32 additions & 4 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
.. This file is a part of the detect-pythons project.
.. https://github.com/kurtmckee/detect-pythons
.. Copyright 2023 Kurt McKee <[email protected]>
.. SPDX-License-Identifier: MIT
..
This file is a part of the detect-pythons project.
https://github.com/kurtmckee/detect-pythons
Copyright 2023 Kurt McKee <[email protected]>
SPDX-License-Identifier: MIT
..
STOP!
Expand All @@ -23,6 +24,33 @@ Please see the fragment files in the `changelog.d directory`_.

.. scriv-insert-here
.. _changelog-1.1.0:

1.1.0 - 2023-12-16
==================

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

* Document that GraalPy is a supported interpreter, and test it.

* Locally test against early Python 3.13 versions.

Changed
-------

* ``None`` should no longer appear in the identifier
for Python interpreters missing an ``EXT_SUFFIX`` sysconfig value.

* Simplify how the action runs.

Previously, the underlying shell scripts were embedded directly into ``action.yml``.

Documentation
-------------

* Document current ``macos-latest`` runner variability.

.. _changelog-1.0.0:

1.0.0 - 2023-10-26
Expand Down
Loading

0 comments on commit 38187a5

Please sign in to comment.