Skip to content

Commit d7be17f

Browse files
committed
Autmatically get version and release from roundup/__init__.py
Copy code from docs/conf.py that generates the release and version settings from roundup/__init__.py into website/www/conf.py. Update RELEASE.txt to remove need to set these manually and annotate a couple of other documented changes.
1 parent ef30a9c commit d7be17f

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

RELEASE.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ Roundup release checklist:
3232
3. Update version in:
3333
CHANGES.txt (set date for version as well)
3434
roundup/__init__.py
35-
website/www/index.txt
36-
website/www/conf.py (also update copyright)
35+
website/www/index.txt (current stable version, release highlights)
36+
website/www/conf.py (update copyright, version from __init__.py)
3737
3a. Update license end date in COPYING.txt
3838
3b. Update doc/acknowledgements.txt (add section for
3939
release, churn contributers etc.). (Use hg churn -c -r ####..####)

doc/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424

2525
# Read Roundup version by importing it from parent directory,
26-
# this ensures that 'unkown version' is inserted even if
26+
# this ensures that 'unknown version' is inserted even if
2727
# `roundup` is importable from other location in sys.path
2828
SYSSAVE = sys.path
2929
DOCROOT = os.path.abspath(os.path.dirname(__file__))

website/www/conf.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,20 @@
1919

2020
import sys, os
2121

22+
# Read Roundup version by importing it from root of checkout.
23+
# this ensures that 'unknown version' is inserted even if
24+
# `roundup` is importable from other location in sys.path
25+
SYSSAVE = sys.path
26+
DOCROOT = os.path.abspath(os.path.dirname(__file__) + "/..")
27+
sys.path = [os.path.dirname(DOCROOT)]
28+
try:
29+
from roundup import __version__ as VERSION
30+
SHORTVER = '.'.join(VERSION.split('.', 2)[:2])
31+
except ImportError:
32+
VERSION = SHORTVER = '(unknown version)'
33+
finally:
34+
sys.path = SYSSAVE
35+
2236
# If your extensions are in another directory, add it here. If the directory
2337
# is relative to the documentation root, use os.path.abspath to make it
2438
# absolute, like shown here.
@@ -55,9 +69,9 @@
5569
# built documents.
5670
#
5771
# The short X.Y version.
58-
version = '2.3b2'
72+
version = SHORTVER
5973
# The full version, including alpha/beta/rc tags.
60-
release = '2.3.0b2'
74+
release = VERSION
6175

6276
# The language for content autogenerated by Sphinx. Refer to documentation
6377
# for a list of supported languages.

0 commit comments

Comments
 (0)