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

remove usage of deprecated-module distutis #2168

Closed
return42 opened this issue Feb 8, 2023 · 0 comments · Fixed by #2172
Closed

remove usage of deprecated-module distutis #2168

return42 opened this issue Feb 8, 2023 · 0 comments · Fixed by #2172
Labels
bug Something isn't working

Comments

@return42
Copy link
Member

return42 commented Feb 8, 2023

distutils will no longer work from Python 3.12

from distutils.version import LooseVersion # pylint: disable=deprecated-module

versions.append(LooseVersion(version))

Untested fix:

from packaging.version import parse
...

    versions.append(parse(version))

PEP-0632 recommends:

The suggested migration path is to use the equivalent (though not identical) imports from > setuptools (see [5]), or to migrate to an alternative build backend (see PEP 517).

Reported by: @josch at searx

In Python 3.10 and 3.11, distutils has been formally marked as deprecated. Code that imports distutils will no longer work from Python 3.12.

searx_extra/update/update_firefox_version.py still uses distutils. Maybe its use of distutils.version can be replaced by the packaging module?

See https://peps.python.org/pep-0632/

@return42 return42 added the bug Something isn't working label Feb 8, 2023
return42 added a commit to return42/searxng that referenced this issue Feb 9, 2023
Closes: searxng#2168

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
return42 added a commit that referenced this issue Feb 10, 2023
Closes: #2168

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant