News for hackers. Stuff that matters.
Re:PEP 704 – Require virtual environments by default for pac... by mattgreenrocks on Wednesday March 15, 2023 @09:23AM (#35167964)
Written more Python than I'd like, and I still hate + avoid venvs.

They're purely incidental complexity: it should be able to set up a project-local venv by themselves without me having to micromanage anything. I don't care about activating/deactivating venvs. It should just work when I navigate to the project folder. It should let me tweak where packages are stored for the 1% of the time that I care.

Re:PEP 704 – Require virtual environments by default for pac... by radicalbyte on Wednesday March 15, 2023 @09:35AM (#35168106)
It always seems so backwards to me when I use Python... and kinda crazy to see in a "beginner" language.
Re:PEP 704 – Require virtual environments by default for pac... by throwaway894345 on Wednesday March 15, 2023 @10:52AM (#35169210)
I've always felt that it's weird that Python is considered a "beginner" language. Yeah, it uses "and" instead of "&&", but it took me a loooonnng time to figure out how to manage dependencies when I was starting out (and then figuring out how to deploy to targets, how to do reproducible builds, etc). Compared with Rust or Go which just do the right thing by default (personally I've always felt that the tooling is the way more important problem than language concepts which often feel like bike shedding to me).
Re:PEP 704 – Require virtual environments by default for pac... by radicalbyte on Wednesday March 15, 2023 @12:07PM (#35170469)
I also despair that it's used as a beginner language. There are so many better options. I even include Java in that list.

So why is it used? As it has a fantastic eco-system for applied statistics / machine learning / various math things. If you're teaching an introduction to programming then it's a very effective language.

That and once people progress it's decent - much prefer the code written in Python by competent developers to that written in Java or even Go. It also sets people up to use more robust languages such as C# or (for those with a Math background) Haskell.

Re:PEP 704 – Require virtual environments by default for pac... by bitcurious on Wednesday March 15, 2023 @10:02AM (#35168478)
>It should just work when I navigate to the project folder.

You still need to do the setup when you create the project, but once you do you can use direnv[0] to activate/deactivate the venv[1]. I target GCP often, so I have direnv switch over to the correct project [3] also.

[0] https://direnv.net/

[1] https://stackabuse.com/managing-python-environments-with-dir...

[2] https://stackoverflow.com/questions/56781493/gcloud-is-it-po...

Re:PEP 704 – Require virtual environments by default for pac... by rtpg on Wednesday March 15, 2023 @10:44AM (#35169045)
Going to second direnv. It + pyenv really resolved so many of my Python issues
Re:PEP 704 – Require virtual environments by default for pac... by Fatnino on Wednesday March 15, 2023 @11:01PM (#35177625)
I have a couple lines in my bashrc that activate the local venv when I cd into a directory.

I find myself doing `cd .` a lot.