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

Fix building with setuptools-scm<7 #903

Merged
merged 1 commit into from Jan 15, 2024
Merged

Conversation

maximlt
Copy link
Member

@maximlt maximlt commented Jan 12, 2024

Fixes #897

I think importlib.metadata import version; __version__ = version('<package_name>') is now the recommended way to get the version of an installed package. Except that I guess it makes things a bit slower and I don't know how stable that is. So I chose to still rely on trying first to get the version from _version.py (automatically created by hatch-vcs/setuptools-scm) and only then, if it fails like in #897, to try to get it using importlib.

@maximlt maximlt changed the title more robust version number collection Fix building with setuptools-scm<7 Jan 12, 2024
@maximlt maximlt merged commit dc13dc2 into main Jan 15, 2024
10 checks passed
@maximlt maximlt deleted the compat_old_setuptools_scm branch January 15, 2024 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant