Skip to content

Commit

Permalink
docs(conf): dynamically determine docs release version
Browse files Browse the repository at this point in the history
Signed-off-by: Braden Mars <bradenmars@bradenmars.me>
  • Loading branch information
BradenM committed Jan 30, 2023
1 parent 9a24b78 commit fc8ab96
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
16 changes: 11 additions & 5 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,23 @@ version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py
configuration: docs/conf.py

# Fetch Submodules
submodules:
include: all
include: all

# Optionally build your docs in additional formats such as PDF and ePub
formats: all

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.8
install:
- requirements: docs/requirements.txt
install:
- requirements: docs/requirements.txt
- method: "pip"
path: "."

build:
os: ubuntu-22.04
tools:
python: "3"
7 changes: 6 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@

from recommonmark.transform import AutoStructify

try:
import importlib.metadata as importlib_metadata
except ModuleNotFoundError:
import importlib_metadata

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


Expand All @@ -30,7 +35,7 @@
github_doc_root = "https://github.com/BradenM/micropy-cli/tree/master/docs/"

# The full version, including alpha/beta/rc tags
release = "4.0.0"
release = importlib_metadata.version("micropy-cli")


# -- General configuration ---------------------------------------------------
Expand Down

0 comments on commit fc8ab96

Please sign in to comment.