[Distutils] Overriding dependency versions

Daniel Holth dholth at gmail.com
Mon May 13 16:20:08 CEST 2013


On Mon, May 13, 2013 at 10:03 AM, Daniel Holth <dholth at gmail.com> wrote:
> It is very difficult to guarantee that your library will never work
> with any newer version of some other library, but if you can (e.g.
> python-dateutil, versions >= 2 being exclusively Python 3 compatible),
> a < or <= qualifier may be appropriate. != is a good one if you know
> an exact version of some other library is incompatible. == just causes
> problems because it gets in the way of the integrator who has a lot
> more information than the library-author-from-some-time-ago.

The confusion about when to use == comes from the deployment side. It
is common to use == in a requirements file when deploying (you tested
your application on some exact set of versions), rooting your
project's dependency graph with exact distributions. It is almost
never useful for interior nodes of a dependency graph (setup.py's
install_requires) to declare dependencies on exact versions.

a==4 -> b -> c

vs.

a -> b==7 -> c

Usually == crops up when something breaks and the packager decides to
pin the known working version of some dependency in setup.py instead
of forbidding the known-broken version.


More information about the Distutils-SIG mailing list