4 ms·
I do mostly Ruby professionally and dabble in Python, and I agree with heydonovan. Pip works fine for installing things, but near as I can tell, Python has no e
by ufmace 9y ago
I do mostly Ruby professionally and dabble in Python, and I agree with heydonovan. Pip works fine for installing things, but near as I can tell, Python has no equivalent of bundler - a tool to install specific versions of a bunch of libraries, generate a lockfile ensuring that your production server and all of the devs are all running it with the same version of everything, and letting you have as many versions of a gem installed as you want, and still running a project with specific versions other than the latest.
- cshenton 9y agoThat's not true. A requirements file is the canonical way to do this. Just use a requirements file and pip install -r requirements.txt. Then version control that file and other Devs do the same. Just like a gemfile.
- brianwawok 9y agopip install -r requirements.txt Pretty simple, no? Most any python project I have seen in the last 5-6 years uses it.
- yen223 9y agorequirements.txt don't track transitive dependencies. Your project could break if a dependency decided to swap out its own dependencies. This isn't theoretical either - it happened to us in production. We are using `pip-tools` to manage that: https://github.com/jazzband/pip-tools https://github.com/jazzband/pip-tools
- Spiritus 9y agoWhat do you mean? `pip freeze > requirements.txt.lock` will freeze all your current deps, including transitive.
- yen223 9y agoThis is only practical if you only have one set of requirements. If you have multiple sets of requirements (for dev vs testing vs production, eg), this becomes impractical real quick. You'll essentially have to tear down and rebuild your dependencies multiple times to update your reqs.
- e12e 9y ago> Python has no equivalent of bundler - a tool to install specific versions of a bunch of libraries Zope and plone, the project(s) that came up with python eggs, used to have the concept of "known good sets"[1], which were massaged and used with zc.buildout : http://www.buildout.org/en/latest/ http://www.buildout.org/en/latest/ I'm not sure I'd recommend it for greenfield projects - splitting things up in sane-sized chunks, and using the now in-standard-lib vevn (python3 -m venv) is probably a better idea. But just for the record, there exists a canonical(ish) solution to some of these issues in python-land. [1] http://grok.zope.org/doc/community/life_cycle/known_good_sets.html http://grok.zope.org/doc/community/life_cycle/known_good_set...
- mercutio2 9y agoSorry to nitpick, but Zope and Plone were not the originators of Python eggs, although they may have popularized them. The design was done by Phillip Eby, with funding from OSAF for the development of Chandler, not Zope. Much shade has been thrown at eggs over the years, and people bemoan the warts, but eggs and setuptools were better than what we had at the time in Python. https://pypi.python.org/pypi/setuptools/0.6c11 https://pypi.python.org/pypi/setuptools/0.6c11
- ATsch 9y agoYou can do this, but it's not as easy. The pipfile project is an effort to improve this. The current standard way to do this is with a virtualenv and a requirements.txt file in which you specify the version of your dependencies, which you can then install with pip install -r requirements.txt. Format is "packagename==0.1.0" (>=, < etc work too). VCS urls work too btw, e.g. "git+protocol://site/repo@tag_or_commit" To get something similar (but inferior) to lockfiles you can use "pip freeze > filename"
- asddddd 9y agoLook at Pipenv: http://docs.pipenv.org/en/latest/ http://docs.pipenv.org/en/latest/ Packaging/distribution is certainly a mess.