Skip to content

Commit

Permalink
better version parsing in docs (#313)
Browse files Browse the repository at this point in the history
  • Loading branch information
wtbarnes authored Sep 12, 2024
1 parent c36c0b5 commit 7256ed3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import datetime
import os

from packaging.version import Version
from sphinx_gallery.sorting import ExplicitOrder

# This file does only contain a selection of the most common options. For a
Expand All @@ -19,8 +20,13 @@

from fiasco import __version__

version = release = __version__
is_development = '.dev' in __version__
_version_ = Version(__version__)
# NOTE: Avoid "post" appearing in version string in rendered docs
if _version_.is_postrelease:
version = release = f'{_version_.major}.{_version_.minor}.{_version_.micro}'
else:
version = release = str(_version_)
is_development = _version_.is_devrelease

# -- General configuration ---------------------------------------------------
extensions = [
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
fiasco Documentation
====================

Welcome to the documentation for fiasco **version |release|**
Welcome to the documentation for fiasco version |release|.

fiasco provides a Python interface to the `CHIANTI atomic database`_.
In addition to several high-level abstractions of the atomic data, fiasco also provides many common atomic physics calculations.
Expand Down

0 comments on commit 7256ed3

Please sign in to comment.