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

distutils is deprecated with removal planned for Python 3.12 #618

Closed
Cirn09 opened this issue Nov 17, 2023 · 2 comments · Fixed by #733
Closed

distutils is deprecated with removal planned for Python 3.12 #618

Cirn09 opened this issue Nov 17, 2023 · 2 comments · Fixed by #733
Assignees
Labels
dependencies Pull requests that update a dependency file python Pull requests that update Python code
Milestone

Comments

@Cirn09
Copy link

Cirn09 commented Nov 17, 2023

kcc-c2e.exe
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\Cirn09\AppData\Roaming\Python\Python312\Scripts\kcc-c2e.exe\__main__.py", line 4, in <module>
  File "C:\Users\Cirn09\AppData\Roaming\Python\Python312\site-packages\kindlecomicconverter\startup.py", line 24, in <module>
    from .shared import dependencyCheck
  File "C:\Users\Cirn09\AppData\Roaming\Python\Python312\site-packages\kindlecomicconverter\shared.py", line 24, in <module>
    from distutils.version import StrictVersion
ModuleNotFoundError: No module named 'distutils'

https://github.com/ciromattia/kcc/blob/7273ca25b8c56d39cf79967317951048cd826f8d/kindlecomicconverter/shared.py#L24C39-L24C39

The entire distutils package is deprecated, to be removed in Python 3.12. Its functionality for specifying package builds has already been completely replaced by third-party packages setuptools and packaging, and most other commonly used APIs are available elsewhere in the standard library (such as platform, shutil, subprocess or sysconfig). There are no plans to migrate any other functionality from distutils, and applications that are using other functions should plan to make private copies of the code. Refer to PEP 632 for discussion.

https://peps.python.org/pep-0632/#migration-advice

For these modules or types, use the standards-defined Python Packaging Authority packages specified:

  • distutils.version — use the packaging package
@Cirn09
Copy link
Author

Cirn09 commented Nov 30, 2023

easy to fix:

def StrictVersion(version: str) -> tuple[int]:
    return map(int, version.split('.'))

@axu2 axu2 added python Pull requests that update Python code dependencies Pull requests that update a dependency file good first issue Good for newcomers labels Dec 6, 2023
@darodi
Copy link
Collaborator

darodi commented Dec 11, 2023

partly done in
darodi@e37559b

I'm still testing docker before releasing a 5.7.0beta

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file python Pull requests that update Python code
Projects
None yet
3 participants