News for hackers. Stuff that matters.
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.
Re:An Intro to Python Flask by atoav on Monday April 04, 2022 @06:06AM (#30904901)
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.
Re:An Intro to Python Flask by mescaline on Monday April 04, 2022 @11:32AM (#30907824)
Or just run it in a container!
Re:An Intro to Python Flask by atoav on Monday April 04, 2022 @01:00PM (#30909020)
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)

Re:An Intro to Python Flask by Doxin on Tuesday April 05, 2022 @08:17AM (#30918026)
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.
Re:An Intro to Python Flask by LtWorf_ on Monday April 04, 2022 @06:13AM (#30904941)
The trick is to not rely on a specific version of python, because they do go EOL and stop receiving fixes.
Re:An Intro to Python Flask by pech0rin on Monday April 04, 2022 @07:48AM (#30905540)
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.