aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorPatrick Lehmann <Patrick.Lehmann@plc2.de>2021-12-18 00:06:42 +0100
committerGitHub <noreply@github.com>2021-12-18 00:06:42 +0100
commit45559a72376b558d4ffd61fbfbcf47ea75a9f41a (patch)
treec53b4ebc9d5dc410f38660faabd12fb64fb1dbe2 /doc
parentf32d77707a2639fed94978965b3a9690c2bf7904 (diff)
parent4c700e385b9773a46c85386d23038b1d47afd4e7 (diff)
downloadghdl-45559a72376b558d4ffd61fbfbcf47ea75a9f41a.tar.gz
ghdl-45559a72376b558d4ffd61fbfbcf47ea75a9f41a.tar.bz2
ghdl-45559a72376b558d4ffd61fbfbcf47ea75a9f41a.zip
Updates for pyGHDL
Diffstat (limited to 'doc')
-rw-r--r--doc/conf.py36
-rw-r--r--doc/requirements.txt2
2 files changed, 16 insertions, 22 deletions
diff --git a/doc/conf.py b/doc/conf.py
index 20b75ff6e..4071310a5 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -1,9 +1,10 @@
# -*- coding: utf-8 -*-
-import sys, re
+import sys
from os.path import abspath
from pathlib import Path
from json import loads
+from pyTooling.Packaging import extractVersionInformation
# 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
@@ -14,31 +15,22 @@ sys.path.insert(0, abspath('../pyGHDL'))
# ==============================================================================
-# Project information
-# ==============================================================================
-project = u'GHDL'
-copyright = u'2002-2021, Tristan Gingold and contributors'
-author = u'Tristan Gingold and contributors'
-
-# ==============================================================================
-# Versioning
+# Project information and versioning
# ==============================================================================
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
-try:
- with open('../configure') as verin:
- for line in verin:
- line = re.findall(r'ghdl_version=\"([0-9].+)\"', line)
- if line:
- version = line[0]
- break
-except Exception as e:
- print('cannot extract version: %s' % e)
- version = "latest"
- pass
-
-release = version # The full version, including alpha/beta/rc tags.
+project = "GHDL"
+
+# Read __version__ from source file
+packageInformationFile = Path(f"../py{project}/__init__.py")
+versionInformation = extractVersionInformation(packageInformationFile)
+
+author = versionInformation.Author
+copyright = versionInformation.Copyright
+version = ".".join(versionInformation.Version.split(".")[:2]) # e.g. 2.3 The short X.Y version.
+release = versionInformation.Version
+
# ==============================================================================
# Miscellaneous settings
diff --git a/doc/requirements.txt b/doc/requirements.txt
index cb4081ec3..dfd699db9 100644
--- a/doc/requirements.txt
+++ b/doc/requirements.txt
@@ -1,5 +1,7 @@
-r ../pyGHDL/requirements.txt
+pyTooling>=1.7.0
+
sphinx>=3.4.2
#recommonmark>=0.7.1
python-dateutil>=2.8.1