Since man pages aren't accessible to users after a `pip install`, there's no need to include them in the sdist. This change makes it trivial to build man pages from source, which makes them much easier to iterate on. It also simplifies creation and testing of the sdist, since it no longer requires building man pages. The new `packaging/cli-doc/build.py` script can generate both man pages and RST documentation. This supports inclusion on the docs site without a dependency on `ansible-core` internals. Having a single implementation for both simplifies keeping the two formats in sync.
24 lines
574 B
Python
Executable File
24 lines
574 B
Python
Executable File
#!/usr/bin/env python
|
|
|
|
import os
|
|
import pathlib
|
|
import sys
|
|
|
|
exclude_programs = {
|
|
'ansible-connection',
|
|
'ansible-test',
|
|
}
|
|
|
|
bin_dir = pathlib.Path(os.environ['JUNIT_OUTPUT_DIR']).parent.parent.parent / 'bin'
|
|
programs = set(program.name for program in bin_dir.iterdir() if program.name not in exclude_programs)
|
|
docs_dir = pathlib.Path(sys.argv[1])
|
|
docs = set(path.with_suffix('').name for path in docs_dir.iterdir())
|
|
|
|
print('\n'.join(sorted(docs)))
|
|
|
|
missing = programs - docs
|
|
extra = docs - programs
|
|
|
|
if missing or extra:
|
|
raise RuntimeError(f'{missing=} {extra=}')
|