I found a writeup [1] on how to write your own virtualenv. It doesn't look like there's much overhead there.
I suppose one could justify not using virtualenv if they're on a system with limited resources or network access. I've known people who spent hours building a compiling python 2.7 from source on embedded systems because they rolled their own distro, and in that situation it would make sense to not want to mess with virtualenv if you just spent hours getting pip working.
1: https://www.recurse.com/blog/14-there-is-no-magic-virtualenv...
With this you just have one tool, and it's just easier for me to understand what's going on compared with virtualenv.
I'm not too sure that this would end up being any easier, but maybe...
[1] http://streetsign.org.uk/ [2] https://bitbucket.org/dfairhead/streetsign-server/src/5b359a...
find . -type d -name node_modules | wc -l
from any reasonably large project's root directory -- the results will defy your sense of parsimony.Packages which require other modules pegged to a specific version will install that package within their own node_modules directory, when they are already deep within a subdirectory of another node_modules directory. If two packages both require [email protected], they will both install that bar package in their own node_modules directory.
It is literally the most naive way to write a package manager.
What exactly is the overhead of a virtualenv? A few symlinks and a script which adds a few variables to your environment? Your calculation of what is and isn't complex is exactly backwards from the traditional Python perspective.
As a Pythonista, I can't help but object to the homebrew/npm school of roll-your-own package management. It eschews parsimony, deliberate architecture planning, and learning from the mistakes of other projects in favor of aesthetics and (sorry, I can't think of another name for this) hipster-DIYism.
But I don't know enough about JS development to say whether this really happens and/or if it is an issue (some pretty cool stuff has been done with JS so I guess it's possible to live with it).
BTW I share your dislike of hipsters, though I am a bit jealous those moustaches are just so cool.
Among other things, what happens if your Python code changes its working directory, then subsequently tries to import a module? Consequences range from "doesn't work" to "introduces a security vulnerability by running arbitrary Python code from an untrusted directory".
/tmp $ PYTHONPATH='./test' /usr/bin/python -c 'import sys; print sys.path[:3]'
['', '/private/tmp/test', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip']It's still odd for software to only work when launched from a specific directory, but not necessarily a critical security vulnerability then.
$ /path/to/.virtualenv/my_project/bin/python SomeScript.py
Let's say you reimplement ls in Python. You then use your shiny new program to have a look at some downloaded files:
$ ../utils/ls.py
['hello.txt', 'os.py']
So far so good. Now let's try it with PYTHONPATH set to include the current directory: $ PYTHONPATH="." ../utils/ls.py
Boom! Your box is mine!
['no', 'files', 'for', 'you']This is apparently an unacceptable limitation for some people, judging by the responses to the article - however for others it's not.
The things you care about may be different from what others care about: I'm guessing don't care about Windows compatibility or you wouldn't talk about shebangs, and others may not find only running the scripts from the project root an issue (I don't for example).
Why is a relative path in the PYTHONPATH necessarily bad practice? It's not a rhetorical question, I am genuinely curious.
If you're happy with virtualenv then continue using it - all we have done is propose an alternative.