Hi! I am trying to build with a poetry.lock file (...
# seed
f
Hi! I am trying to build with a poetry.lock file (python), but it fails with the following
Copy code
Serverless: Generating requirements.txt from pyproject.toml...
 Error ---------------------------------------------------
  Error: poetry not found! Install it according to the poetry docs.
I am using serverless 2.60.3 and it works fine locally. Do I need to have an extra configuration for seed to work with poetry?
f
Hey @François-Michel L'Heureux the build machine doesn’t come with Poetry out of the box. But you can easily install it by adding a buildspec. In short, add a
seed.yml
to the root of the repo with the following content:
Copy code
before_compile:
  - curl -sSL <https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py> | python -
Give it a try and let me know if this works for u
f
😄 Awesome! I will try that right away!
So I tried many things and it does not work.
Copy code
- curl -sSL <https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py> | python -
- export PATH=$HOME/.poetry/bin:$PATH
- . $HOME/.poetry/env
Both in
before_compile
and in
before_build
I see the output of the commands. The install seems to work. But at build time, it can’t find it.
I’ll try adding logging (
poetry --version
) after the install…
I know it’s not the preferred way of installation, but
pip install poetry==1.1.11
in the
before_compile
section worked. 🎉 Leaving it here for future reference. 🙂