Re:Why I hate virtualenv and pip
by adnam on Friday December 06, 2013 @01:06AM
(#6859668)
Oh dear. What's the right way then?
[ Parent
| on HN ]
LXC + eggs + setuptools + something, I guess?
As a current member of the `pip freeze > reqs.txt' brigade, I'd be interested in seeing a more detailed look at how to do it "right"/better.
Just create a setup.py and put your deps in there.
Ideally, setup.py is for generic minimum-version-known-to-work dependencies of a package. Pip requirements files are for very specific known-good combinations of dependencies of an application. https://caremad.io/blog/setup-vs-requirement/
It's an anti-pattern to not pin versions in libs. setup.py is a contract. Every version listed as a dependency should have been tested, otherwise the package will bitrot. It should be safe to pin major versions, if you can trust upstream packages to follow best practices with version numbers and you aren't using any "undocumented" features of the lib. Ideally, your packages are tested and built into binary packages before they are deployed to production systems. If you are following that best practice, then your risk of a patch breaking your system are minimized.
I consider that nonsense. If there was truth in this, other platforms besides python would need something similar.
Re:Why I hate virtualenv and pip
by tostitos1979 on Friday December 06, 2013 @08:41AM
(#6860962)
Virtualenv + PIP are far more portable than LXC.
They aren't portable at all :)
Re:Why I hate virtualenv and pip
by tostitos1979 on Saturday December 07, 2013 @07:55PM
(#6868480)
What definition of portable are you using? My definition is that developers on Windows, Mac OS and Linux can work with the same python dependencies. Are you dissenting with this?
Re:Why I hate virtualenv and pip
by travisoliphant on Monday December 09, 2013 @11:50PM
(#6879027)
Using conda to build and deploy binary dependencies. Create system-level virtual-environments with ease. Anaconda has jump-started providing binary packages for several platforms.
Getting a conda package from can be as simple as
`conda build --build-recipe <pypi-name>`