8000 BUG: expose short_version as previously in version.py by charris · Pull Request #19144 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

BUG: expose short_version as previously in version.py #19144

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

Merged
merged 5 commits into from
May 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions numpy/tests/test_numpy_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,13 @@ def test_valid_numpy_version():
res = re.match(version_pattern + dev_suffix + '$', np.__version__)

assert_(res is not None, np.__version__)


def test_short_version():
# Check numpy.short_version actually exists
if np.version.release:
assert_(np.__version__ == np.version.short_version,
"short_version mismatch in release version")
else:
assert_(np.__version__.split("+")[0] == np.version.short_version,
"short_version mismatch in development version")
1 change: 1 addition & 0 deletions numpy/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
full_version: str = vinfo['version']
git_revision: str = vinfo['full-revisionid']
release = 'dev0' not in version and '+' not in version
short_version: str = vinfo['version'].split("+")[0]

del get_versions, vinfo
0