Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Maint] use setuptools_scm for versioning #159

Merged
merged 3 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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