[Distutils] Specifying Python version as part of requirements

Daniel Holth dholth at gmail.com
Sat Jul 5 04:38:58 CEST 2014


The next wheel release and the wheel code in revision control will support
the setuptools conditional requirements syntax. See wheel's own setup.py in
mercurial tip. 🐙
On Jul 4, 2014 7:48 PM, "Donald Stufft" <donald at stufft.io> wrote:

> So this is in PEP uh, 426 I think. It’s not final yet but it kinda works
> right now for Wheels.
>
> Basically you do a conditional include to install_requires in your
> setup.py, and then if
> you’re creating wheels you do something like ->
> https://github.com/dstufft/twine/blob/master/setup.cfg#L9-L13
>
> That will overwrite install_requires, but only for Wheels.
>
> On Jul 4, 2014, at 6:51 PM, Brett Cannon <bcannon at gmail.com> wrote:
>
> > I just checked PEP 440 and pip doesn't seem to have anything specific,
> so I thought I would ask if there is any way now or in the future to
> specify that a dependency is only needed for certain versions of Python?
> >
> > My current use case is I want to use unittest2, but pip errors out
> during installation under Python 3 of it since unittest2 imports itself and
> triggers a syntax error. Instead of having to hack around this by making it
> a conditional include in my setup.py I would like to declare that I only
> need it in Python 2.x in a requirements.txt file or something.
> > _______________________________________________
> > Distutils-SIG maillist  -  Distutils-SIG at python.org
> > https://mail.python.org/mailman/listinfo/distutils-sig
>
>
> -----------------
> Donald Stufft
> PGP: 0x6E3CBCE93372DCFA // 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372
> DCFA
>
>
> _______________________________________________
> Distutils-SIG maillist  -  Distutils-SIG at python.org
> https://mail.python.org/mailman/listinfo/distutils-sig
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20140704/e2560315/attachment.html>


More information about the Distutils-SIG mailing list