[22:01:46] <cooperlees> Peoples - TemptorSent is making a plugin for bandersnatch thet allows people to use metadata from the JSON API arbitrarily filter what bandersnatch pulls down
[22:03:10] <techalchemy> cooperlees, can you say more?
[22:03:54] <techalchemy> like you can just say specific things about markers and specifiers?
[22:04:40] <techalchemy> TemptorSent, for specifiersets, if you only want to talk about them I'm happy to chat ;) if you want to change how they work you'll need pradyun or donald (so probably pradyun)
[22:04:54] <techalchemy> but I think it's like 5am where he is
[22:08:10] <cooperlees> pradyunsg needs to be MORE dedicated
[22:08:32] <cooperlees> techalchemy: I think he is after more how they work yes
[22:09:06] <techalchemy> i can talk about how they work, i've worked with them quite a bit
[22:16:32] <TemptorSent> Hi techalchemy, what I'm specifically trying to accomplish is calculate the intersection of two SpecifierSets
[22:22:13] <techalchemy> TemptorSent, when you say 'intersection' do you mean the overlapping versions in two different ranges?
[22:23:09] <techalchemy> or do you actually mean the intersection of the specifiersets i.e. the specifiers that are the same between the two sets
[22:23:51] <TemptorSent> techalchemy: Not just ranges, full SpecifierSets, including the annoying ~= and ===, along with == and !=, all anded.
[22:25:36] <techalchemy> 'not just ranges' as in the first of the two things I described, and additionally you would like to do more?
[22:25:48] <TemptorSent> So given two SpecifierSets, return a SpecifierSet that represents the logical intersection of those two sets.
[22:26:31] <techalchemy> if I have a specifierset: ">2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*", and another specifierset: ">2.7", the intersection of these is ">2.7"
[22:28:14] <TemptorSent> Consider [">=2.7", "!=3.5.*", "<3.8"] intersect [ "<=3.7" ] for a simple case, the intersection would be [ ">=2.7", "!=3.5.*", "<=3.7" ]
[22:28:22] <techalchemy> if I have a specifierset: ">=2.7,<3.8" and another specifierset ">=2.7" the intersection is ">=2.7". calculating that is pretty easy with specifiersets
[22:29:09] <techalchemy> > Consider [">=2.7", "!=3.5.*", "<3.8"] intersect [ "<=3.7" ] -- have you done this in python? I think you are using the wrong terminology here so I dont want to dwell on it too long
[22:29:48] <TemptorSent> No, I'm really not a pythoner at all TBH :)
[22:30:34] <techalchemy> TemptorSent, in set math, an intersection identifies elements that are the same in two different sets
[22:30:44] <TemptorSent> I'm talking about matematically creating intervals from SpecifierSets, determining the overlapping intervals, including whether the endpoints are open or closed, and representing the result as a SpecifierSet.
[22:31:53] <TemptorSent> Yes, if we treat specifiers as strings, that's true -- I'm trying to treat them as tuples representing bounding conditions and discontinuities.
[22:32:11] <TemptorSent> Semantically, in other words.
[22:32:14] <techalchemy> well an intersection is an intersection no matter what, but specifiers _are_ just strings
[22:32:40] <TemptorSent> Think in terms of a version tree or even simple number line.
[22:33:01] <techalchemy> like, they have some notion of whether something is contained within their bounds, but not a notion of every member of their range
[22:33:12] <TemptorSent> Each specifier is adding a constraint to the values that match .contains
[22:34:11] <techalchemy> that's why I asked the initial clarifying question, "do you mean the overlapping versions in two different ranges?"
[22:34:41] <TemptorSent> It's easy enough to handle the simple cases by sorting on version, but it gets much more "entertaining" when you have something like ["!=1.2.*" ] intersect ["==1"]
[22:35:02] <techalchemy> that one is nonsensical but yes
[22:35:37] <TemptorSent> Not necessarily, it could be that it requires version 1.x, but 1.2.x had a known bug tha was fixed later and didn't exist before.
[22:36:03] <techalchemy> well you're now talking about a different issue, which is how required python versions are specified in metadata
[22:36:40] <techalchemy> and single digit python version identifiers should be treated as ranges
[22:37:10] <TemptorSent> And what I meant by not simply two overlapping ranges is the fact that SpecifierSets can represent multiple ranges interrupted by discontinuities, which tend to cause most of the problems in implementation.
[22:38:56] <TemptorSent> So I was trying to avoid using ugly brute force methods, but I couldn't find any means of sorting *Specifiers* with respect to each other, which leads to a lot of code to do something that should be trivial :)
[22:39:37] <TemptorSent> Or at least sorting versions based on specificity
[22:40:32] <techalchemy> That's the chain of calls I use starting from markers which might contain `python_version` keys
[22:41:21] <techalchemy> TemptorSent, possibly you can start at https://github.com/sarugaku/requirementslib/blob/master/src/requirementslib/models/markers.py#L306
[22:42:03] <TemptorSent> Where is the sorting for the operator found?
[22:43:20] <TemptorSent> I mean where is the ordering of the operators defined?
[22:44:29] <techalchemy> the ordering of the operators? how do you mean?
[22:44:30] <TemptorSent> So you get >, >=, ~=, ==, ===, !=, <=, <
[22:45:03] <TemptorSent> So that they actually sort in the order of their bounding
[22:46:16] <techalchemy> oh I had the added concern of the fact that I generate these during dependency resolution and people use the result in their lockfiles, so I have to reduce needless churn
[22:46:49] <techalchemy> so I made some static decisions about how to handle >= > <= <
[22:56:24] <techalchemy> what inspired this project ? :)
[22:57:09] <TemptorSent> Dealing with orphaned code written for specilized applications for the indefinite future.
[22:57:38] <TemptorSent> ...meaning I need to be able to mirror all the related packages and keep track of them.
[22:59:41] <TemptorSent> ...given what I'm using it for, I'm tempted to just let the user provide a list of one or two digit python versions to check against in reverse
[23:00:08] <TemptorSent> I'm getting FAR deeper in the weeds than I had ever intended :)
[23:01:24] <techalchemy> all of pypi is like several TB
[23:02:14] <TemptorSent> Yeah, much smaller if I'm just grabbing py2 stuff, especially sdists :)
[23:02:33] <techalchemy> you can always just find out what specific things they need and assume you can just grab whatevers out there
[23:03:00] <TemptorSent> At the rate things are disappearing for py2, that's not a great option.
[23:03:17] <techalchemy> well everything that was on pypi before still is on pypi
[23:04:08] <TemptorSent> I don't have a list of what I need to support up front, it's entirely possible something comes up in 5 years that needs me do dig up some 10 year old thesis to process.
[23:04:27] <TemptorSent> techalchemy: Are you sure about that? I get a lot of stuff coming back with 404s.
[23:05:01] <techalchemy> TemptorSent, got any examples?
[23:05:24] <TemptorSent> Just running bandersnatch
[23:06:47] <techalchemy> if you grab an example url try hitting it yourself
[23:09:02] <TemptorSent> Yeah, next time I run it for a while I'll catch a log
[23:12:05] <toad_polo> People could be removing it actively, though that seems unlikely to be a significant fraction of packages doing that.
[23:12:27] <techalchemy> toad_polo, there were 23 cdn failures ~30 mins ago
[23:13:06] <techalchemy> and another ~22 about 14 mins before that
[23:14:35] <techalchemy> toad_polo, did everyone agree on a date/time for packaging related discussions / hatchery event and/or should i comment on one of the threads on the subject, I struggle very hard to keep up with discourse
[23:24:31] <toad_polo> techalchemy: Whatever day the education summit is.
[23:25:02] <techalchemy> toad_polo, ok, likely the day before the conference then? I may need to update my travel request
[23:25:15] <toad_polo> We'll do it at Google if PyCon can't accommodate.
[23:25:30] <toad_polo> Yeah, day before the conference proper.
[23:25:41] <techalchemy> awesome, in bakery square?
[23:27:06] <techalchemy> I'm sure there will be room anyway, thanks for the info