diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2020-12-02 13:06:51 -0700 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2020-12-08 10:25:28 -0700 |
commit | 40fd17e3a2418d54284b53dbcf2ba72dbfbb58ad (patch) | |
tree | 6f302110dfb37a4fdfa1855a0d860d7873e355be /numpy/__init__.py | |
parent | 4d290795d4e8c60053eb789acf173159dc4c1575 (diff) | |
download | numpy-40fd17e3a2418d54284b53dbcf2ba72dbfbb58ad.tar.gz |
ENH: Use versioneer to manage numpy versions.
The new tags look like '1.21.0.dev0+98.gaa0453721f', where '98' is the
number of commits since the 1.21.0 branch was started and 'aa0453721f'.
The chosen form may be specified in the 'setup.cfg' file. This PR adds
two new files 'numpy/_version.py' and 'numpy/version.py'. The latter
is kept because it is part of the public API and is actually used by
some downstream projects, but it is no longer dynamically created.
See https://github.com/python-versioneer/python-versioneer/ for more
information.
Diffstat (limited to 'numpy/__init__.py')
-rw-r--r-- | numpy/__init__.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/numpy/__init__.py b/numpy/__init__.py index 3e5277318..879e8f013 100644 --- a/numpy/__init__.py +++ b/numpy/__init__.py @@ -130,12 +130,16 @@ else: your python interpreter from there.""" raise ImportError(msg) from e - from .version import git_revision as __git_revision__ - from .version import version as __version__ - __all__ = ['ModuleDeprecationWarning', 'VisibleDeprecationWarning'] + # get the version using versioneer + from ._version import get_versions + vinfo = get_versions() + __version__ = vinfo.get("closest-tag", vinfo["version"]) + __git_version__ = vinfo.get("full-revisionid") + del get_versions, vinfo + # mapping of {name: (value, deprecation_msg)} __deprecated_attrs__ = {} @@ -384,3 +388,8 @@ else: # Note that this will currently only make a difference on Linux core.multiarray._set_madvise_hugepage(use_hugepage) + + +from ._version import get_versions +__version__ = get_versions()['version'] +del get_versions |