Derive the package version from git tags via setuptools_scm
This commit is contained in:
@@ -57,24 +57,20 @@ jobs:
|
|||||||
wheel:
|
wheel:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
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
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
fetch-tags: true
|
||||||
|
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: "3.12"
|
python-version: "3.12"
|
||||||
|
|
||||||
- name: build the scimesh wheel
|
- name: build the scimesh wheel
|
||||||
env:
|
|
||||||
VERSION: ${{ github.ref_name }}
|
|
||||||
run: |
|
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 pip install --quiet build
|
||||||
python -m build --wheel --outdir dist
|
python -m build --wheel --outdir dist
|
||||||
ls -la dist/
|
ls -la dist/
|
||||||
|
|||||||
+4
-2
@@ -1,10 +1,10 @@
|
|||||||
[build-system]
|
[build-system]
|
||||||
requires = ["setuptools>=68"]
|
requires = ["setuptools>=68", "setuptools-scm>=8"]
|
||||||
build-backend = "setuptools.build_meta"
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "scimesh"
|
name = "scimesh"
|
||||||
version = "0.1.0"
|
dynamic = ["version"]
|
||||||
description = "Local scientific workloads for molecular similarity analysis"
|
description = "Local scientific workloads for molecular similarity analysis"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.10"
|
requires-python = ">=3.10"
|
||||||
@@ -40,3 +40,5 @@ venv = ".venv"
|
|||||||
pythonVersion = "3.10"
|
pythonVersion = "3.10"
|
||||||
typeCheckingMode = "basic"
|
typeCheckingMode = "basic"
|
||||||
exclude = ["SciMesh", "site", "coordinator"]
|
exclude = ["SciMesh", "site", "coordinator"]
|
||||||
|
|
||||||
|
[tool.setuptools_scm]
|
||||||
|
|||||||
Reference in New Issue
Block a user