wonderful-boots-93625
04/24/2023, 2:45 PMadhoc_tool
for generating documentation with pdoc
. pdoc needs the target distribution installed along with it’s deps (on top of pdoc itself) to work. pex_binary seemed to be a good way to do this, but Im probably misunderstanding how to configure this. Example:
python_requirement(
name='pdoc_req',
requirements=[
'pdoc'
]
)
pex_binary(
name='pdoc_sdk',
dependencies=[
':pdoc_req',
':dist'
],
entry_point='pdoc'
)
adhoc_tool(
name="build-pdoc",
runnable=":pdoc_sdk",
args=["pdoc", "-d", "google", "-o", "docs/", "src/my_package/"],
execution_dependencies=[":dist"],
output_files=["docs"],
root_output_directory=".",
)
run_shell_command(
name="run-build-pdoc",
command="ls {chroot}/docs",
execution_dependencies=[":build-pdoc",],
)
Doing ./pants run my_package:run-build-pdoc
yields
Engine traceback:
in `run` goal
ProcessExecutionFailure: Process 'the `adhoc_tool` at my_package:build-pdoc' failed with exit code 127.
stdout:
stderr:
env: python3.9: No such file or directory
:dist
is a python_distribution
broad-processor-92400
04/24/2023, 8:03 PMwonderful-boots-93625
04/25/2023, 7:28 PMbroad-processor-92400
04/25/2023, 7:47 PMwonderful-boots-93625
04/25/2023, 9:07 PM2.17.0.dev4
but seeing this error. Trying to get an adhoc command to work
19:21:44.89 [DEBUG] Completed: Extracting plugin locations
19:21:44.89 [DEBUG] Completed: Scheduling: Extracting plugin locations
19:21:44.89 [DEBUG] computed 1 nodes in 0.191871 seconds. there are 73 total nodes.
19:21:45.09 [ERROR] cannot import name 'Environment' from 'pants.engine.environment' (/Users/nasron/.cache/pants/setup/bootstrap-Darwin-arm64/2.17.0.dev4_py39/lib/python3.9/site-packages/pants/engine/environment.py)
broad-processor-92400
05/01/2023, 11:28 PMwonderful-boots-93625
05/01/2023, 11:29 PMenough-analyst-54434
05/01/2023, 11:40 PMwonderful-boots-93625
05/02/2023, 1:32 PM0.25.0
enough-analyst-54434
05/02/2023, 2:02 PMwonderful-boots-93625
05/02/2023, 5:06 PM