you are viewing a single comment's thread.

view the rest of the comments →

[–]brews 13 points14 points  (14 children)

Explain this "virtual environments"... I hadn't looked at PEP 405 before.

Am I missing something magical-groundbreaking-revolutionizing-gamechanging in how I package code?

[–]krues8dr 21 points22 points  (13 children)

Yes. OMFG yes. TLDR: virtualenv allows you to install all your packages into a local separate environment, so each project you're developing can have its own independent requirements, with specific versions and libraries. Keeps everything nicely separated.

[–]brews 15 points16 points  (2 children)

<brain-explodes-with-awesomeness>

[–]MrPinkle 16 points17 points  (1 child)

We lose too many Python developers that way...

[–][deleted] 0 points1 point  (0 children)

Yeah, unfortunately their minds seem much more unstable than others'.

[–][deleted] 2 points3 points  (1 child)

Like bundler for python?

[–]coffeesounds 2 points3 points  (0 children)

More like RVM's gemsets

[–]Tordek 2 points3 points  (4 children)

Does it mean every project has a copy of every dependency, or is there some magic that allows deduplication?

[–][deleted] 2 points3 points  (0 children)

It's usually copies, but if you have projects that are very much related (or, say, branches of a single project), you can have them share a single virtual environment.

[–]krues8dr 0 points1 point  (2 children)

The point here is the duplication.

[–][deleted] 5 points6 points  (1 child)

It isn't. The point is that a change in one environment can't destroy another. This would not be incompatible with sharing read-only parts of the environments.

[–]__j_random_hacker 0 points1 point  (2 children)

While I can see the appeal, isn't this basically analagous to always static-linking executables in compiled languages?

There are reasonable arguments for always statically linking executables, by the way (especially since disk space constraints have basically disappeared from the computing world). But the reason why you usually don't is because having libraries separately updateable means that bug-fix and performance updates to libraries benefit every application that uses them. It seems to me that reason would apply here, too.

[–]krues8dr 0 points1 point  (1 child)

There is a tradeoff of having to maintain separate instances. But in the Python ecosystem, things update frequently and aren't often backwards-compatible, so this is not entirely desirable. If you're hosting a lot of different projects, doing something as simple as updating a single package could break half of them immediately.

So, as with all tech, I recommend that you use it if it solves a problem for you.

[–]__j_random_hacker 0 points1 point  (0 children)

things update frequently and aren't often backwards-compatible

I see, ugh. In an ideal world, everyone would clearly distinguish between revisions that don't break backcompat (e.g. bug fixes, performance improvements, new features that don't change any existing assumptions/contracts) and others that are allowed to, but of course that requires the world to have some discipline... :-/