[01:59:37] <StevenK> lifeless: https://github.com/pypa/packaging/pull/49 for just marker support or https://github.com/pypa/packaging/pull/50 for markers + requirements parsing
[20:09:55] <ErikRose> What's everybody's take on conditional install_requires entries, i.e. `if sys.version_info<(2, 7, 9): install_requires.append('ndg-httpsclient')`?
[20:10:10] <ErikRose> We're having some trouble in Let's Encrypt with those + wheels.
[20:10:31] <ErikRose> Wheels of course don't get the opportunity to run such setup.py logic.
[20:11:00] <ErikRose> Nor do they have sufficient granularity to offer separate wheels for 2.7.8 and 2.7.9.
[20:11:23] <ErikRose> What's the best approach? Unconditional dependencies + runtime import twiddling?
[20:12:01] <ErikRose> Environment markers are another possibility,
[20:12:48] <ErikRose> but they got range operators only in setuptools 17.1, released 6 months ago.
[20:14:07] <ErikRose> I suppose, for the < case, we could just use multiple == conditions: 2.6.0, 2.6.1, 2.6.2, ..., 2.7.8.
[20:14:16] <ErikRose> That's supported as far back as setuptools 0.7,
[20:15:21] <ErikRose> Hmm, why is setuptools 0.7.x not on PyPI?
[20:15:32] <ErikRose> It goes right from 0.6 to 0.9.8.
[20:17:08] <ErikRose> Looks like mid-2013 for setuptools 0.7.
[20:20:43] <dstufft> lifeless: hi, sorry. Been back and forth in email and such trying to arrange some stuff and it's just sucked up a bunch of time :(
[20:21:25] <dstufft> ErikRose: I Think environment markers support < don't they?
[20:21:40] <ErikRose> dstufft: Only fairly recently
[20:21:56] <ErikRose> You know how Linux distros are. :-)
[20:22:41] <ErikRose> Actually, you know what? We can go ahead and use < once we upgrade to our new installer, which pins everything.
[20:22:58] <dstufft> ErikRose: well, for wheels you care about the pip version, not the setuptools version
[20:24:00] <ErikRose> Oh, does pip do all wheel metadata handling itself?
[20:24:14] <dstufft> yea, you can install wheels without ever having setuptools installed
[20:24:19] <ErikRose> I guess it makes sense for setuptools to be confined to setup().
[20:25:04] <dstufft> there are two things, there's the wheel metadata which pip reads, and then setuptools also supports env markers inside of setup.py (which will be translated to inside the wheel when building)
[20:25:21] <dstufft> sadly, pip < 6 doesn't work with the setup.py env markers, though setuptools 0.7 does
[20:25:40] <dstufft> but, you can do the programatic thing inside of a setup.py, and explicitly override the dependency metadata during wheel generation
[20:25:52] <dstufft> depending on what versions of what you want to support
[20:26:20] <ErikRose> We can be sure that we build the wheels under a modern setuptools.
[20:26:44] <dstufft> ErikRose: can you be sure that nobody will be attempting to install the sdist with an old setuptools or an old pip?
[20:26:45] <ErikRose> Then people would just need pip >=6 to install properly, right?
[20:26:59] <dstufft> if it's wheels they are installing, it's pip 1.5+
[20:28:28] <dstufft> the trick is that when the metadata section is inside of setup.cfg, bdist_wheel will completely ignore install_requires when building the wheel, and will use that instead
[20:28:38] <dstufft> (and setuptools and such doesn't otherwise use it)
[20:29:10] <ErikRose> That is super scarypants. :-) We'll never remember why we did that.
[20:29:35] <ErikRose> You're swinging me back to my original leaning, which was to come up with an unconditional set of dependencies. Thank you. :-)
[20:30:54] <dstufft> ErikRose: comedy option: Whenever you come back to the code in the future and you're confused why a thing exists, ping me because my head is a a database of all the sad things in packaging :D
[20:31:22] <ErikRose> Thanks! I knew that! That's why asked in here today. :-)
[20:31:36] <ErikRose> So glad you're getting paid for it now
[20:36:43] <ErikRose> My favorite is to do it at random and watch people try to debug it.
[20:46:27] <ErikRose> dstufft: I support overriding the wheel metadata within setup.cfg would make everything alright as long as you're using a new enough pip that it always builds wheels, rather than installing straight from the sdist. Sanity check?
[20:48:08] <dstufft> I'm not sure exactly what you're asking. If you're asking if it's OK For sdist to be "broken" if built wheels are OK I'd say probably not, but there's other levels of "well sdists just don't do that" which are probably ok
[20:48:46] <ErikRose> I meant to ask under what conditions setup.cfg gets the opportunity to override install_requires.
[20:50:40] <dstufft> to be specific, it doesn't always do it, if you don't have wheel installed it won't, and if bdist_wheel fails it will fall back to setup.py install, and people can disable it with --no-binary
[20:50:56] <ErikRose> hehe, never mind then. Thanks.
[20:54:01] <dstufft> the three (or four) reasonable options are generally A) Use environment markers in setuptools and eschew support for pip <6 and setuptools < 0.7 (or < newer if you need a newer feature) B) Do the old style conditional logic in setup.py and use the setup.cfg trick to get conditional in the wheel C) Hope that your conditions fall along a wheel platform line and don't share (e.g. py2 vs py3) D) Don't conditionally depend
[20:54:34] <dstufft> there's also the E) Don't support wheels at all, and make bdist_wheel explode. but that's not a very good one
[20:55:07] <ErikRose> Awesome. That breakdown is tremendously helpful.
[20:55:24] <ErikRose> I'll link you this comment when I'm done writing it; you may be amused.
[21:39:22] <ErikRose> dstufft: For your amusement: https://github.com/letsencrypt/letsencrypt/pull/2182#issuecomment-172099220