Skip to content

Commit

Permalink
Merge pull request #45 from mgedmin/py312
Browse files Browse the repository at this point in the history
Support Python 3.12
  • Loading branch information
mgedmin committed Oct 4, 2023
2 parents 7b3ae2d + 7133020 commit fcbf077
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 20 deletions.
33 changes: 18 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,20 @@ jobs:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "pypy-3.10"

steps:
- name: Git clone
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: "${{ matrix.python-version }}"

- name: Pip cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}
Expand All @@ -48,23 +49,24 @@ jobs:
run: |
python -m pip install -U pip
python -m pip install -U setuptools wheel
python -m pip install -U pytest coverage coveralls
python -m pip install -U pytest coverage
python -m pip install -e .
- name: Run tests
run: coverage run -m pytest tests
run: |
coverage run -m pytest tests
- name: Check test coverage
run: coverage report -m --fail-under=${{ (matrix.python-version == 'pypy-3.10') && 99 || 100 }}
run: |
coverage report -m --fail-under=${{ (matrix.python-version == 'pypy-3.10') && 99 || 100 }}
coverage xml
# pypy3.10 thinks utils.py has one uncovered branch (140 -> 133), which
# I think is just pypy's optimizer being too smart for coverage.py.

- name: Report to coveralls
run: coveralls
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
uses: coverallsapp/github-action@v2
with:
file: coverage.xml

lint:
name: ${{ matrix.toxenv }}
Expand All @@ -81,15 +83,15 @@ jobs:

steps:
- name: Git clone
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Python ${{ env.default_python || '3.9' }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: "${{ env.default_python || '3.9' }}"

- name: Pip cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.toxenv }}-${{ hashFiles('tox.ini') }}
Expand All @@ -104,4 +106,5 @@ jobs:
python -m pip install -U tox
- name: Run ${{ matrix.toxenv }}
run: python -m tox -e ${{ matrix.toxenv }}
run: |
python -m tox -e ${{ matrix.toxenv }}
7 changes: 5 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
Changelog
=========

0.21.4 (unreleased)
0.22.0 (unreleased)
-------------------

- Add support for Python 3.12: treat it as a released version, run CI tests on
3.12.

- Drop support for Python 3.7.


Expand Down Expand Up @@ -43,7 +46,7 @@ Changelog
0.20.0 (2022-10-27)
-------------------

- Add support for Python 3.11: threat it as a released version, run CI tests on
- Add support for Python 3.11: treat it as a released version, run CI tests on
3.11.


Expand Down
2 changes: 2 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ environment:
- PYTHON: "C:\\Python39"
- PYTHON: "C:\\Python310"
- PYTHON: "C:\\Python311"
- PYTHON: "C:\\Python312"

init:
- "echo %PYTHON%"
Expand All @@ -22,6 +23,7 @@ install:
- "set PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
- python --version
- pip install -U virtualenv # upgrade pip in tox's virtualenvs
- pip install setuptools # the test suite needs the system python to have setuptools
- pip install tox

build: off
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
],
Expand Down
2 changes: 1 addition & 1 deletion src/check_python_versions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
"""

__author__ = 'Marius Gedminas <marius@gedmin.as>'
__version__ = '0.21.4.dev0'
__version__ = '0.22.0.dev0'
2 changes: 1 addition & 1 deletion src/check_python_versions/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

MAX_PYTHON_1_VERSION = 6 # i.e. 1.6
MAX_PYTHON_2_VERSION = 7 # i.e. 2.7
CURRENT_PYTHON_3_VERSION = 11 # i.e. 3.10
CURRENT_PYTHON_3_VERSION = 12 # i.e. 3.12

MAX_MINOR_FOR_MAJOR = {
1: MAX_PYTHON_1_VERSION,
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py38,py39,py310,py311,pypy3,flake8,mypy,isort,coverage
envlist = py38,py39,py310,py311,py312,pypy3,flake8,mypy,isort,coverage

[testenv]
deps =
Expand Down

0 comments on commit fcbf077

Please sign in to comment.