Skip to content

Commit

Permalink
sphinx: Get version info from the module
Browse files Browse the repository at this point in the history
  • Loading branch information
oaubert committed Oct 6, 2024
1 parent 243af30 commit e2fbaf7
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,16 @@
project = "python-vlc"
copyright = "2024, Olivier Aubert"
author = "Olivier Aubert"
# FIXME: get from the actual vlc.py module
version = "3.0.16"
release = "3.0.16"

version = "Unknown"
with open(f"{MODULE_DIR}/vlc.py", "r") as f:
for l in f.readlines():
if l.startswith('__version__'):
items = l.split('"')
if len(items) == 3:
version = items[1]
break
release = version

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down

0 comments on commit e2fbaf7

Please sign in to comment.