Earlier quoted context omitted.
Even using conda to manage reqs is an absolute nightmare. Did a subreq get updated? Did the author of the library pin that subreq? No? Have fun hunting down which library needs to be downgraded manually
I used a couple of tricks to solve this. First, make cond env export a build step and environment.yml an artifact so you've got a nice summary of what got installed. Second, nightly builds so you aren't surprised by random package upgrade errors the next time you commit code to your project.
Learning Go as a Python Developer: The Good and the Bad
171–180 of 269 posts
Re: Learning Go as a Python Developer: The Good and the Bad
#172Earlier quoted context omitted.
Keep in mind that Python is 31 year old (it's even older than Java) it was created around the same time as world wide web. So it started when no one even knew they would need dependency management and evolved over time from people posting packages on their home pages, to a central website to what we now call PyPI. Similarly the tooling and way of packaging the code evolved. What you described are multiple tools that…
Being 31 years old doesn't preclude having a decent, official and reproducible way of installing packages in 2022. That's just a bad excuse to justify subpar package managers and terrible governance around this problem. Package management is pretty much a solved problem, no matter how old is your language. It smells to an outsider like me like a lot of bike-shedding and not enough pragmatism is going on in Python lan…
I think also a lot of issues with packaging is ironically because of PyPA that supposed to work on a standard, but in reality instead of embracing and promoting something that works they just pushes half-assed solutions because author is one of the members. Kind of like they were pushing failed Pipenv "for humans". Seems like Poetry is generally popular and devs are happy with it, so of course PyPA started pushing their own Hatch project, because python packaging was finally getting too straight forward.
I think Python would benefit as a whole if PyPA was just dissolved.
Re: Learning Go as a Python Developer: The Good and the Bad
#173Earlier quoted context omitted.
No. C# is usually used by Microsoft shops, and half the reason to use C# is so you can use Visual Studio.
That implies that if a better alternative to VS came along, C# developers wouldn't choose it! I certainly would, for one, and I'm a long-term VS user, well aware of its failings (but also yet to come across another IDE that's noticeably superior. And coding with a text editor and command line compiler is something I spent 10+ years doing when it was all that was available, and nothing I have any great hankering to go…
Re: Learning Go as a Python Developer: The Good and the Bad
#174Earlier quoted context omitted.
Being 31 years old doesn't preclude having a decent, official and reproducible way of installing packages in 2022. That's just a bad excuse to justify subpar package managers and terrible governance around this problem. Package management is pretty much a solved problem, no matter how old is your language. It smells to an outsider like me like a lot of bike-shedding and not enough pragmatism is going on in Python lan…
No but there’s a walrus operator! Not sure anyone was asking for that, unlike a fix for packaging issues.
Re: Learning Go as a Python Developer: The Good and the Bad
#175On the subject: What is a good, idiomatic, Go project to study? Something big enough to be a good example of code organization, yet small enough not to become a new hobby.
Re: Learning Go as a Python Developer: The Good and the Bad
#176Earlier quoted context omitted.
I mean pip freeze outputs packages and their versions in machine readable form that can be read and installed by pip install -r requirements.txt
This whole chain started with someone pointing out the author doesn't seem to realize you can pin versions[1]. I'm just confused how people seemed to end up questioning what pip freeze does. [1] https://news.ycombinator.com/item?id=32141573#32142190
I tried to say that from mentioned tools only poetry can be called as a dependency management.
The other tools are used for different purposes, but perhaps could be used as a piece of package management in some way. The mentioned docker and vendoring is irrelevant to Python and it even applies to Go.
Re: Learning Go as a Python Developer: The Good and the Bad
#177Earlier quoted context omitted.
When I was a Python dev, I never saw that happen in ten years or so of work. Pip freeze and virtualenv just worked for me. I will say, though, that this only accounts for times where you’re not upgrading dependencies. Where I’ve always run into issues in Python was when I decided to upgrade a dependency and eventually trigger some impossible mess.
Upgrading dependencies is fraught in all languages.
In Elixir I can do `mix hex.outdated` in any project, no matter who wrote it, and it'll tell me very quickly what's safe to update and link to a diff of all the code changes. It's night and day.
Thankfully, it's getting gradually better with poetry, but it's still quite clunky compared to what you get elsewhere. I noticed lately for instance that the silent flag is broken, and there's apparently no way to prevent it from spamming 10k lines of progress bars in the CI logs. There's an issue on Github, lost in a sea of 916 other open issues...
Re: Learning Go as a Python Developer: The Good and the Bad
#178Earlier quoted context omitted.
Pip freeze will pin explicit as well as transitive dependencies
It's a hassle to do this correctly and upgrade the dependencies. Use poetry.
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
#179Earlier quoted context omitted.
Sometimes I feel people are using Python very differently than me. I just use pip freeze and virtualenv (these are Python basics, not some exotic tools) and I feel it works great. Granted, you don't get a nice executable, but it's still miles ahead of C++ (people literally put their code into header files so you don't have to link to a library), and even modern languages like rust (stuff is always broken, or I have s…
If I did that I'd have no harddrive space left due to how large python dependencies are.
Re: Learning Go as a Python Developer: The Good and the Bad
#180Earlier quoted context omitted.
- Poetry is a 3rd party package manager, I'm sure it's great but it's not widely used (yet) - Pip freeze just pins all dependencies at once to requirements.txt - I don't know what "vendoring in dependency code" means - I've never used pipreqs in my life (and 80% of my work has been in Python) - Virtualenvs are just a convenient way to keep project runtimes separated And for 90% of Python projects in existence the fol…
Sounds like someone has never been asked to clone and run software targeting Python 3.x when their system-installed Python is 3.y and the two are incompatible.
pyenv install 3.9.47
pyenv virtualenv 3.9.47 my app
git clone …/myapp
cd …/myapp
pyenv local myapp
pip install -r requirements.txt
Is it annoying, maybe, but I normally don’t trust system deps for anything.