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

Replaced StrictVersion with packaging.version.parse for Python 3.12 compatibility #727

Closed
wants to merge 1 commit into from

Conversation

morpheby
Copy link

@morpheby morpheby commented Aug 1, 2024

Simple drop-in replacement for the distutils.StrictVersion. Should partly

@axu2
Copy link
Collaborator

axu2 commented Aug 1, 2024

Shouldn't we use Version and not version.parse?
pypa/packaging#520 (comment)

Also, we need to remove distutils entirely, not just StrictVersion. Id check out the partial commit linked in the issue

@morpheby
Copy link
Author

morpheby commented Aug 1, 2024

@axu2 Good point. I wasn’t really paying attention and just fixed what I needed to start the KCC from python. I’ll check and fix everything else next time I have some free time :) (hopefully soon)

@morpheby
Copy link
Author

morpheby commented Aug 1, 2024

As for Version initializer vs parse, according to documentation both seem equivalent and a matter of style.

@axu2
Copy link
Collaborator

axu2 commented Aug 1, 2024

The rest of distutils is only used when calling python setup.py build_binary.

Fun fact, parse literally just calls Version. But Version looks cleaner than version.parse

https://github.com/pypa/packaging/blob/main/src/packaging/version.py

Copy link
Collaborator

@axu2 axu2 left a comment

Choose a reason for hiding this comment

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

Superceded by

In setup.py, you need to remove

import distutils.cmd
class BuildBinaryCommand(distutils.cmd.Command):

with

class BuildBinaryCommand(setuptools.Command):

And verify that python setup.py build_binary works.

requirements.txt Show resolved Hide resolved
kindlecomicconverter/shared.py Show resolved Hide resolved
kindlecomicconverter/KCC_gui.py Show resolved Hide resolved
kindlecomicconverter/KCC_gui.py Show resolved Hide resolved
@axu2 axu2 closed this Aug 28, 2024
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.

distutils is deprecated with removal planned for Python 3.12
2 participants