Skip to content

Commit 75948b2

Browse files
committed
Hook doc versions to bump2version
1 parent b058e20 commit 75948b2

File tree

4 files changed

+22
-10
lines changed

4 files changed

+22
-10
lines changed

.bumpversion.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ tag = True
88
search = version = release = '{current_version}'
99
replace = version = release = '{new_version}'
1010

11+
[bumpversion:file:docs/doc_versions.txt]
12+
search = {current_version}
13+
replace = {new_version}
14+
{current_version}
15+
1116
[bumpversion:file:src/compas_fab/__version__.py]
1217
search = __version__ = '{current_version}'
1318
replace = __version__ = '{new_version}'

docs/conf.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@
5959
# autosummary options
6060
autosummary_generate = True
6161

62+
# collect doc versions
63+
package_docs_root = 'https://gramaziokohler.github.io/compas_fab/'
64+
65+
with open(os.path.join(os.path.dirname(__file__), 'doc_versions.txt'), 'r') as f:
66+
version_names = [version.strip() for version in f.readlines()]
67+
package_docs_versions = [(version, '{}{}'.format(package_docs_root, version))
68+
for version in version_names if version]
69+
6270
# on_rtd is whether we are on readthedocs.org
6371
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
6472
html_theme = 'compaspkg'
@@ -68,15 +76,8 @@
6876
"package_title": project,
6977
"package_version": release,
7078
"package_repo": 'https://github.com/compas-dev/compas_fab',
71-
"package_docs": 'https://gramaziokohler.github.io/compas_fab',
72-
"package_old_versions": [
73-
("latest", 'https://gramaziokohler.github.io/compas_fab/latest',),
74-
("stable", 'https://gramaziokohler.github.io/compas_fab/stable'),
75-
("v0.11.0", 'https://gramaziokohler.github.io/compas_fab/0.11.0'),
76-
("v0.10.1", 'https://gramaziokohler.github.io/compas_fab/0.10.1'),
77-
("v0.10.0", 'https://gramaziokohler.github.io/compas_fab/0.10.0'),
78-
("v0.1.0", 'https://gramaziokohler.github.io/compas_fab/0.1.0'),
79-
]
79+
"package_docs": package_docs_root,
80+
"package_old_versions": package_docs_versions
8081
}
8182

8283
html_split_index = False

docs/doc_versions.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
latest
2+
stable
3+
0.11.0
4+
0.10.1
5+
0.10.0
6+
0.1.0

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ attrs>=19.3.0
22
sphinx_compas_theme>=0.9
33
sphinx>=1.6
44
invoke>=0.14
5-
bump2version>=0.5.11
5+
bump2version>=1.0
66
check-manifest>=0.36
77
flake8
88
autopep8

0 commit comments

Comments
 (0)