Don't try to use git to find the version number
authorDebian Science Team <debian-science-maintainers@lists.alioth.debian.org>
Tue, 28 Jan 2025 22:18:06 +0000 (22:18 +0000)
committerRebecca N. Palmer <rebecca_palmer@zoho.com>
Tue, 28 Jan 2025 22:18:06 +0000 (22:18 +0000)
Needed as Debian buildds use tarballs

Author: Yaroslav Halchenko
Forwarded: not-needed

Gbp-Pq: Name deb_nonversioneer_version.patch

pandas/__init__.py
pandas/tests/api/test_api.py
pandas/tests/test_common.py
pandas/tests/util/test_show_versions.py

index ca2eba20432924304517be99d5113bc9f57614d2..d23973b7d3af41d65d98149516c5d7c04a5625f0 100644 (file)
@@ -186,12 +186,7 @@ try:
 
     _built_with_meson = True
 except ImportError:
-    from pandas._version import get_versions
-
-    v = get_versions()
-    __version__ = v.get("closest-tag", v["version"])
-    __git_version__ = v.get("full-revisionid")
-    del get_versions, v
+    from .__version import version as __version__
 
 # GH#55043 - deprecation of the data_manager option
 if "PANDAS_DATA_MANAGER" in os.environ:
index 60bcb97aaa3642be064bcacd130edf2084c4a55c..a519bf00385ccff3c59056cf0e2f5a65d34cb726 100644 (file)
@@ -193,8 +193,6 @@ class TestPDApi(Base):
         "_testing",
         "_typing",
     ]
-    if not pd._built_with_meson:
-        private_modules.append("_version")
 
     def test_api(self):
         checkthese = (
index e8a1c961c8cb6e5b1014f6baa193d4593d85d981..a4d77f8c670639eb874b7a60c49eadb71b785df2 100644 (file)
@@ -159,7 +159,7 @@ def test_standardize_mapping():
     dd = collections.defaultdict(list)
     assert isinstance(com.standardize_mapping(dd), partial)
 
-
+@pytest.mark.xfail(reason="deb_nonversioneer_version patch")
 def test_git_version():
     # GH 21295
     git_version = pd.__git_version__
index 72c9db23b210880793f37227c99e99e804800f08..a32861bb0c903103fd1ad09c8282569094117849 100644 (file)
@@ -55,9 +55,6 @@ def test_show_versions_console(capsys):
     # check header
     assert "INSTALLED VERSIONS" in result
 
-    # check full commit hash
-    assert re.search(r"commit\s*:\s[0-9a-f]{40}\n", result)
-
     # check required dependency
     # 2020-12-09 npdev has "dirty" in the tag
     # 2022-05-25 npdev released with RC wo/ "dirty".