diff --git a/.readthedocs.yml b/.readthedocs.yml index 3582cc47..6671c7de 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -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 diff --git a/docs/conf.py b/docs/conf.py index 39184033..1dbda7ed 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -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("..")) @@ -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 --------------------------------------------------- diff --git a/poetry.lock b/poetry.lock index 357108ed..edfdce2f 100644 --- a/poetry.lock +++ b/poetry.lock @@ -927,6 +927,20 @@ files = [ {file = "docutils-0.20.1.tar.gz", hash = "sha256:f08a4e276c3a1583a86dce3e34aba3fe04d02bba2dd51ed16106244e8a923e3b"}, ] +[[package]] +name = "dunamai" +version = "1.19.0" +description = "Dynamic version generation" +optional = false +python-versions = ">=3.5,<4.0" +files = [ + {file = "dunamai-1.19.0-py3-none-any.whl", hash = "sha256:1ed948676bbf0812bfaafe315a134634f8d6eb67138513c75aa66e747404b9c6"}, + {file = "dunamai-1.19.0.tar.gz", hash = "sha256:6ad99ae34f7cd290550a2ef1305d2e0292e6e6b5b1b830dfc07ceb7fd35fec09"}, +] + +[package.dependencies] +packaging = ">=20.9" + [[package]] name = "entrypoints" version = "0.4" @@ -2157,8 +2171,8 @@ files = [ [package.dependencies] numpy = [ {version = ">=1.20.3", markers = "python_version < \"3.10\""}, - {version = ">=1.21.0", markers = "python_version >= \"3.10\" and python_version < \"3.11\""}, {version = ">=1.23.2", markers = "python_version >= \"3.11\""}, + {version = ">=1.21.0", markers = "python_version >= \"3.10\" and python_version < \"3.11\""}, ] python-dateutil = ">=2.8.2" pytz = ">=2020.1" @@ -3855,5 +3869,5 @@ collate = ["cytominer-database"] [metadata] lock-version = "2.0" -python-versions = ">=3.8" -content-hash = "8cf2b95830b6f167fe5bf383567a41761649b500cd6a4830753f8904578b995d" +python-versions = ">=3.8,<4.0" +content-hash = "190d54fe1dc6ec399bb66ab4777376b2b0ebbacc04a8ada0ee39350d93c5e72d" diff --git a/pyproject.toml b/pyproject.toml index 1b507f27..66ccb62a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" @@ -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