Staging an installation of a project that uses project-mode=false #10960
Replies: 1 comment
-
|
With 1. Export the locked dependencies and let pip do the staged installpip supports prefix / root / target installs, which Poetry does not: # resolve + pin everything Poetry manages
poetry export --without-hashes -f requirements.txt -o requirements.txt
# stage into your prefix (pip understands --prefix / --root / --target)
python -m pip install --prefix /my/staging/dir -r requirements.txt( That populates 2. Build and stage your own path tools as wheelsYour python -m build tools/foobar # produces tools/foobar/dist/foobar-*.whl
python -m installer --destdir /my/staging/dir tools/foobar/dist/foobar-*.whlSo: keep Poetry for dependency resolution, but do the staged install with pip ( |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a project that uses poetry to build some python tools. It sets
package-mode = falseand then defines some tools like:The pattern here is that the project does
poetry installand the tools are then available in a venv.However for reasons I'm trying to build a distribution package of the tools, so I don't want poetry to install into a venv but instead into a staging prefix of my choosing.
For example, if I was using pypa/build and pypa/installer I'd just
python3 -minstaller foo.whl --destdir=/my/staging/dirand I'd have/my/staging/dir/usr/lib/python3.14/site-packages/...populated.However I can't build a wheel when poetry is not in package mode, and
poetry installdoesn't have a dest/root dir mode. Is there a solution to this that I can't see?Beta Was this translation helpful? Give feedback.
All reactions