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

fix(docs): add dynamic versioning to docs build #353

Merged
merged 1 commit into from
Nov 7, 2023
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 .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