[02:03:46] <lifeless> tchaypo: because we don't use < or <= yet
[02:03:58] <lifeless> tchaypo: and even if we did, we wouldn't be saying <=2.7.9
[02:04:16] <lifeless> tchaypo: two-component comparisons won't be broken until 3.10 releases.
[02:59:15] <tchaypo> reading pkg_resources/__init__.py makes my head hurt.
[03:00:45] <tchaypo> if I’m reading it correctly there’s two ways we could tackle this (without a major rewrite); one is right at the top of the code that does the marker evaluation, the other is down in the guts of the code that does the comparisons
[03:02:45] <tchaypo> if we do the latter we need two implementations (one in markerlib, one in pkg_resources) and both implementations currently don’t care what kind of marker they’re comparing since it’s all just a string comparison - we’d need to add special handling for anything where the name of the thing being compared is _version
[03:04:05] <tchaypo> the former sounds easier for simple cases where we just have one python_version in the marker; but is more complicated when we have to handle “python_version … or python_version …”, especially since it’s possible for the marker to have parenthetical groupings and stuff as well.
[03:42:02] <dstufft> Not that I'm aware of, jaraco could speak to it better
[03:42:11] <dstufft> probably just that nobody did anything about it
[03:42:35] <dstufft> given a PEP though, I think it makes sense to put the marker impl into packaging, since you'll need packaging anyways to get PEP 440 versions
[03:48:09] <lifeless> dstufft: since there's already markerlib
[03:48:15] <lifeless> dstufft: why not justhave packaging dep on markerlib?
[03:48:53] <lifeless> dstufft: btw let me know how the heroku stuff goes
[03:56:31] <dstufft> lifeless: I'd rather not put dependencies in packaging if possible since it's designed to be bundled. Also markerlib is PEP 345 (aka before wheels and such) and hasn't had a commit or a release in > 2 years. The code itself is just over a 100 lines and afaik setuptools is the only thing that really uses it (and that bundles it). I don't think there's a lot of value to keep the lib seperate here
[03:59:36] <dstufft> lifeless: re: heroku, last I heard was me giving $$ details and the email address. Nothing since then other than an auto reply from one of the names that they are on vacation till monday, so I figure there's a good chance the other person is on vacation too.
[03:59:55] <dstufft> I've been refactoring warehouse to be ready to deploy onto heroku though
[04:00:08] <lifeless> dstufft: that was the followup to my poking right?
[04:01:19] <dstufft> lifeless: yea, you were CC'd in my last email on 6/29, the auto response was from uh.. Matt I think.
[04:09:03] <tchaypo> lifeless: one implementation “uses the ‘parser’ module which is not implemented on Jython and has been superseded by the 'ast' module in Python 2.6 and later."
[04:14:24] <tchaypo> that’s the non-markerlib version. If I’m reading https://bitbucket.org/pypa/setuptools/src/d0d95997b068d46699d00adca960008e2488f3d6/pkg_resources/__init__.py?at=default#cl-1541 correctly, the markerlib version is *only* used if ‘parser’ is not in globals()
[04:27:03] <tchaypo> also, I think anything we do is going to be using pkg_resources.parse_version() which aiui already implements PEP440; it seems weird to have pkg_resources call markerlib call pkg_resources
[04:27:11] <tchaypo> or we could reimplement the whole thing..
[04:42:30] <tchaypo> so in summary, it sounds like we want to pull out https://www.python.org/dev/peps/pep-0426/#environment-markers and use it as the basis for a new PEP; which will also contain an overview of how we’re going to replace the two current implementations (in pkg_resources and markerlib) with a single implementation (that doesn’t use parser, if we want to
[04:42:31] <tchaypo> support 2.6 and jython; or that doesn’t support 2.6 or jython if we want to use parser, since it seems to be the default and most-up-to-date implementation at present)
[04:47:03] <dstufft> tchaypo: parse_version is really just packaging.version.parse
[04:47:15] <dstufft> with a minor layer for compatability in pkg_resources
[04:47:19] <tchaypo> ie, not the thing we want to use
[04:47:48] <dstufft> we need to support both 2.6 and jython yes
[04:49:33] <dstufft> tbh the marker language is probably simpler enough to parse it with regex, but idc if it uses ast or whatever
[04:51:44] <tchaypo> *thinks* would we be talking about a complete replacement for markerlib, or would we only need to implement a subset of markerlib?
[04:53:44] <dstufft> it'd be a replacement for markerlib inside of packaging, but markerlib is only like 3 functions anyways
[04:57:14] <tchaypo> okay, markerlib implements the env marker spec from pep 345; what we’re talking about now is implementing the spec from pep440 (possibly pulled out to its own pep); so it seems like we need to at least heavily update markerlib
[04:59:37] <dstufft> PEP 426, but yea. Ideally what we'd do is split that out into it's own PEP that just defines the marker syntax without defning what it looks like in a whole requirement specifier (similarly to how PEP 440 defines >= without telling you how to specify _what_ project you want to install), then packaging would get a PR that implements markers as a Proof of Concept that will get worked on and merged when the PEP gets accepted.
[05:00:02] <dstufft> there's no backwards compatability requirements in that PR since it's a new lib, it's free to make the best choices
[05:00:25] <dstufft> I'm happy to help with it fwiw
[05:00:31] <dstufft> as someone whose done this a few times now :)
[05:10:27] <dstufft> API wise, I think something closer to RequirementSet or Version would be nice, a class that offers introspection of the marker to see individual pieces of it and such (much how RequirementSpecifier gives you access to the version part and the operator part) with the ablity to evaluate that class against the current environment, or override parts of the current environment
[05:10:45] <dstufft> hard part will be the fact that it supports grouping with AND and OR
[05:51:28] <tomprince> https://www.python.org/dev/peps/pep-0001/ is the upstream one.
[05:54:15] <tchaypo> https://hg.python.org/peps/ seems to be where they live
[05:56:41] <dstufft> hg.python.org/peps/ is the official location, most of the packaging ones live in interopatbility-peps while we're working on them and then we periodically copy them into the hg.p.o repo
[05:56:58] <dstufft> but you can work on it wherever you want and then submit them to hg.p.o periodically
[06:01:49] <tchaypo> I think it’s easier if I work on interoperability-peps forn ow
[06:01:58] <tchaypo> because I can submit a PR and we can comment there
[06:02:04] <tchaypo> rather than having to do emails and things
[06:06:03] <dstufft> tchaypo: works for me, do you want access to the repo or just want to submit PRs