Re:Hypermodern Python
by BiteCode_dev on Thursday May 28, 2020 @09:31AM
(#23336996)
Honestly, pip freeze includes the whole content of a venv site-packages, and the exact versions. For most projects, that's equivalent to all the dependancies recursively pins with peotry, although you don't have the clean pyproject-dev-prod/lock file separation.
So a huge number of cases can be handled with just that. It will be "reproducible" enought for a lot of people.
Re:Hypermodern Python
by squaresmile on Thursday May 28, 2020 @09:40AM
(#23337079)
> although you don't have the clean pyproject-dev-prod/lock file separation
That's why I use "poetry export -f requirements.txt > requirements.txt" instead of pip freeze. It only exports prod requirements from the poettry lock file.
Re:Hypermodern Python
by BiteCode_dev on Thursday May 28, 2020 @09:45AM
(#23337135)
Nice trick, and very useful to make sure people never have to know about poetry if your team can't deal with it.
For PATH with cron or others, I use the full path to the virtualenv such as /path/to/project/.venv/bin/python. The path can be extracted by "which" or "Get-Command" when the venv is active.
Using a python version different from the system python version is probably the messiest part but well, targeting 3.6 is alright.
I do agree it could be better and it's not quite as streamlined as other ecosystems.