8000 ENH: Support major version larger than 9 in NumpyVersion by charris · Pull Request #19240 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

ENH: Support major version larger than 9 in NumpyVersion #19240

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 2 commits into from
Jun 13, 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
4 changes: 2 additions & 2 deletions numpy/lib/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class NumpyVersion():
"""Parse and compare numpy version strings.

NumPy has the following versioning scheme (numbers given are examples; they
can be > 9) in principle):
can be > 9 in principle):

- Released version: '1.8.0', '1.8.1', etc.
- Alpha: '1.8.0a1', '1.8.0a2', etc.
Expand Down Expand Up @@ -54,7 +54,7 @@ class NumpyVersion():

def __init__(self, vstring):
self.vstring = vstring
ver_main = re.match(r'\d\.\d+\.\d+', vstring)
ver_main = re.match(r'\d+\.\d+\.\d+', vstring)
if not ver_main:
raise ValueError("Not a valid numpy version string")

Expand Down
2 changes: 1 addition & 1 deletion numpy/lib/tests/test__version.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

def test_main_versions():
assert_(NumpyVersion('1.8.0') == '1.8.0')
for ver in ['1.9.0', '2.0.0', '1.8.1']:
for ver in ['1.9.0', '2.0.0', '1.8.1', '10.0.1']:
assert_(NumpyVersion('1.8.0') < ver)

for ver in ['1.7.0', '1.7.1', '0.9.9']:
Expand Down
0