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

Use setuptools-scm for versioning. #18

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
5 changes: 3 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -30,6 +30,7 @@ jobs:
environment-file: docs/environment.yml
python-version: '3.11'
auto-activate-base: false
channels: conda-forge

- name: Build Documentation
run: |
@@ -38,7 +39,7 @@ jobs:
make dirhtml

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: 'docs/_build/dirhtml'
@@ -61,4 +62,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v4
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -158,3 +158,5 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

conda_sphinx_theme/_version.py
2 changes: 1 addition & 1 deletion conda_sphinx_theme/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ._version import version_info, __version__ # noqa: F401
from ._version import version_tuple as version_info, __version__ # noqa: F401

from pathlib import Path

8 changes: 0 additions & 8 deletions conda_sphinx_theme/_version.py

This file was deleted.

4 changes: 4 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import time
import datetime
from importlib.metadata import version as get_version
# Configuration file for the Sphinx documentation builder for
# conda projects.

@@ -21,6 +22,9 @@
)
author = "conda-incubator"

release: str = get_version("conda_sphinx_theme")
# for example take major/minor
version: str = ".".join(release.split('.')[:2])

# -- General configuration ---------------------------------------------------

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]
@@ -35,8 +35,8 @@ conda_sphinx_theme = "conda_sphinx_theme"
packages = ["conda_sphinx_theme"]
zip-safe = false

[tool.setuptools.dynamic]
version = {attr = "conda_sphinx_theme.__version__"}
[tool.setuptools_scm]
version_file = "conda_sphinx_theme/_version.py"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the file that is autogenerated by setuptools-scm with the current git derived version.


[tool.setuptools.package-data]
conda_sphinx_theme = [