<div dir="ltr">bdist_wheel predates marker support in setuptools and didn't support pulling markers from setup.py until 0.24.0, as noted in the wheel release notes. Older versions of bdist_wheel could read conditional requirements from a section in setup.cfg but could not translate markers from setuptools' requires.txt. Wheel's own source code demonstrates the syntax.<div><br></div><div>pip uses pkg_resources to parse dependencies for wheels and an old enough pip doesn't use wheels at all.</div><div><br></div><div><div><div><div><div class="gmail_quote"><div dir="ltr">On Wed, Oct 28, 2015 at 1:15 PM Marius Gedminas <<a href="mailto:marius@gedmin.as">marius@gedmin.as</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi!<br>
<br>
pip 7 enables wheel caching by default, which is good.<br>
<br>
Wheel caching means you can't compute dynamic dependencies any more --<br>
i.e. things like<br>
<br>
  setup(<br>
    ...<br>
    install_requires=[...] + (['enum34'] if sys.version_info[0] < 3 else []),<br>
    ...)<br>
<br>
will cause problems.<br>
<br>
As far as I understand, you're supposed to use environment markers<br>
instead.<br>
<br>
<br>
Problem 1: where's the documentation?  E.g.<br>
<a href="https://python-packaging-user-guide.readthedocs.org/en/latest/distributing/" rel="noreferrer" target="_blank">https://python-packaging-user-guide.readthedocs.org/en/latest/distributing/</a><br>
has no mention of the word "marker".<br>
<br>
Try to google "setuptools environment marker" (and how is a user going<br>
to discover the magical keyword they need to google is "environment<br>
marker")?  Try to find anything resembling documentation on the 1st<br>
page.  The best I could find was<br>
<a href="http://docs.openstack.org/developer/pbr/#environment-markers" rel="noreferrer" target="_blank">http://docs.openstack.org/developer/pbr/#environment-markers</a> which only<br>
works if you use pbr.<br>
<br>
Even the spec (<a href="https://www.python.org/dev/peps/pep-0426/#environment-markers" rel="noreferrer" target="_blank">https://www.python.org/dev/peps/pep-0426/#environment-markers</a>)<br>
only shows how the markers are supposed to appear in the JSON metadata.<br>
No clue is provided for poor writers of setup.py files.<br>
<br>
I somehow discovered the syntax once (I don't remember how -- most<br>
likely kind people in #pypa spoon-fed me), but now I'm cargo-culting my<br>
existing setup.py files that already use environment markers.<br>
<br>
<br>
Problem 2: what are the minimum versions of the tools that your users<br>
must have before you can rely on environment markers?<br>
<br>
- setuptools >= 0.7 ("Added experimental environment marker support")<br>
<br>
- wheel >= 0.24 (if you have wheel 0.23 or older, environment markers are<br>
  silently broken and have fun figuring out why:<br>
  <a href="https://github.com/pypa/pip/issues/2870" rel="noreferrer" target="_blank">https://github.com/pypa/pip/issues/2870</a>).<br>
<br>
- does the pip version matter at all?  I think not; please correct me if<br>
  I'm wrong.<br>
<br>
<br>
Some official answers from the hard-working PyPA visionaries would be welcome.<br>
<br>
Marius Gedminas<br>
--<br>
I once held a little hand<br>
That made my sad heart sing.<br>
Twas the loveliest hand I'd ever held,<br>
Four Aces and a King<br>
_______________________________________________<br>
Distutils-SIG maillist  -  <a href="mailto:Distutils-SIG@python.org" target="_blank">Distutils-SIG@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/distutils-sig" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/distutils-sig</a><br>
</blockquote></div></div></div></div></div></div>