Skip to content

Commit

Permalink
[Maint] use setuptools_scm for versioning (#159)
Browse files Browse the repository at this point in the history
* use setuptools_scm for versioning

* ensure checkout depth is correctly set

* remove problematic [tool.setuptools.dynamic]
  • Loading branch information
psobolewskiPhD authored Mar 27, 2024
1 parent 514ec9d commit 34d4ba1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build_napari.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ jobs:
steps:
- name: Clone napari-sphinx-theme
uses: actions/checkout@v4
with:
# ensure version metadata is proper
fetch-depth: 0

- name: Clone napari docs repo
uses: actions/checkout@v4
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
python-version: [3.9]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
Expand Down
6 changes: 4 additions & 2 deletions napari_sphinx_theme/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@

from .napari_code_theme import *

__version__ = "0.3.3.dev0"

try:
from ._version import version as __version__
except ImportError:
__version__ = 'not-installed'

def update_templates(app, pagename, templatename, context, doctree):
"""Update template names for page build."""
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools>=61.0"]
requires = ["setuptools>=64", "setuptools_scm>=8"]
build-backend = "setuptools.build_meta"

[project]
Expand Down Expand Up @@ -49,8 +49,8 @@ repository = "https://github.com/napari/napari-sphinx-theme"
packages = ["napari_sphinx_theme"]
zip-safe = false

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

[tool.setuptools.package-data]
napari_sphinx_theme = [
Expand Down

0 comments on commit 34d4ba1

Please sign in to comment.