From c90c6b2ef66061df1b020b9a50887e8a3b491ee4 Mon Sep 17 00:00:00 2001 From: Emil Date: Mon, 3 Aug 2026 04:14:23 +0300 Subject: [PATCH] Derive the package version from git tags via setuptools_scm --- .github/workflows/release.yml | 16 ++++++---------- pyproject.toml | 6 ++++-- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 64100d5..2fcf2a0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -57,24 +57,20 @@ jobs: wheel: runs-on: ubuntu-latest steps: + # Full history: setuptools_scm derives the package version from the + # release tag (v1.1.0-alpha.16 -> 1.1.0a16), so the wheel is + # version-locked to the binaries of the same release. - uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true - uses: actions/setup-python@v5 with: python-version: "3.12" - name: build the scimesh wheel - env: - VERSION: ${{ github.ref_name }} run: | - # The tag (v1.1.0-alpha.10) becomes the package version in its - # PEP 440 form (1.1.0a10); the wheel is then version-locked to the - # binaries of the same release. - WHEEL_VERSION="${VERSION#v}" - WHEEL_VERSION="${WHEEL_VERSION/-alpha./a}" - WHEEL_VERSION="${WHEEL_VERSION/-beta./b}" - WHEEL_VERSION="${WHEEL_VERSION/-rc./rc}" - sed -i "s/^version = .*/version = \"${WHEEL_VERSION}\"/" pyproject.toml python -m pip install --quiet build python -m build --wheel --outdir dist ls -la dist/ diff --git a/pyproject.toml b/pyproject.toml index 330eaa4..7cbe3d7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,10 @@ [build-system] -requires = ["setuptools>=68"] +requires = ["setuptools>=68", "setuptools-scm>=8"] build-backend = "setuptools.build_meta" [project] name = "scimesh" -version = "0.1.0" +dynamic = ["version"] description = "Local scientific workloads for molecular similarity analysis" readme = "README.md" requires-python = ">=3.10" @@ -40,3 +40,5 @@ venv = ".venv" pythonVersion = "3.10" typeCheckingMode = "basic" exclude = ["SciMesh", "site", "coordinator"] + +[tool.setuptools_scm]