Files
DocsGPT/docsgpt/__main__.py
T
Alex a96734da07 fix: run the module when the docsgpt command is not on PATH
Refusing to write the service units when `docsgpt` is not on PATH was wrong. A
package installed in a virtualenv is runnable whether or not its console script
is on PATH, and CI runs pytest as `python -m pytest`, where argv[0] is a module
file: the refusal failed thirteen native tests there.

The launcher now prefers the command on PATH, resolved to an absolute path
since PATH can hold relative entries, then an argv[0] that can be executed, and
otherwise this interpreter with `-m docsgpt`, which works wherever the package
is importable. `python -m docsgpt` became an entrypoint of its own and has a
test that runs it.
2026-09-16 22:45:54 +01:00

9 lines
159 B
Python

"""``python -m docsgpt`` runs what the ``docsgpt`` command runs."""
import sys
from docsgpt.cli import main
if __name__ == "__main__":
sys.exit(main())