gentle-flower-25372
10/07/2024, 6:03 PMpoetry run alembic
poetry run openapi-python-client
Is there a similar pattern in pants?
I did this and it works
pex_binary(
name="openapi_python_client",
entry_point="openapi_python_client.cli:app",
)
but I was wondering if I'm making this harder than it needs to be.fast-nail-55400
10/07/2024, 6:40 PMpython_requirement
target for the third-party dependency is also "runnable" in the view oif Pants.fast-nail-55400
10/07/2024, 6:41 PMpython_requirements
(plural) target? If so, it generates a python_requirement
target (singular) if each dependency,gentle-flower-25372
10/07/2024, 6:43 PMfast-nail-55400
10/07/2024, 6:43 PMpython_requirements
was in in the root BUILD
file with name `reqs`: then you could run pants run //:reqs#openapi_python_client
gentle-flower-25372
10/07/2024, 6:43 PMgentle-flower-25372
10/07/2024, 6:43 PMfast-nail-55400
10/07/2024, 6:43 PM#
notation signifies a "generated target"fast-nail-55400
10/07/2024, 6:44 PMoverrides
section to the python_requirements
to set it.fast-nail-55400
10/07/2024, 6:44 PMpython_requirement
explicitly with a entry_point
field set to openapi_python_client.cli:app
as you did with the pex_binary
gentle-flower-25372
10/07/2024, 6:49 PMbetter-van-82973
10/07/2024, 7:08 PMPEX_SCRIPT
environment variable to run that from inside the PEX, ex:
PEX_SCRIPT=alembic /path/to/pex <args to alembic>