Skip to content

Commit

Permalink
ci: use packaging.version.Version in test-future.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
akaihola committed Jan 8, 2025
1 parent c0571f3 commit 89f9e8e
Show file tree
Hide file tree
Showing 2 changed files with 4 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
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 89f9e8e

Please sign in to comment.