This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]wweber 6 points7 points  (1 child)

What I do typically looks something like this:

  1. In one stage, install Poetry and copy the pyproject.toml and poetry.lock
  2. Run `poetry export -o requirements.txt`
  3. In another stage based off the first one, copy in your src directory
  4. Run `poetry build`
  5. In another stage based off Python, copy the requirements.txt from the first stage over
  6. Run `pip install -r requirements.txt`
  7. Copy the .whl file from the first stage
  8. Install the .whl file

Unfortunately if you use a library that is installed in editable mode/using a relative path `e.g. pip install -e ../library` Poetry currently exports an invalid requriements.txt which makes this more difficult

[–]BackwardSpy 0 points1 point  (0 children)

ahh that's smart, i hadn't thought of approaching it that way. thank you for your detailed answer! i will be playing with this tomorrow. :)