News for hackers. Stuff that matters.
Re:Learning Go as a Python Developer: The Good and the Bad by im3w1l on Monday July 18, 2022 @03:23PM (#32142368)
Pip freeze will pin explicit as well as transitive dependencies
Re:Learning Go as a Python Developer: The Good and the Bad by fnord123 on Monday July 18, 2022 @04:01PM (#32142910)
It's a hassle to do this correctly and upgrade the dependencies. Use poetry.
Re:Learning Go as a Python Developer: The Good and the Bad by robertlagrant on Monday July 18, 2022 @04:30PM (#32143251)
pip freeze > requirements.txt
Re:Learning Go as a Python Developer: The Good and the Bad by fnord123 on Tuesday July 19, 2022 @05:04AM (#32149162)
That only generates a lock file. When you want to upgrade some of your dependencies and recalculate the correct versions, it doesn't help.
Re:Learning Go as a Python Developer: The Good and the Bad by robertlagrant on Tuesday July 19, 2022 @05:48AM (#32149424)
How's that an issue? Here's an example of what happens: https://gist.github.com/robertlagrant/23489d8970ef6b49960307...
Re:Learning Go as a Python Developer: The Good and the Bad by tomrod on Monday July 18, 2022 @08:15PM (#32145849)
Someone else already responded. It's a one-line command.

I never could get poetry to work right; it's configs are sort of messy. pip freeze > requirements is built in. The only thing it doesn't pin is the python version itself.

Re:Learning Go as a Python Developer: The Good and the Bad by fnord123 on Tuesday July 19, 2022 @05:17AM (#32149264)
As explained elsewhere in this thread, the one line command only generates a lock file. This doesn't manage the dependencies so if you want to upgrade cool-lib and recalculate all the transient dependencies so they fit with the rest of your libraries, you cannot afaik.

Bad non-solutions being built in are a bad thing.

Re:Learning Go as a Python Developer: The Good and the Bad by earthboundkid on Monday July 18, 2022 @11:56PM (#32147370)
This is not actually true. :-) Pip will install transitive deps from a requirements file unless you add the “no deps” flag. Pip freeze doesn’t pin anything. It just dumps stuff into a text file. If it’s a complete list, it has the side effect of pinning, but that’s not guaranteed by pip freeze in any way.