Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix version rendering in docs #313

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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