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

Fix for python 3.12: replace removed distutils #2113

Merged
merged 13 commits into from
Oct 16, 2023
Merged

Fix for python 3.12: replace removed distutils #2113

merged 13 commits into from
Oct 16, 2023

Conversation

vladsavelyev
Copy link
Member

@vladsavelyev vladsavelyev commented Oct 12, 2023

distutils was fully removed in Python 3.12: https://peps.python.org/pep-0632/#migration-advice

  1. Replace distutils.version.StrictVersion with packaging.version
  2. Replace distutils.util.strtobool with re-implementation
  3. Replace distutils.dir_util.copy_tree with shutil.copytree calls

@vladsavelyev vladsavelyev changed the title Fix for python 3.12: replace removed distutil with shutil to copy dir with time and mode unpreserved Fix for python 3.12: replace removed distutil Oct 12, 2023
@vladsavelyev vladsavelyev changed the title Fix for python 3.12: replace removed distutil Fix for python 3.12: replace removed distutils Oct 12, 2023
@vladsavelyev
Copy link
Member Author

@multiqc-bot changelog

Copy link
Member

@ewels ewels left a comment

Choose a reason for hiding this comment

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

Nice 👍🏻

multiqc/modules/picard/picard.py Outdated Show resolved Hide resolved
@ewels
Copy link
Member

ewels commented Oct 12, 2023

@multiqc-bot fix linting

@vladsavelyev
Copy link
Member Author

(Please merge #2115 first)

@vladsavelyev
Copy link
Member Author

@multiqc-bot changelog

@vladsavelyev
Copy link
Member Author

Sigh, dirs_exist_ok to shutil.copytree() was only added in Py 3.8 :( https://docs.python.org/3/whatsnew/3.8.html#shutil

Should probably add an if-else to import distutils for 3.6 and 3.7 instead of calling shutils.

@ewels
Copy link
Member

ewels commented Oct 14, 2023

If we do, maybe we add a note to #2039

It would be really nice to know what Python versions people are using! No idea how many people are still on 3.7..

@vladsavelyev
Copy link
Member Author

Good point. I thought we are dropping only 3.6; but if we drop 3.7 as well, it should be nice.

Copy link
Member

@ewels ewels left a comment

Choose a reason for hiding this comment

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

Great!

@ewels ewels merged commit 639b74b into master Oct 16, 2023
3 of 6 checks passed
@ewels ewels deleted the replace-distuils branch October 16, 2023 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants