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

Use packaging.version.Version in test-future.yml #803

Merged
merged 2 commits into from
Jan 8, 2025
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: 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
akaihola marked this conversation as resolved.
Show resolved Hide resolved
from distutils.version import LooseVersion
from importlib.metadata import version
from textwrap import dedent
akaihola marked this conversation as resolved.
Show resolved Hide resolved
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
Loading