$77 GRAYBYTE WORDPRESS FILE MANAGER $32

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/cloudlinux/venv/lib/python3.11/site-packages/numpy/tests/

HOME
Current File : /opt/cloudlinux/venv/lib/python3.11/site-packages/numpy/tests//test_numpy_version.py
"""
Check the numpy version is valid.

Note that a development version is marked by the presence of 'dev0' or '+'
in the version string, all else is treated as a release. The version string
itself is set from the output of ``git describe`` which relies on tags.

Examples
--------

Valid Development: 1.22.0.dev0 1.22.0.dev0+5-g7999db4df2 1.22.0+5-g7999db4df2
Valid Release: 1.21.0.rc1, 1.21.0.b1, 1.21.0
Invalid: 1.22.0.dev, 1.22.0.dev0-5-g7999db4dfB, 1.21.0.d1, 1.21.a

Note that a release is determined by the version string, which in turn
is controlled by the result of the ``git describe`` command.
"""
import re

import numpy as np
from numpy.testing import assert_


def test_valid_numpy_version():
    # Verify that the numpy version is a valid one (no .post suffix or other
    # nonsense).  See gh-6431 for an issue caused by an invalid version.
    version_pattern = r"^[0-9]+\.[0-9]+\.[0-9]+(a[0-9]|b[0-9]|rc[0-9]|)"
    dev_suffix = r"(\.dev0|)(\+[0-9]*\.g[0-9a-f]+|)"
    if np.version.release:
        res = re.match(version_pattern + '$', np.__version__)
    else:
        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")

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
14 Aug 2025 9.24 PM
root / root
0755
__pycache__
--
14 Aug 2025 9.24 PM
root / root
0755
__init__.py
0 KB
17 Apr 2025 8.10 PM
root / root
0644
test__all__.py
0.216 KB
17 Apr 2025 8.10 PM
root / root
0644
test_ctypeslib.py
12.002 KB
17 Apr 2025 8.10 PM
root / root
0644
test_lazyloading.py
1.135 KB
17 Apr 2025 8.10 PM
root / root
0644
test_matlib.py
1.809 KB
17 Apr 2025 8.10 PM
root / root
0644
test_numpy_config.py
1.212 KB
17 Apr 2025 8.10 PM
root / root
0644
test_numpy_version.py
1.538 KB
17 Apr 2025 8.10 PM
root / root
0644
test_public_api.py
16.477 KB
17 Apr 2025 8.10 PM
root / root
0644
test_reloading.py
2.299 KB
17 Apr 2025 8.10 PM
root / root
0644
test_scripts.py
1.606 KB
17 Apr 2025 8.10 PM
root / root
0644
test_warnings.py
2.227 KB
17 Apr 2025 8.10 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF