From 8b842f85fbc973da8662b243218b6f465422e889 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Tue, 25 Feb 2025 17:42:55 +0100 Subject: [PATCH 1/2] Try fetching tags to get correct version in CI --- .github/workflows/ci.yml | 2 ++ tests/test_binding.py | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b7407ba..230ac49 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,8 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive + fetch-depth: 0 + fetch-tags: true - uses: actions/setup-python@v3 with: python-version: 3.12 diff --git a/tests/test_binding.py b/tests/test_binding.py index 0198010..aec265e 100644 --- a/tests/test_binding.py +++ b/tests/test_binding.py @@ -91,9 +91,6 @@ def test_cmake_static_compilation(csetstr: str): testprog = os.path.join(tmpdir, "test.cc") # SKBUILD_PROJECT_VERSION only includes major.minor.patch versionstr = ".".join(correctionlib.__version__.split(".")[:3]) - if versionstr.startswith("0.1.dev1+"): - # band-aid for https://github.com/actions/checkout/issues/249 in CI - versionstr = "0.1" with open(testprog, "w") as f: f.write(TESTPROG_SRC % (versionstr, csetstr)) flags = ( From 6fafccc5de211bf5efb5e9f6c909c72819743c03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Tue, 25 Feb 2025 17:55:53 +0100 Subject: [PATCH 2/2] Cover other checkout actions as well --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 230ac49..3209426 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,6 +47,8 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive + fetch-depth: 0 + fetch-tags: true - uses: actions/setup-python@v3 with: @@ -66,6 +68,8 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive + fetch-depth: 0 + fetch-tags: true - name: Set up Conda uses: conda-incubator/setup-miniconda@v3