Skip to content

Commit

Permalink
docs: set version correctly in development
Browse files Browse the repository at this point in the history
Give sphinx a package version during development.
Previously sphinx would try to retrieve `stan.__version__`.
This is not available when the package is not installed.
(We use `importlib.metadata.version`)

Fixes exception which occurs when running `script/check`
during development.
  • Loading branch information
riddell-stan committed Jan 19, 2021
1 parent 73ddd8e commit 0f9fd55
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
"python": ("http://python.readthedocs.io/en/latest/", None),
}

version = release = stan.__version__
try:
version = release = stan.__version__
except AttributeError:
# install the package to make `stan.__version__` available
version = release = "unknown-dev"

################################################################################
# theme configuration
Expand Down

0 comments on commit 0f9fd55

Please sign in to comment.