Skip to content

Commit

Permalink
Merge pull request #353 from kenibrewer/docs/dynamic-version
Browse files Browse the repository at this point in the history
fix(docs): add dynamic versioning to docs build
  • Loading branch information
kenibrewer authored Nov 7, 2023
2 parents 0e3beed + 2b00a71 commit a8e6ca9
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ build:
tools:
python: "3.11"
jobs:
post_checkout:
# Full history is required for dunamai to calculate the version
- git fetch --unshallow || true
post_create_environment:
# Install poetry
# https://python-poetry.org/docs/#installing-manually
Expand Down
8 changes: 4 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import os
import sys
import pathlib
import yaml
import dunamai
from datetime import date

sys.path.insert(0, os.path.abspath(".."))
Expand All @@ -28,9 +28,9 @@
date=date.today().year, author=author
)

# The version from CITATION.cff is used to set the version of the package
cff_path = pathlib.Path("..") / "CITATION.cff"
version = yaml.safe_load(cff_path.read_text())["version"]
# Get the version from dunamai (the backend of poetry-dynamic-versioning)
auto_version = dunamai.Version.from_git()
version = auto_version.serialize()
release = version

# -- General configuration ---------------------------------------------------
Expand Down
20 changes: 17 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ homepage = "https://pycytominer.readthedocs.io/"
repository = "https://github.com/cytomining/pycytominer"

[tool.poetry.dependencies]
python = ">=3.8"
python = ">=3.8,<4.0"
numpy = ">=1.16.5"
scipy = ">=1.5"
pandas = ">=1.2.0"
Expand Down Expand Up @@ -85,6 +85,7 @@ m2r2 = "^0.3.3.post2"
furo = "^2023.9.10"
mock = "^5.1.0"
autodoc = "^0.5.0"
dunamai = "^1.19.0"

[tool.poetry-dynamic-versioning]
enable = true
Expand Down

0 comments on commit a8e6ca9

Please sign in to comment.