Skip to content

Commit ae9f6cd

Browse files
committed
Use setuptools_scm for dynamic versioning
- Git references are used to determine the current package version dynamically. - Devel/test packages version will follow the following pattern: 0.10.1.dev0+abcdefg Signed-off-by: Nick Diego Yamane <[email protected]>
1 parent ca5b2cb commit ae9f6cd

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

.github/workflows/publish.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- main
7+
- resurrect
78
tags:
89
- '*'
910

@@ -15,6 +16,7 @@ jobs:
1516
- uses: actions/checkout@v4
1617
with:
1718
persist-credentials: false
19+
fetch-depth: 0
1820
- name: Set up Python
1921
uses: actions/setup-python@v5
2022
with:
@@ -90,7 +92,7 @@ jobs:
9092
9193
publish-to-testpypi:
9294
name: Publish to TestPyPI
93-
if: github.ref == 'refs/heads/main' # only publish to TestPyPI on main pushes
95+
#if: github.ref == 'refs/heads/main' # only publish to TestPyPI on main pushes
9496
needs:
9597
- build
9698
runs-on: ubuntu-latest

pyproject.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[build-system]
2-
requires = ["setuptools>=61.0.0", "wheel"]
2+
requires = ["setuptools>=61.0.0", "setuptools_scm[toml]>=7.0.0", "wheel"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "compiledb"
7-
version = "0.10.2"
7+
#version = "0.10.1" # determined dynamically from git refs. See tools.setuptool_scm below.
88
description = "Tool for generating Clang JSON Compilation Database files for make-based build systems."
99
license = {file = "LICENSE"}
1010
authors = [{name = "Nick Yamane", email = "[email protected]"}]
@@ -36,6 +36,10 @@ classifiers = [
3636
"Operating System :: OS Independent"
3737
]
3838

39+
[tool.setuptools_scm]
40+
version_scheme = "post-release"
41+
local_scheme = "node-and-date"
42+
3943
[project.scripts]
4044
compiledb = "compiledb.cli:cli"
4145

0 commit comments

Comments
 (0)