Skip to content

Commit

Permalink
Test Python 3.12 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
dolfinus committed Jan 30, 2024
1 parent 2e95fbb commit 4e8fe47
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 17 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

env:
DEFAULT_PYTHON: '3.12'

jobs:
analyze:
name: Analyze
Expand All @@ -27,19 +30,19 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: ${{ env.DEFAULT_PYTHON }}

- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-python-${{ matrix.python-version }}-codeql-${{ hashFiles('requirements*.txt') }}
key: ${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-codeql-${{ hashFiles('requirements*.txt') }}
restore-keys: |
${{ runner.os }}-python-${{ matrix.python-version }}-codeql-${{ hashFiles('requirements*.txt') }}
${{ runner.os }}-python-${{ matrix.python-version }}-codeql-
${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-codeql-${{ hashFiles('requirements*.txt') }}
${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-codeql-
${{ runner.os }}-python
${{ runner.os }}-
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dev-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
workflow_dispatch:

env:
DEFAULT_PYTHON: '3.11'
DEFAULT_PYTHON: '3.12'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- v*

env:
DEFAULT_PYTHON: '3.11'
DEFAULT_PYTHON: '3.12'

jobs:
release:
Expand Down
19 changes: 11 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

env:
DEFAULT_PYTHON: '3.12'

jobs:
tests:
name: Run ${{ matrix.mark}} tests (${{ matrix.python-version }} on ${{ matrix.os }})
Expand All @@ -27,14 +30,14 @@ jobs:
include:
- os: macos-latest
mark: important
python-version: '3.11'
python-version: '3.12'
- os: windows-latest
mark: important
python-version: '3.11'
python-version: '3.12'
# run all the tests only on latest python version
- os: ubuntu-latest
mark: all
python-version: '3.11'
python-version: '3.12'

steps:
- name: Checkout code
Expand Down Expand Up @@ -92,19 +95,19 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python 3.11
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: ${{ env.DEFAULT_PYTHON }}

- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-python-3.11-tests-${{ hashFiles('requirements*.txt') }}
key: ${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-tests-${{ hashFiles('requirements*.txt') }}
restore-keys: |
${{ runner.os }}-python-3.11-tests-${{ hashFiles('requirements*.txt') }}
${{ runner.os }}-python-3.11-tests-
${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-tests-${{ hashFiles('requirements*.txt') }}
${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-tests-
${{ runner.os }}-python
${{ runner.os }}-
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: '3.11'
python: '3.12'
jobs:
post_checkout:
- git fetch --unshallow || true
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ Changelog
.. change::
:tags: general, feature

Test Python 3.12 compatibility

.. change::
:tags: general, feature
:tickets: 93

Remove useless warning if ``tag_filter``, ``tag_formatter`` or ``branch_formatter`` is a regexp instead of function reference.

.. changelog::
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def parse_requirements(file: Path) -> list[str]:
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
Expand Down
2 changes: 1 addition & 1 deletion setuptools_git_versioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def _read_toml(name_or_path: str | os.PathLike = "pyproject.toml", root: str | o

log.log(INFO, "Trying 'pyproject.toml' ...")
try:
# for Python 3.11
# for Python 3.11+
import tomllib

with file_path.open("rb") as file:
Expand Down

0 comments on commit 4e8fe47

Please sign in to comment.