Skip to content

Commit 1afa6b5

Browse files
Update conf.py to use packaging to detect dev vs release versions (#631)
# References and relevant issues If you go to dev docs right now: https://napari.org/dev/index.html The sidebar link to the release notes is broken, I think because the version is being treated as a release and not dev. It points to: https://napari.org/dev/release/release_0_6_0a0.html which doesn't exist. instead of the index.html which would be used for a dev release: https://napari.org/dev/release/index.html So in this PR I use packaging to check if a version is a dev version and also uses packaging to get just the base version number of pre-releases, so we will get release_0_6_0.html --------- Co-authored-by: Grzegorz Bokota <[email protected]>
1 parent 3341400 commit 1afa6b5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/conf.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@
3434
import napari
3535
from napari._version import __version_tuple__
3636

37-
release = napari.__version__
38-
if "dev" in release:
37+
napari_version = parse_version(napari.__version__)
38+
release = str(napari_version)
39+
if napari_version.is_devrelease:
3940
version = "dev"
4041
else:
41-
version = release
42-
42+
version = napari_version.base_version
4343
# -- Project information -----------------------------------------------------
4444

4545
project = 'napari'
@@ -102,7 +102,7 @@
102102
if version == "dev":
103103
version_match = "dev"
104104
else:
105-
version_match = release
105+
version_match = str(release)
106106

107107
html_theme_options = {
108108
"external_links": [

0 commit comments

Comments
 (0)