Skip to content

Commit

Permalink
Merge pull request #561 from akaihola/py312
Browse files Browse the repository at this point in the history
Add support for Python 3.12
  • Loading branch information
akaihola authored Mar 16, 2024
2 parents 0f7af48 + 30f85ae commit 5916f77
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 6 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,16 @@ jobs:
- '3.9'
- '3.10'
- '3.11'
- '3.12-dev'
- '3.12'
- '3.13-dev'
constraints: ['']
post_install: ['']
include:
- os: ubuntu-latest
python-version: '3.8'
constraints: '--constraint constraints-oldest.txt'
- os: ubuntu-latest
python-version: '3.11'
python-version: '3.12'
post_install: pip install -r constraints-future.txt
--upgrade --upgrade-strategy=eager
needs:
Expand Down Expand Up @@ -128,7 +129,7 @@ jobs:
- name: Downgrade target-version when running oldest supported Black
if: matrix.constraints == '--constraint constraints-oldest.txt'
run: |
sed -i 's/py311/py39/' pyproject.toml
sed -i 's/, "py311", "py312"//' pyproject.toml
- run: pytest

build-sdist-validate-dists:
Expand Down
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Added
-----
- Mark the Darker package as annotated with type hints.
- Update to ``ioggstream/[email protected]`` in CI.
- Support for Python 3.12 in the package metadata and the CI build.

Removed
-------
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ project's root directory, or to a different TOML file specified using the ``-c``
line-length = 88 # Overridden by [tool.darker] above
skip-magic-trailing-comma = false
skip-string-normalization = false
target-version = ['py311']
target-version = ["py38", "py39", "py310", "py311", "py312"]
exclude = "test_*\.py"
extend_exclude = "/generated/"
force_exclude = ".*\.pyi"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ requires = ["setuptools", "wheel"] # PEP 508 specifications.
# Darker makes Black read its configuration from the file indicated by the `--config`
# option, so we need to mirror the same configuration here and in `check-darker.toml`.
skip-string-normalization = false
target-version = ["py311"]
target-version = ["py38", "py39", "py310", "py311", "py312"]

[tool.isort]
# Darker makes isort read its configuration from the file indicated by the `--config`
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ classifiers =
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
project_urls =
Source Code = https://github.com/akaihola/darker
Change Log = https://github.com/akaihola/darker/blob/master/CHANGES.rst
Expand Down
2 changes: 1 addition & 1 deletion src/darker/verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from black.parsing import ASTSafetyError # pylint: disable=ungrouped-imports
except ImportError:
# Black 24.2.0 and earlier
ASTSafetyError = AssertionError
ASTSafetyError = AssertionError # type: ignore[assignment,misc]


class NotEquivalentError(Exception):
Expand Down

0 comments on commit 5916f77

Please sign in to comment.