Skip to content

Commit

Permalink
Docs: pick release date from versioneer
Browse files Browse the repository at this point in the history
Also fix the copyright year in Sphinx configuration.
  • Loading branch information
claudiodsf committed Oct 23, 2024
1 parent 0d707b1 commit e378587
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# pylint: disable=wrong-import-position,invalid-name
import sys
import os
from datetime import datetime

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand All @@ -11,6 +12,7 @@
sys.path.insert(0, os.path.join(os.path.abspath('..'), 'sourcespec'))
from sourcespec._version import get_versions # NOQA
__version__ = get_versions()['version']
__release_date__ = get_versions()['date']

# -- General configuration ----------------------------------------------------

Expand Down Expand Up @@ -76,7 +78,7 @@

# General information about the project.
project = 'SourceSpec'
copyright = '2013-2024, Claudio Satriano' # pylint: disable=redefined-builtin
copyright = '2011-2024, Claudio Satriano' # pylint: disable=redefined-builtin

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand All @@ -87,6 +89,12 @@
# The short X.Y version.
version = release.split('-')[0]

# Release date in the format "Month DD, YYYY"
release_date = datetime.strptime(
__release_date__, '%Y-%m-%dT%H:%M:%S%z'
).strftime('%b %d, %Y')
rst_epilog = f'\n.. |release date| replace:: {release_date}'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
# language = None
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Earthquake source parameters from P- or S-wave displacement spectra

:Copyright: 2011-2024 Claudio Satriano [email protected]
:Release: |release|
:Date: |today|
:Date: |release date|

SourceSpec is a collection of command line tools to compute earthquake source
parameters (seismic moment, corner frequency, radiated energy, source size,
Expand Down

0 comments on commit e378587

Please sign in to comment.