Skip to content

Commit

Permalink
Read version from pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
vinayak-mehta committed Dec 27, 2024
1 parent fba1a6f commit a82864a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 0 additions & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ sphinx:
# python:
# install:
# - requirements: docs/requirements.txt

10 changes: 7 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,13 @@
import os
import sys

import tomli

sys.path.insert(0, os.path.abspath(".."))

import houseplant
# Read version from pyproject.toml
with open("../pyproject.toml", "rb") as f:
pyproject = tomli.load(f)

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

Expand Down Expand Up @@ -60,9 +64,9 @@
# the built documents.
#
# The short X.Y version.
version = houseplant.__version__
version = pyproject["project"]["version"]
# The full version, including alpha/beta/rc tags.
release = houseplant.__version__
release = version

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@ dev = [
"ruff", # linting
"isort", # linting
"sphinx", # documentation
"tomli", # documentation
]

0 comments on commit a82864a

Please sign in to comment.