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.11 #415

Merged
merged 3 commits into from
Dec 26, 2022
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
6 changes: 4 additions & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
- build-wheel
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v17
- uses: cachix/install-nix-action@v18
with:
nix_path: nixpkgs=channel:nixos-21.11
- name: Download wheel uploaded by the build-wheel job
Expand Down Expand Up @@ -88,13 +88,15 @@ jobs:
- '3.8'
- '3.9'
- '3.10'
- '3.11'
- '3.12-dev'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if using a development version of Python will lead to frequent test failures.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failures are possible but hopefully not frequent. I've rarely seen them when testing dev versions, but I have found a release blocker in CPython itself by doing so :)

This may also help find early issues in Black and isort, and other linters.

It also means Darker can be ready for 3.12 sooner.

If there are failures, and they're not quick to fix, I wouldn't hesitate to comment this out until it's resolved.

I guess as the linters used by Darker do AST things, there's more exposure to syntax changes before the beta feature freeze in May, so one approach could be to wait until then.

constraints: ['black==22.12.0']
include:
- os: ubuntu-latest
python-version: '3.7'
constraints: '--constraint constraints-oldest.txt'
- os: ubuntu-latest
python-version: '3.10'
python-version: '3.11'
constraints: '--constraint constraints-future.txt'
upgrade: '--upgrade --upgrade-strategy=eager'
needs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-future.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.x'
- name: Install dependencies
run: |
# strict dependency resolution added in pip 20.3
Expand Down
5 changes: 4 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ These features will be included in the next release:

Added
-----
- Declare Python 3.11 as supported in package metadata.

Fixed
-----
- Pin Black to version 22.12.0 in the CI build to ensure consistent formatting of
Darker's own code base.
- Fix compatibility with ``black-22.10.1.dev19+gffaaf48`` and later – an argument was
replaced in ``black.files.gen_python_files()``.


1.6.0_ - 2022-12-19
Expand Down Expand Up @@ -131,7 +134,7 @@ Fixed
- Consider ``.py.tmp`` as files which should be reformatted.
This enables VSCode Format On Save.
- Use the latest release of Darker instead of 1.3.2 in the GitHub Action.


1.4.0_ - 2022-02-08
===================
Expand Down
2 changes: 1 addition & 1 deletion default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs ? import <nixpkgs> { }, pythonVersion ? "python310" }:
{ pkgs ? import <nixpkgs> { }, pythonVersion ? "python311" }:
(
pkgs.stdenv.mkDerivation {
name = "darker-test";
Expand Down
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ classifiers =
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
project_urls =
Source Code = https://github.com/akaihola/darker
Change Log = https://github.com/akaihola/darker/blob/master/CHANGES.rst
Expand Down Expand Up @@ -85,4 +86,4 @@ ignore =

[codespell]
ignore-words-list = nd
skip = .git,*.json
skip = .git,*.json