Skip to content

Commit

Permalink
Switches to dynamic versioning with setuptools_scm
Browse files Browse the repository at this point in the history
Closes #24
  • Loading branch information
ns-rse committed Dec 15, 2023
1 parent 6c82827 commit 19ee502
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,7 @@ dmypy.json

# Emacs
*~
\#*
\#*

# Ignore topostats/_version.py as per setuptools_scm
topofileformats/_version.py
11 changes: 9 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
[build-system]
requires = ["setuptools", "wheel"]
requires = [
"setuptools",
"setuptools_scm[toml]>=6.2",
"wheel"
]

[project]
name = "topofileformats"
version = "0.1.0"
dynamic = ["version"]
authors = [{ name = "Sylvia Whittle", email = "sylviwhittle@gmail.com" }]
description = "Read and retrieve data from various AFM file formats."
readme = "README.md"
Expand Down Expand Up @@ -40,6 +44,9 @@ dev = [
"Homepage" = "https://github.com/AFM-SPM/topofileformats"
"Bug Tracker" = "https://github.com/AFM-SPM/topofileformats/issues"

[tool.setuptools_scm]
write_to = "topofileformats/_version.py"

[tool.pytest.ini_options]
minversion = "7.0"
addopts = "--cov"
Expand Down
4 changes: 4 additions & 0 deletions topofileformats/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
"""topofileformats."""
from importlib.metadata import version

release = version("topofileformats")
__version__ = ".".join(release.split("."[:2]))

0 comments on commit 19ee502

Please sign in to comment.