Override Sphinx documentation version with LORAX_VERSION
Normally you want to document the NEXT release, not the last. This
allows you to build the documentation using:
LORAX_VERSION="29.6" make docs
(cherry picked from commit d47d38e0c8
)
This commit is contained in:
parent
0314cbd0e8
commit
d824d63b97
@ -57,7 +57,11 @@ copyright = u'2018, Red Hat, Inc.' # pylint: disable=redefined-builtin
|
|||||||
# |version| and |release|, also used in various other places throughout the
|
# |version| and |release|, also used in various other places throughout the
|
||||||
# built documents.
|
# built documents.
|
||||||
def read_version():
|
def read_version():
|
||||||
""" Read version from ../lorax.spec"""
|
"""Read version from $LORAX_VERSION or ../lorax.spec"""
|
||||||
|
# This allows the .spec version to be overridded. eg. when documenting an upcoming release
|
||||||
|
if "LORAX_VERSION" in os.environ:
|
||||||
|
return os.environ["LORAX_VERSION"]
|
||||||
|
|
||||||
import re
|
import re
|
||||||
version_re = re.compile(r"Version:\s+(.*)")
|
version_re = re.compile(r"Version:\s+(.*)")
|
||||||
with open("../lorax.spec", "rt") as f:
|
with open("../lorax.spec", "rt") as f:
|
||||||
|
Loading…
Reference in New Issue
Block a user