Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Python 3.12 #561

Merged
merged 3 commits into from
Mar 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading