Hacker News new | ask | show | jobs
by rdtsc 5413 days ago
If you target a particular Linux platform and have more than just pure Python package dependenices it might be better to learn to use that distro's native package manager (RPM for example).

Not sure if pip lets you run configuration scripts during various stages of install and un-install?

Does pip let you depend on C libraries and other system features?

How does pip handle obsoletes and transitive dependencies?

1 comments

> Not sure if pip lets you run configuration scripts during various stages of install and un-install?

As far as I can tell, you can run config scripts during installation. A good example of this would be Cython. An even crazier example of this would be uwsgi. As for uninstall I'm not sure. A lot of this has more to do with what setuptools/distribute can do not necessarily pip. Pip just makes it easy to enumerate/install/uninstall with the aid of PyPi, setuptools, distribute.

> Does pip let you depend on C libraries and other system features?

Pip isn't smart enough to track down C libraries. This is the part that kind of sucks but I don't know how pip would even do this. Python is cross-platform by nature. Being able to hook into what Windows DLLs, RPMs, debian packages you have to see what C dependencies you've satisfied seems like an ambitious endeavor. Its already hard enough to get a SINGLE package management system working well on its own :) Usually if I know I find myself missing a C library, I read the python package's installation notes, do apt-get or whatever to get all those dependencies I need, then run "pip install" I've had to do this for MySQL-python, pycrypto, and matplotlib thus far.

> How does pip handle obsoletes and transitive dependencies?

By obsolete you mean you need a newer version or do you mean you don't need that package at all anymore? As for transitive, do you mean like a chain of dependencies? I haven't run into any issues just yet... I think pip just goes out and installs everything for you. This primarily depends on how well people implement their setup.py's though.

Thanks for responding. Sounds like pip supports most the features I was wondering about.

By transitive dependencies I mean that it will intall C when installing package A if A depends on B and B depends on C. It looks like it would do that.

As for 'obsoletes' I meant the case (this is from the RPM 'world') where on package changes names or 2 packages are combined into one, so let's say you maintain package A. Then you change its name to B because Oracle's lawyers have threatened to break your knees over a trademark ;-). Now everyone in the world depends on A so you declare that B obsoletes A so not their package will still install and corectly pull in your new package B. The same would happen if say you got together with another project and merged their project into yours. So you would 'obsolete' their old package name. Yeah, this probably doesn't apply to pip as much as RPM, it is more of feature of the package index server rather than pip itself perhaps.

Yeah I think transitive should be fine provided each python package has a good "setup.py"

As for obsolete, you'll just have to manually uninstall the ones that were deprecated and install the new package.