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

ccmlib: Remove usages of distutils #544

Merged
merged 2 commits into from
Dec 25, 2023
Merged

Conversation

k0machi
Copy link
Contributor

@k0machi k0machi commented Dec 19, 2023

This change removes all uses of distutils modules and replaces them with
either direct replacements or extractions from the library.
LooseVersion is extracted into ccmlib.utils.version and dir_util.copy_tree
is replaced by shutil.copytree.

Fixes #537

@k0machi k0machi requested a review from fruch December 19, 2023 10:20
@k0machi k0machi self-assigned this Dec 19, 2023
@k0machi k0machi force-pushed the remove-distutils branch 5 times, most recently from 12f6590 to dd6ea47 Compare December 19, 2023 10:49
@@ -385,15 +386,15 @@ def get_tagged_version_numbers(series='stable'):
for ref in (i.get('ref', '') for i in json.loads(tag_url.read())):
m = tag_regex.match(ref)
if m:
releases.append(LooseVersion(m.groups()[0]))
releases.append(Version(m.groups()[0]))
Copy link
Contributor

Choose a reason for hiding this comment

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

lets try using parse_version ? instead to supporting old LooseVersion

Copy link
Contributor Author

@k0machi k0machi Dec 19, 2023

Choose a reason for hiding this comment

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

Usng parse_version (or packaging.version) seems to be incompatible with tests we're running which check 2.6-dev-0.20211108.5f1e01cbb34-SNAPSHOT-5f1e01cbb34 (packaging.version.Version raises an exception there) as a parseable version, so I don't know if we can quite fit the version parsing as it is in parse_version.

tests/test_config.py Outdated Show resolved Hide resolved
Copy link
Contributor

@fruch fruch left a comment

Choose a reason for hiding this comment

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

Lets avoid dragging in deprecated code

k0machi and others added 2 commits December 25, 2023 12:16
This change removes all uses of distutils modules and replaces them with
either direct replacements or extractions from the library.
LooseVersion is extracted into ccmlib.utils.version and dir_util.copy_tree
is replaced by shutil.copytree.

Fixes scylladb#537
Copy link
Contributor

@fruch fruch left a comment

Choose a reason for hiding this comment

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

LGTM

@fruch fruch merged commit 72f960f into scylladb:next Dec 25, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix compatibility with Python 3.12
2 participants