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

Do not use pkg_resources to determine version at runtime #40

Merged
merged 1 commit into from
Mar 23, 2020
Merged

Do not use pkg_resources to determine version at runtime #40

merged 1 commit into from
Mar 23, 2020

Conversation

cgohlke
Copy link
Contributor

@cgohlke cgohlke commented Dec 4, 2019

Significantly reduces import time

On this Windows workstation, the time for import triangle decreases from ~3.3 s to ~<0.2 s.

See also vispy/vispy#1779, python-lz4/python-lz4#154, and pypa/setuptools#926

Significantly reduces import time
@drufat
Copy link
Owner

drufat commented Dec 4, 2019

I did not realize pkg_resources was so slow.
It would still be nice to follow the Don't Repeat Yourself principle, and have the version number only in one place. Do you think you can move the pkg_resources code and the __version__ variable to a submodule triangle/version.py so that it does not get imported by default? That way I will not have to update the version number in two separate place every time it changes?

@drufat
Copy link
Owner

drufat commented Mar 23, 2020

I will merge this pull request, and then use the first technique described here:
https://packaging.python.org/guides/single-sourcing-package-version/
to single source the version number in setup.py

@drufat drufat merged commit d89351e into drufat:master Mar 23, 2020
drufat added a commit that referenced this pull request Mar 25, 2020
@drufat
Copy link
Owner

drufat commented Mar 25, 2020

I have released a new version. This issue should be fixed now.

drufat added a commit that referenced this pull request Apr 24, 2020
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.

2 participants