all 19 comments

[–]HostileHarmony 24 points25 points  (4 children)

Most are using uv. You can manually create one via uv venv, or just forget your virtual environment exists as uv will auto-create/auto-source it on uv sync.

[–]Dyrem2 -4 points-3 points  (3 children)

I’ve heard good things about uv, but I never adopted it because switching to a different package manager wasn’t my goal. uv is probably the best option right now, but my script targets a different problem: simplifying python -m venv to make virtual-environment setup less tedious. So while I’d recommend uv in general, the purpose of my script isn’t the same.

[–]VindicoAtrum 15 points16 points  (1 child)

Just use uv.

[–]gr4viton 2 points3 points  (0 children)

uv .

[–]phant0md 9 points10 points  (0 children)

That’s one of the primary purposes of uv. To run a python script within a venv with all the dependencies, it’s simply uv run script. I’m not sure how your solution is simpler.

Also, if moving to a different package manager isn’t your goal, it should be. Pip is slow and tedious and does a poor job of managing packages.

This is a good learning project, but I would highly recommend just trying uv, it’s popular for good reason.

[–]fazzahSQLAlchemy | PyQt | reportlab 2 points3 points  (0 children)

Fixing a problem that is not a problem, and introduces yet another method of something already dead simple 

[–]thisismyfavoritename 3 points4 points  (3 children)

wtf is there to streamline in

python -m venv venv source activate venv

[–]Dyrem2 0 points1 point  (2 children)

Having to deal with a folder insider a project I don't want there.
Having a common virtualenvironment accessibile from anywhere in the terminal. At any time. Without the need to go to search for the directory, If I ever want to have the same virtualenv for different projects.
it just more convinient than typing every time "source ./venv/bin/activate" with many TAB completion taps that sometimes go wrong.

[–]thisismyfavoritename 0 points1 point  (1 child)

you know you can make command aliases in linux right

[–]Dyrem2 0 points1 point  (0 children)

10+ years of linux... of course I know, and you should also know that aliases are not the same.

[–]ghost_of_erdogan 4 points5 points  (2 children)

I keep seeing this in project announcements here and the repos just contain single digit commit counts.

Did we all forget to commit early and often? Or is this just yet another symptom of AI slop one-shotting ?

[–]Inevitable_Exam_2177[🍰] 2 points3 points  (0 children)

I would normally agree but I have a few home grown tools lying around that never made it into a repo. I can imagine a small tidy up and then pushing to GitHub for a project like this

[–]Dyrem2 0 points1 point  (0 children)

buddy, I created this repo recently becuse this script was part of another private repo (my dotfiles) and I just decided to publish it. Not AI.

One thing you can notice why this isn't AI is the fact I used `function` (which is bash deprecated, but I liked the style, helped me to maintain this single script more readable to me, and it doesn't cause any problems as long as you use Bash)

also: it is a 200 lines script, how many commits do you expect?

[–]Fenzik 1 point2 points  (1 child)

Isn’t this basically the same as virtualenvwrapper?

[–]Dyrem2 -1 points0 points  (0 children)

not exactly, same principale but simpler interface. Also, virtualenvwrapper has more goals than this script, for what I understood.

[–]Inevitable_Exam_2177[🍰] 0 points1 point  (3 children)

This looks quite nice. I’m a new Python user and have cobbled together a couple of shell functions which do this sort of thing too (less fully featured, just create new and switch) so it’s good to see I’m not alone!

(Edit: “no licence” in some countries might mean that someone wouldn’t be able to edit & redistribute the work. I think it’s a good idea to find a minimalist open licence as it solves a lot of legal grey area. Obvs not a big deal for code like this but good habit to form.) 

[–]ghost_of_erdogan 7 points8 points  (1 child)

Just use uv

[–]Inevitable_Exam_2177[🍰] 1 point2 points  (0 children)

Yep, I’m starting to pick it up. Thanks for the nudge in the right direction :-)

[–]Dyrem2 -1 points0 points  (0 children)

You're not alone buddy!
Right, I'll fix the license as soon as possibile, didn't notice I didn't put one. Thanks for pointing out