Re:An Intro to Python Flask
by postpawl on Monday April 04, 2022 @01:58AM
(#30903688)
Telling people to apt-get or brew install python isn’t good advice. It’s best to use something like pyenv so an upgrade doesn’t get rid of the version of python you were relying on.
[ Parent
| on HN ]
Exactly. Always, always create a virtual environment of some sorts for your python projects, unless you don't use external dependecies at all.
I ended up using poetry in the end.
Re:An Intro to Python Flask
by NoThisIsMe on Monday April 04, 2022 @08:05AM
(#30905676)
Yes, that too, but GP isn't talking about virtual environments.
Or just run it in a container!
Poetry wins over a container because you have better version control (minimum/maximum specs as per your pyproject.toml file) and makes sure your users get the same build (as per poetry.lock).
Additionally if what you are building is a library, then a container won't fly as you (to my knowledge) cannot publish these to pypi (to make them installable via pip install foo)
I'd be careful recommending pyenv to beginners too. I've seen it turn an interns system python install to absolute mush. Took some real doing to finally get pyenv unhooked from the system and everything back in working order.
The trick is to not rely on a specific version of python, because they do go EOL and stop receiving fixes.
Thats not a trick, every version of software eventually reaches EOL. Thats why there is semantic versioning, etc. What do you think happens when security vulnerabilities are found in a version of software. Your comment is meaningless.