Skip to content

Commit

Permalink
Merge pull request #803 from akaihola/distutils-to-packaging
Browse files Browse the repository at this point in the history
Use packaging.version.Version in test-future.yml
  • Loading branch information
akaihola authored Jan 8, 2025
2 parents 7a27f64 + 424639c commit 49325bf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test-future.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ jobs:
import json
import os
import urllib.request
from distutils.version import LooseVersion
from importlib.metadata import version
from textwrap import dedent
from packaging.version import Version
for linenum, line in enumerate(open("setup.cfg"), 1):
constraint = line.strip()
if constraint.startswith("black>="):
Expand All @@ -57,7 +57,7 @@ jobs:
'https://pypi.org/pypi/black/json'
).read().decode()
latest_version = max(
LooseVersion(s)
Version(s)
for s in json.loads(response)['releases'].keys()
)
Expand Down
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ Fixed
- Only split source code lines at Python's universal newlines (LF, CRLF, CR).
- The Darker GitHub action now respects the ``working-directory`` input option.

Internal
--------
- Drop dependency on ``pip`` and ``distutils`` in the weekly CI "future" test. Use
``packaging`` instead.


2.1.1_ - 2024-04-16
===================
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ test =
flynt>=0.76
isort>=5.0.1
mypy>=0.990
packaging
pathspec # to test `gen_python_files` in `test_black_diff.py`
pydocstyle
pygments
Expand Down

0 comments on commit 49325bf

Please sign in to comment.