Skip to content

Commit

Permalink
Switch to setuptools-scm for version numbering
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidCEllis committed Jul 17, 2024
1 parent 7e04761 commit f62845d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/publish_to_testpypi.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Test Publish Package to TestPyPi

on: workflow_dispatch
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"

jobs:
build:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ hyperfine_testfiles/
.vscode/
__pycache__/
*.pyc

# setuptools-scm generated version file
_version.py
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[build-system]
requires = [
"setuptools>=61.0",
"wheel"
"setuptools>=64",
"setuptools-scm>=8",
]
build-backend = "setuptools.build_meta"

Expand Down Expand Up @@ -29,8 +29,8 @@ license = {file = "LICENSE.md"}
[tool.setuptools.packages.find]
where = ["src"]

[tool.setuptools.dynamic]
version = {attr = "ducktools.classbuilder.__version__"}
[tool.setuptools_scm]
version_file = "src/ducktools/classbuilder/_version.py"

[project.optional-dependencies]
testing = ["pytest>=8.2", "pytest-cov", "mypy", "typing_extensions"]
Expand Down
3 changes: 1 addition & 2 deletions src/ducktools/classbuilder/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
import os

from .annotations import get_ns_annotations, is_classvar

__version__ = "v0.6.3"
from ._version import __version__

# Change this name if you make heavy modifications
INTERNALS_DICT = "__classbuilder_internals__"
Expand Down

0 comments on commit f62845d

Please sign in to comment.