Derive the package version from git tags via setuptools_scm

This commit is contained in:
Emil
2026-08-03 04:14:23 +03:00
parent ea0fb8c595
commit c90c6b2ef6
2 changed files with 10 additions and 12 deletions
+6 -10
View File
@@ -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/
+4 -2
View File
@@ -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]