Skip to content

Commit

Permalink
Add support for Python 3.13. (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsirois committed Jan 6, 2024
1 parent 614c159 commit 271e589
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 23 deletions.
69 changes: 54 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,40 +23,79 @@ jobs:
tox-env: typecheck
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "${{ matrix.python-version }}"
- name: Check ${{ matrix.check-name }}
uses: pantsbuild/actions/run-tox@e63d2d0e3c339bdffbe5e51e7c39550e3bc527bb
uses: pantsbuild/actions/run-tox@b16b9cf47cd566acfe217b1dafc5b452e27e6fd7
with:
tox-env: ${{ matrix.tox-env }}
unit-tests-legacy:
name: (${{ matrix.os }}) TOXENV=py${{ matrix.python-version[0] }}${{ matrix.python-version[1] }}
needs: org-check
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- python-version: [2, 7, 18]
os: ubuntu-22.04
- python-version: [3, 5, 10]
os: ubuntu-22.04
- python-version: [3, 6, 15]
os: ubuntu-22.04
- python-version: [2, 7, 18]
os: macos-12
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python ${{ join(matrix.python-version, '.') }}
id: pyenv
uses: gabrielfalcao/pyenv-action@v18
with:
default: "${{ join(matrix.python-version, '.') }}"
- name: Run Unit Tests
run: |
alias python="${{ steps.pyenv.outputs.pyenv_root }}/versions/${{ join(matrix.python-version, '.') }}/bin/python"
python -V
python -mensurepip -U
python -mpip install -U tox
python -mtox -epy${{ matrix.python-version[0] }}${{ matrix.python-version[1] }} -- -vvs
unit-tests:
name: (${{ matrix.os }}) TOXENV=py${{ matrix.python-version[0] }}${{ matrix.python-version[1] }}
needs: org-check
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [[2, 7], [3, 7], [3, 8], [3, 9], [3, 10], [3, 11], [3, 12, "0-beta.2"]]
os: [ubuntu-22.04, macos-12]
exclude:
- os: macos-12
include:
- os: ubuntu-22.04
python-version: [3, 7]
- os: macos-12
- os: ubuntu-22.04
python-version: [3, 8]
- os: macos-12
- os: ubuntu-22.04
python-version: [3, 9]
- os: macos-12
- os: ubuntu-22.04
python-version: [3, 10]
- os: ubuntu-22.04
python-version: [3, 11]
- os: ubuntu-22.04
python-version: [3, 12]
- os: ubuntu-22.04
python-version: [3, 13, "0-alpha.2"]
- os: macos-12
python-version: [3, 12]
- os: macos-12
python-version: [3, 13, "0-alpha.2"]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Python ${{ join(matrix.python-version, '.') }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "${{ join(matrix.python-version, '.') }}"
- name: Run Unit Tests
uses: pantsbuild/actions/run-tox@e63d2d0e3c339bdffbe5e51e7c39550e3bc527bb
with:
tox-env: py${{ matrix.python-version[0] }}${{ matrix.python-version[1] }} -- -vvs
run: |
pip install -U pip
pip install -U tox
tox -epy${{ matrix.python-version[0] }}${{ matrix.python-version[1] }} -- -vvs
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ jobs:
id-token: write
steps:
- name: Checkout ${{ needs.determine-tag.outputs.release-tag }}
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ needs.determine-tag.outputs.release-tag }}
- name: Setup Python 3.9
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Package ${{ needs.determine-tag.outputs.release-tag }}
uses: pantsbuild/actions/run-tox@e63d2d0e3c339bdffbe5e51e7c39550e3bc527bb
uses: pantsbuild/actions/run-tox@b16b9cf47cd566acfe217b1dafc5b452e27e6fd7
with:
tox-env: package
- name: Publish ${{ needs.determine-tag.outputs.release-tag }}
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["flit_core>=2,<3"]
requires = ["flit_core>=2,<4"]
build-backend = "flit_core.buildapi"

[tool.flit.metadata]
Expand All @@ -24,9 +24,10 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Utilities",
]
requires-python = ">=2.7,<3.13,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*"
requires-python = ">=2.7,<3.14,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*"
requires = [
"setuptools; python_version <= '3.5'",
"importlib-metadata; python_version == '3.6' or python_version == '3.7'",
Expand Down
12 changes: 9 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
minversion = 3.23.0
minversion = 3.28.0
isolated_build = true
skip_missing_interpreters = true

Expand All @@ -16,11 +16,16 @@ envlist =
py310
py311
py312
py313

[testenv]
deps =
pex==2.1.137; python_version < "3.12"
shiv==1.0.3; python_version >= "3.6"
pex==2.1.156; python_version < "3.13"

# The fix for shiv under Python 3.123 is off for review in https://github.com/linkedin/shiv/pull/249
shiv==1.0.4; python_version >= "3.6" and python_version < "3.13"
git+https://github.com/jsirois/shiv@0c8b3e83238327e51955d66ba4fee28c4fc7107f#egg=shiv; python_version >= "3.13"

pytest==4.6.11; python_version < "3.6"
pytest==6.2.5; python_version >= "3.6"
commands =
Expand Down Expand Up @@ -70,6 +75,7 @@ commands =
mypy --python-version 3.10 .
mypy --python-version 3.11 .
mypy --python-version 3.12 .
mypy --python-version 3.13 .

[_flit]
basepython = python3
Expand Down

0 comments on commit 271e589

Please sign in to comment.