News for hackers. Stuff that matters.
Re:The Incredible Growth of Python by ufmace on Wednesday September 06, 2017 @05:30PM (#15187279)
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.
Re:The Incredible Growth of Python by ATsch on Wednesday September 06, 2017 @06:00PM (#15187470)
You 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"

Re:The Incredible Growth of Python by asddddd on Wednesday September 06, 2017 @06:48PM (#15187763)
Look at Pipenv: http://docs.pipenv.org/en/latest/

Packaging/distribution is certainly a mess.

Re:The Incredible Growth of Python by cshenton on Wednesday September 06, 2017 @07:33PM (#15187990)
That'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.
Re:The Incredible Growth of Python by e12e on Wednesday September 06, 2017 @11:32PM (#15188971)
> 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/

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_set...

Re:The Incredible Growth of Python by mercutio2 on Saturday September 16, 2017 @10:43AM (#15264831)
Sorry 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

Re:The Incredible Growth of Python by brianwawok on Wednesday September 06, 2017 @08:04PM (#15188147)
pip install -r requirements.txt

Pretty simple, no? Most any python project I have seen in the last 5-6 years uses it.

Re:The Incredible Growth of Python by yen223 on Thursday September 07, 2017 @12:24AM (#15189133)
requirements.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

Re:The Incredible Growth of Python by Spiritus on Thursday September 07, 2017 @04:14AM (#15189939)
What do you mean? `pip freeze > requirements.txt.lock` will freeze all your current deps, including transitive.
Re:The Incredible Growth of Python by yen223 on Thursday September 07, 2017 @04:39AM (#15190029)
This 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.