Skip to content

Commit fa76b52

Browse files
committed
docs: Modernize build process
pbr is slowly but surely removing its Sphinx magic. Switch to using 'sphinx-build' directly, replacing pbr features ourselves. Documentation requirements are moved to the expected location. Signed-off-by: Stephen Finucane <stephen@that.guru>
1 parent b5ca7c0 commit fa76b52

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

docs/conf.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#
33
# git-pw documentation build configuration file
44

5+
import git_pw
6+
57
try:
68
import sphinx_rtd_theme
79
has_rtd_theme = True
@@ -41,9 +43,9 @@
4143
# built documents.
4244
#
4345
# The short X.Y version.
44-
version = u'1.0'
46+
version = '.'.join(git_pw.__version__.split('.')[:-1])
4547
# The full version, including alpha/beta/rc tags.
46-
release = u'1.0'
48+
release = git_pw.__version__
4749

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

test-requirements.txt renamed to docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
-r requirements.txt
1+
-r ../requirements.txt
22
sphinx>=1.5,<2.0
33
sphinx-click>=1.0,<2.0
44
click-man>=0.2,<0.3

tox.ini

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,28 @@ envlist = pep8,mypy,docs
44

55
[testenv]
66
deps =
7-
-r{toxinidir}/test-requirements.txt
7+
-r{toxinidir}/requirements.txt
88

99
[testenv:pep8]
1010
deps = flake8
1111
commands =
1212
flake8 {posargs} git_pw
1313

14-
[flake8]
15-
show-source = True
16-
1714
[testenv:mypy]
1815
deps=
19-
{[testenv]deps}
2016
mypy
2117
commands=
2218
mypy {posargs:--ignore-missing-imports --follow-imports=skip} git_pw
2319

2420
[testenv:docs]
21+
deps =
22+
-r{toxinidir}/docs/requirements.txt
2523
commands =
26-
python setup.py build_sphinx {posargs}
24+
sphinx-build {posargs:-E -W} docs docs/_build/html
2725

2826
[testenv:man]
27+
deps =
28+
-r{toxinidir}/docs/requirements.txt
2929
commands =
3030
python setup.py --command-packages=click_man.commands man_pages
3131

@@ -36,3 +36,6 @@ deps =
3636
commands =
3737
python setup.py -q bdist_wheel sdist
3838
twine upload --skip-existing {toxinidir}/dist/*
39+
40+
[flake8]
41+
show-source = True

0 commit comments

Comments
 (0)