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

Improve handling of get_version #294

Closed
blink1073 opened this issue Apr 7, 2022 · 2 comments
Closed

Improve handling of get_version #294

blink1073 opened this issue Apr 7, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@blink1073
Copy link
Contributor

Problem

We are currently using either the deprecated python setup.py --version or the slow build-a-wheel-and-extract-metadata method to get the current version.

Proposed Solution

Use the approach recommended by setuptools_scm to get the version:

from importlib.metadata import version, PackageNotFoundError

try:
    __version__ = version("package-name")
except PackageNotFoundError:
    # package is not installed
    pass

We'd have to install the package in editable mode so that the version can remain dynamic.

@blink1073 blink1073 added the enhancement New feature or request label Apr 7, 2022
@blink1073
Copy link
Contributor Author

Let's go ahead and bump our minimum Python version to 3.8 for this as well to avoid the backport, since that is the version currently supported by https://numpy.org/neps/nep-0029-deprecation_policy.html

@blink1073
Copy link
Contributor Author

Since we're no longer installing the package, let's not do this. cf #449

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant