Skip to content

Replace parse_version() with parse()#42

Merged
return42 merged 1 commit intoreturn42:masterfrom
pevik:replace-pkg_resources
Feb 9, 2026
Merged

Replace parse_version() with parse()#42
return42 merged 1 commit intoreturn42:masterfrom
pevik:replace-pkg_resources

Conversation

@pevik
Copy link
Contributor

@pevik pevik commented Feb 9, 2026

Python 3.12 has removed pkg_resources from the standard library (moved to setuptools):
https://docs.python.org/3/whatsnew/3.12.html

While the simplest fix would be to require setuptools, it's probably better to move to parse() from packaging.

Fixes: #41

Python 3.12 has removed pkg_resources from the standard library (moved
to setuptools) [1]. While simplest fix would be to require setuptools,
due deprecation is better to move to packaging [2]. Therefore replace
parse_version() from pkg_resources with parse() from packaging.

[1] https://docs.python.org/3/whatsnew/3.12.html
[2] https://pypi.org/project/packaging/

Fixes: return42#41
Signed-off-by: Petr Vorel <pvorel@suse.cz>
@return42 return42 merged commit 19f5e5c into return42:master Feb 9, 2026
@return42
Copy link
Owner

return42 commented Feb 9, 2026

Thanks a lot for the fix .. I think its time for a new pypi release .. sadly I don't yet have time for .. can you live without a pypi release for now? (cloning from the repository?)

@pevik
Copy link
Contributor Author

pevik commented Feb 9, 2026

Thanks for a quick merge.

I think its time for a new pypi release .. sadly I don't yet have time for .. can you live without a pypi release for now?

Don't worry. We use it from readthedocs.io (https://linux-test-project.readthedocs.io/), which uses old Ubuntu. And for local development I use workaround setuptools==68.0.0 in requirements.txt.

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.

Replace deprecated pkg_resources with importlib in Python 3.12

2 participants