Skip to content

Commit c84efe0

Browse files
committed
packaging: no longer use setuptools_scm
1 parent e9ba0f4 commit c84efe0

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@ __pycache__/
55
.tox
66
stagpy.egg-info/
77
/build/
8-
/stagpy/_version.py
98
/stagpy_git/
109
/uv.lock

docs/devs/maintainers.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@ Releasing process
44
This section is intended for maintainers of the project. It describes how new
55
versions of StagPy are released on PyPI.
66

7-
Version numbers are tracked with git tags thanks to `setuptools_scm`. Marking
8-
a new version merely consists in tagging the `HEAD` of the `master` branch.
7+
The version number lives in `pyproject.toml`. Releases are tagged, with the
8+
annotations of the tag containing release notes.
99
Please make sure to always provide a patch version number (i.e. use a version
1010
number with *three* levels such as `1.0.0` instead of `1.0`).
1111

1212
```sh title="shell"
13+
# edit version number in pyproject.toml
14+
git add pyproject.toml
15+
git commit -m "release vX.Y.Z"
1316
git tag -a vX.Y.Z
1417
git push --follow-tags
1518
```

pyproject.toml

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

55
[project]
66
name = "stagpy"
7-
dynamic = ["version"]
7+
version = "0.19.0"
88
description = "Tool for StagYY output files processing"
99
readme = "README.md"
1010
authors = [
@@ -48,9 +48,6 @@ namespaces = false
4848
[tool.setuptools.package-data]
4949
stagpy = ["py.typed", "_styles/stagpy-*.mplstyle"]
5050

51-
[tool.setuptools_scm]
52-
write_to = "stagpy/_version.py"
53-
5451
[tool.pytest.ini_options]
5552
testpaths = ["tests"]
5653
python_files = ["test_*.py"]

stagpy/__init__.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
to issue warnings normally and raise StagpyError.
99
"""
1010

11-
try:
12-
from ._version import version as __version__
13-
except ImportError:
14-
__version__ = "unknown"
11+
from importlib.metadata import version
12+
13+
__version__ = version("stagpy")

0 commit comments

Comments
 (0)