From: Debian Science Team Date: Mon, 21 Oct 2024 18:43:11 +0000 (+0100) Subject: Don't try to use git to find the version number X-Git-Tag: archive/raspbian/2.2.3+dfsg-7+rpi1~1^2~39 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=fa26debd123598f1db7b9cfc4189188c866d5561;p=pandas.git Don't try to use git to find the version number Needed as Debian buildds use tarballs Author: Yaroslav Halchenko Forwarded: not-needed Gbp-Pq: Name deb_nonversioneer_version.patch --- diff --git a/pandas/__init__.py b/pandas/__init__.py index ca2eba20..d23973b7 100644 --- a/pandas/__init__.py +++ b/pandas/__init__.py @@ -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: diff --git a/pandas/tests/api/test_api.py b/pandas/tests/api/test_api.py index 60bcb97a..a519bf00 100644 --- a/pandas/tests/api/test_api.py +++ b/pandas/tests/api/test_api.py @@ -193,8 +193,6 @@ class TestPDApi(Base): "_testing", "_typing", ] - if not pd._built_with_meson: - private_modules.append("_version") def test_api(self): checkthese = ( diff --git a/pandas/tests/test_common.py b/pandas/tests/test_common.py index e8a1c961..a4d77f8c 100644 --- a/pandas/tests/test_common.py +++ b/pandas/tests/test_common.py @@ -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__ diff --git a/pandas/tests/util/test_show_versions.py b/pandas/tests/util/test_show_versions.py index 72c9db23..a32861bb 100644 --- a/pandas/tests/util/test_show_versions.py +++ b/pandas/tests/util/test_show_versions.py @@ -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".