PMXBOT Log file Viewer

Help | Karma | Search:

#pypa-dev logs for Friday the 3rd of July, 2015

(Back to #pypa-dev overview) (Back to channel listing) (Animate logs)
[00:23:06] <tchaypo> so
[00:30:30] <tchaypo> nakato and i are in a room today
[00:30:52] <tchaypo> it seems like the PEP440-for-version-markers stuff is urgentish
[00:54:44] <tchaypo> i do love simple bugs with precise reproduction instructions and a clear description of the problem
[00:59:11] <Nakato> lifeless: Makes since, I'll take a look at that
[01:00:19] <lifeless> tchaypo: PEP-440-for-version-markers? Oh the python 10 thing?
[01:00:31] <lifeless> tchaypo: I think its important in the ecosystem. OpenStack isn't directly affected.
[01:00:40] <lifeless> tchaypo: If you've got cycles, I think its a good thing to do
[01:01:14] <tchaypo> https://github.com/pypa/pip/issues/2943
[01:01:46] <tchaypo> why isn’t openstack directly affected?
[01:08:26] <tchaypo> Nakato: https://mail.python.org/pipermail/distutils-sig/2015-July/026554.html
[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:04:20] <tchaypo> s/former/latter/
[03:04:36] <tchaypo> I think the former is what we want to do.
[03:33:36] <dstufft> I think we probably need a PEP for that.
[03:33:56] <dstufft> if we split out the markers into their own PEP, we can just add a whole marker implementation into packaging
[03:40:38] <lifeless> dstufft: isn't that what markerlib is?
[03:40:56] <lifeless> Phrasing it differently, why does pkg_resources have a separate implementation at all at the moment ?
[03:41:30] <dstufft> hysterical raisens
[03:41:38] <lifeless> right, but its making it hard to fix the bug
[03:41:43] <lifeless> is there an ongoing reason?
[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:49:13] <lifeless> 3.1.5.
[03:49:15] <lifeless> REALLY?
[03:49:39] <lifeless> I've got this one :)
[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:57:12] <lifeless> ok
[03:57:15] <lifeless> fair enough
[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:01:37] <lifeless> kk
[04:01:43] <lifeless> let me know if I need to poke some more
[04:01:54] <lifeless> mdz was on leave for a while, I think irrelevant here.
[04:02:07] <dstufft> will do, with it being all holiday and stuff I figure I won't start wondering till end of next week or so
[04:02:54] <lifeless> oh right, sure.
[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:01:37] <lifeless> 2.6, jython, pypy, fepy
[05:01:46] <lifeless> upy too I suspect soon
[05:02:22] <lifeless> tchaypo: there's a PEP-writing PEP btw
[05:02:26] <lifeless> you should read that too bootstrap
[05:02:35] <dstufft> I'm not sure if it can use AST actually, since if we're using PEP 440 specifiers we have ~= and === too
[05:02:41] <dstufft> though I don't know the ast module very well
[05:04:54] <lifeless> it won't be able to if we go for PEP-440
[05:05:00] <lifeless> but thats what the new PEP discussion is about
[05:07:04] <dstufft> yea
[05:07:15] <dstufft> there's a repo in pypa that we have PEPs in
[05:07:27] <dstufft> I can add you to it if you want to work on one, or you can do it yourself in your own locations
[05:07:32] <dstufft> up to you
[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:11:34] <tchaypo> … fepy?
[05:12:00] <dstufft> IronPython I assume
[05:12:48] <tchaypo> apparently.
[05:13:27] <tchaypo> okay, I’m going to go away and percolate for a bit and then come back to this.
[05:35:57] <lifeless> dstufft: reminds me
[05:36:16] <lifeless> dstufft: we have a request that RequirementSet __str__ show in the order a human might write it
[05:36:36] <lifeless> dstufft: e.g. >, >= != <= <
[05:36:58] <dstufft> what's it do now? Probably whatever order it was added in
[05:37:02] <lifeless> dstufft: are there any backward compat implications around changing __str__ ?
[05:37:09] <lifeless> dstufft: no, <, !=, >
[05:37:22] <lifeless> so it reversed everything in all of openstack when I started round tripping
[05:37:44] <dstufft> the only implications is that RequirementSet(str(RequirementSet(...)) should be equivilant
[05:37:48] <dstufft> order isn't important
[05:38:02] <dstufft> I probably just picked whatever ordering was easiest at the time
[05:38:06] <dstufft> to make it stable
[05:50:21] <tchaypo> hrm. okay, so where is the repo of peps?
[05:50:30] <tchaypo> I bet that’s documented in the pep pep
[05:50:53] <tchaypo> sadly googling for “pep pep” doens’t help me ;)
[05:50:56] <tomprince> uhttps://github.com/pypa/interoperability-peps
[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
[06:06:37] <tchaypo> PRs fine for now
[06:08:14] <dstufft> ok
[06:53:26] <tchaypo> dstufft: but if you could, a number might be handy.
[06:55:30] <tchaypo> for now I’m going to use 495
[07:34:48] <tomprince> tchaypo: XXX ?
[07:35:20] <tchaypo> I see that that’s what PEP12 tells me to use :)
[08:00:24] <tchaypo> okay, https://github.com/pypa/interoperability-peps/pull/29