Live data from Hacker News

Learning Go as a Python Developer: The Good and the Bad

new.pythonforengineers.com

21–30 of 269 posts

Re: Learning Go as a Python Developer: The Good and the Bad

#22
post #18

>sharing your code is even pain with colleagues even if they are using the same operating system, mainly because the Python requirement file doesn't pin dependencies, wat? Pretty sure you can use == in requirements.txt Also, its very possible, and quite easy to just include the code for the library in your package, which effectively "locks in" the version. We did this all the time when building AWS lambda deployments…

Sure can pin versions, it’s easy too, if you just use «pip freeze».

Better option is to use pipreqs.

Virtual Environment gets on my way. Looking at you Jupyter notebook.

Re: Learning Go as a Python Developer: The Good and the Bad

#24

>sharing your code is even pain with colleagues even if they are using the same operating system, mainly because the Python requirement file doesn't pin dependencies, wat? Pretty sure you can use == in requirements.txt Also, its very possible, and quite easy to just include the code for the library in your package, which effectively "locks in" the version. We did this all the time when building AWS lambda deployments…

I recommend using poetry and just moving on with your life, it’s far easier than trying to use pip (which is totally doable, but not clean).

Re: Learning Go as a Python Developer: The Good and the Bad

#25

>sharing your code is even pain with colleagues even if they are using the same operating system, mainly because the Python requirement file doesn't pin dependencies, wat? Pretty sure you can use == in requirements.txt Also, its very possible, and quite easy to just include the code for the library in your package, which effectively "locks in" the version. We did this all the time when building AWS lambda deployments…

Also, its very possible, and quite easy to just include the code for the library in your package

This only works if installing on exactly the same os and architecture. It can also make the installer for your quick little command line tool hundreds of megabytes.

That being said packing up the python interpreter and all dependencies is the approach I ended up using when shipping non-trivial python applications in the past.

Re: Learning Go as a Python Developer: The Good and the Bad

#26
post #9

>sharing your code is even pain with colleagues even if they are using the same operating system, mainly because the Python requirement file doesn't pin dependencies, wat? Pretty sure you can use == in requirements.txt Also, its very possible, and quite easy to just include the code for the library in your package, which effectively "locks in" the version. We did this all the time when building AWS lambda deployments…

That’s fine until it wont compile on someone else’s machine. Had that many times before with python. SciPy is a bastard on macs for example.

On the other hand tools on par with SciPy are not common in other languages.

Re: Learning Go as a Python Developer: The Good and the Bad

#28

>sharing your code is even pain with colleagues even if they are using the same operating system, mainly because the Python requirement file doesn't pin dependencies, wat? Pretty sure you can use == in requirements.txt Also, its very possible, and quite easy to just include the code for the library in your package, which effectively "locks in" the version. We did this all the time when building AWS lambda deployments…

Yep, I have no idea how they do not even understand the basics of python dependency management. pip freeze > requirements.txt will do it all for you. No wonder they found rust to hard.

recommend pipreqs

Re: Learning Go as a Python Developer: The Good and the Bad

#29
post #17

Earlier quoted context omitted.

What if the depedencies you pinned have non-pinned depedencies? packageA==1.0.0 depends itself on packageB Therefore, you can find yourself with a different set of deps. Had a bug like this once.

Pip freeze will pin explicit as well as transitive dependencies

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

#30
> I had heard of Go for many years, but never stuck with it; it gets constant negative press on Hacker News/Reddit

I think on Hacker News it's really fashionable to criticize Go, and this has led to a culture where Go gets significantly more negativity than it deserves.

As technologists, one of our most important jobs is to see through such fashions and judge languages/tools/technologies based on their actual merit.

While gauging sentiment about things on a forum like Hacker News is generally really helpful, it should not be the main basis of our decisions.

Post reply on HN