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

Replace pkg_resources usage with version.py file #1509

Closed
djhoese opened this issue Jan 14, 2021 · 1 comment · Fixed by #1512
Closed

Replace pkg_resources usage with version.py file #1509

djhoese opened this issue Jan 14, 2021 · 1 comment · Fixed by #1512
Labels
enhancement code enhancements, features, improvements optimization

Comments

@djhoese
Copy link
Member

djhoese commented Jan 14, 2021

Related: #678 and #856

This was mentioned in #856, but setuptools_scm has an option to write the version information to a python module version.py. It was decided in my PR that we should use the pkg_resources method though which dynamically loads the installed package data to get the version. It has come to my attention since this PR that this is actually a terrible idea. What happens is that for large python environments, pkg_resources has to search through all package metadata to get the version information. I'm not sure why it is this way, but it has been reported for other projects I work on (vispy) where it ends up taking seconds just to import the package because of the time it takes to get the version number.

Thoughts @mraspaud?

@djhoese djhoese added enhancement code enhancements, features, improvements optimization labels Jan 14, 2021
@pdebuyl
Copy link
Contributor

pdebuyl commented Jan 22, 2021

For info, versioneer has been moved to a dedicated github org and is alive again. If ever this is of interest of course :-)

https://github.com/python-versioneer/python-versioneer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement code enhancements, features, improvements optimization
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants