pdoc icon indicating copy to clipboard operation
pdoc copied to clipboard

Allow users to invoke pdoc CLI with `python -m pdoc`

Open standarddeviant opened this issue 4 years ago • 2 comments

This is a question and/or enhancement request. I would like to invoke the pdoc CLI via something like

python -m pdoc --html MyCode

Is this possible?

I ask because after pip-installing on Windows, pdoc is on my path, but for some reason it's not registered with the OS as an executable. I get a prompt asking which program I'd like to use to open pdoc as if it was a media file. It would be nice usage to be able to invoke pdoc as written above.

standarddeviant avatar Dec 23 '20 16:12 standarddeviant

We, in fact, have pdoc/__main__.py, added in https://github.com/pdoc3/pdoc/pull/8 for precisely the reason of making the module executable. Can you say whether it's a case of https://github.com/pdoc3/pdoc/issues/131?

kernc avatar Dec 23 '20 17:12 kernc

When using poetry (automatically creating virtual-env and only install what is needed) as dependency management tool for installing and building, you can easily use what you expected:

Our CI runs: poetry install poetry run python -m pdoc --html my-project

Where pdoc3 is defined as dev-dependency in pyproject.toml

Kaiser1989 avatar Jan 27 '21 07:01 Kaiser1989