I'm trying to figure out how to do automated(ish) deployment for a python project with pex. I currently have the following process:
$ poetry run pip freeze > requirements.txt
manually remove this-project line from requirements.txt
$ poetry run pex -r requirements.txt -o service.pex -e api:start --sources-directory=.
$ ./service.pex
The reason for the second step is that pex will try to find this-project
online if I leave the line in. This I understand, but pip freeze
does insert that line in requirements.txt
. What I'm wondering is: can pex use pyproject.toml
or poetry.lock
directly? The current solution is kind of an annoying work around.
I've looked at 2019 tutorial and it doesn't work, since the current version of pex doesn't recognize --project
as an option.
Any other suggestions would be greatly appreciated.