Skip to content

Commit 7ffcfeb

Browse files
committed
Ensure the man page is built
Ever since Sphinx switched to sphinx-build command to build docs, the man page was no longer being built. This is because there is now a separate subcommand "sphinx-build -b man" to generate the man page file. This change adds the separate command and ensures our publish workflows generate the file when releasing a new bandit version. This also adds the man page as part of the data files so it gets included with the wheel and is installed to share/man/man1. Signed-off-by: Eric Brown <eric_wade_brown@yahoo.com>
1 parent 1ab0788 commit 7ffcfeb

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

.github/workflows/publish-to-pypi.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ jobs:
2121
- name: Install dependencies
2222
run: pip install wheel
2323

24+
- name: Build man page if not present
25+
run: |
26+
if [ ! -f doc/build/man/bandit.1 ]; then
27+
tox run -e docs
28+
fi
29+
2430
- name: Build a binary wheel and a source tarball
2531
run: |
2632
python setup.py sdist bdist_wheel

.github/workflows/publish-to-test-pypi.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ jobs:
2121
- name: Install dependencies
2222
run: pip install wheel
2323

24+
- name: Build man page if not present
25+
run: |
26+
if [ ! -f doc/build/man/bandit.1 ]; then
27+
tox run -e docs
28+
fi
29+
2430
- name: Build a binary wheel and a source tarball
2531
run: |
2632
python setup.py sdist bdist_wheel

setup.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ all_files = 1
169169
build-dir = doc/build
170170
source-dir = doc/source
171171

172+
[options.data_files]
173+
share/man/man1 = doc/build/man/bandit.1
174+
172175
[pbr]
173176
autodoc_tree_index_modules = True
174177
autodoc_tree_excludes =

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ commands =
6767
deps = -r{toxinidir}/doc/requirements.txt
6868
commands=
6969
sphinx-build doc/source doc/build
70+
sphinx-build -b man doc/source doc/build/man
7071

7172
[flake8]
7273
# [H106] Don't put vim configuration in source files.

0 commit comments

Comments
 (0)