acoustic-library-86413
09/15/2023, 2:57 PMpants run
function as poetry run
would, or am I attacking the problem from the wrong angle? E.g. I want to start prefect
which is as simple as running poetry run prefect server start
, however pants run //:root#prefect -- server start
does not yield the same result and throws an error ImportError: No module named prefect.__main__; 'prefect' is a package and cannot be directly executed
.
I really enjoyed this feature of Poetry when debugging stuff locally and testing out new packages and am hoping for an alternative that is pants-native.enough-analyst-54434
09/15/2023, 2:58 PMpex_binary
? If so have you set execution_mode="venv"
?acoustic-library-86413
09/15/2023, 2:59 PMpoetry_requirements
(haven't migrated away from Poetry just yet).enough-analyst-54434
09/15/2023, 3:02 PMpex_binary
binary target with that as a manual dep and a script="prefect", like ~so:
pex_binary(
name="foo",
dependencies=["//:root#prefect],
script="prefect",
execution_mode="venv"
)
The execution_mode
may not be needed, but is generally a good idea for maximum compatibility with the wider Python ecosystem of tools.
You then pants run
this new target.acoustic-library-86413
09/15/2023, 3:03 PMenough-analyst-54434
09/15/2023, 3:03 PMpants export
and then activate the exported venv in dist/...
and go about normal venv business.acoustic-library-86413
09/15/2023, 3:04 PM