Skip to content

Conversation

@JeremyCCHsu
Copy link
Owner

No description provided.

@JeremyCCHsu
Copy link
Owner Author

Hey @sabonerune, thanks for #99. I tested it, but it seems that older Python doesn't have importlib_metadata out of the box. Therefore, I created this PR and keep pkg_resources instead for the version number. Let me know if that makes sense or if there are any suggestions.

@sabonerune
Copy link
Contributor

@JeremyCCHsu
I think in most cases using pkg_resources with Python < 3.8 is probably fine.
This is because Setuptools is typically expected to be installed by default on these versions.
Also, since Setuptools has dropped support for these Python versions, there is no need to worry about the API being broken.

It would be a problem if users manually uninstalled Setuptools, but I don't think they would normally do that.

@sabonerune
Copy link
Contributor

@JeremyCCHsu
I recently learned that setuptools is not installed in the virtual environment created by the package manager uv.

Also, the sdist released on pypi seems to be a different source code than the wheel.
This makes it more likely that errors like ModuleNotFoundError: No module named 'pkg_resources' will occur in environments other than Windows.

@agonzalezd
Copy link

@sabonerune @JeremyCCHsu
I found the ModuleNotFoundError: No module named 'pkg_resources' error in Docker image python:3.12 when importing after installing it

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.

4 participants