Skip to content

Commit

Permalink
Merge pull request #534 from akaihola/limit-before-black-24-2
Browse files Browse the repository at this point in the history
Limit Black below version 24.2 until incompatibility is resolved
  • Loading branch information
akaihola authored Feb 26, 2024
2 parents bea8cb2 + fc87c4f commit dc3d0c8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,15 @@ jobs:
- '3.11'
- '3.12-dev'
constraints: ['black==22.12.0']
post_install: ['']
include:
- os: ubuntu-latest
python-version: '3.7'
constraints: '--constraint constraints-oldest.txt'
- os: ubuntu-latest
python-version: '3.11'
constraints: '--constraint constraints-future.txt'
upgrade: '--upgrade --upgrade-strategy=eager'
post_install: pip install -r constraints-future.txt
--upgrade --upgrade-strategy=eager
needs:
- build-wheel
steps:
Expand All @@ -113,6 +114,12 @@ jobs:
- name: Install Darker and its dependencies from the wheel build earlier
run: pip install "${{needs.build-wheel.outputs.wheel-path}}[test]"
${{ matrix.upgrade }} ${{ matrix.constraints }}
- name: Upgrade Black and Isort from GitHub if future constraints are used
# This can't be done in the same Pip invocation as installing Darker
# since Darker might place an upper limit on Black and/or Isort during
# compatibility fixing periods.
if: matrix.post_install
run: ${{ matrix.post_install }}
- name: Downgrade target-version when running oldest supported Black
if: matrix.constraints == '--constraint constraints-oldest.txt'
run: |
Expand Down
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ These features will be included in the next release:

Added
-----
- Limit Black to versions before 24.2 until the incompatibility is resolved.

Fixed
-----
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ package_dir =
packages = find:
install_requires =
# NOTE: remember to keep `constraints-oldest.txt` in sync with these
black>=21.5b1
black>=21.5b1,<24.2 # upper limit until incompatibility fixed
toml>=0.10.0
typing-extensions ; python_version < "3.8"
# NOTE: remember to keep `.github/workflows/python-package.yml` in sync
Expand All @@ -55,7 +55,7 @@ color =
test =
# NOTE: remember to keep `constraints-oldest.txt` in sync with these
airium>=0.2.3
black>=21.7b1 # to prevent Mypy error about `gen_python_files`, see issue #189
black>=21.7b1,<24.2 # prevent Mypy error about `gen_python_files`, see issue #189
cryptography>=3.3.2 # through twine, fixes CVE-2020-36242
defusedxml>=0.7.1
flynt>=0.76,<0.78
Expand Down

0 comments on commit dc3d0c8

Please sign in to comment.