PMXBOT Log file Viewer

Help | Karma | Search:

#pypa-dev logs for Tuesday the 5th of April, 2016

(Back to #pypa-dev overview) (Back to channel listing) (Animate logs)
[01:29:11] <StevenK> lifeless: Having trouble with 2.6 for setuptools :-(
[01:32:35] <StevenK> lifeless: http://paste.openstack.org/show/492940/
[02:01:44] <lifeless> StevenK: looking
[02:02:20] <lifeless> StevenK: my guess
[02:02:38] <lifeless> StevenK: something has done CStringIO.StringIO(u'somethinghere')
[02:03:00] <lifeless> StevenK: which takes the internal UCS-4 representation as the bytes
[02:04:35] <StevenK> (Pdb) p type(self.get_metadata(self.PKG_INFO))
[02:04:36] <StevenK> <type 'unicode'>
[02:05:34] <StevenK> So it doesn't look like cStringIO is involved
[02:06:35] <lifeless> StevenK: I don't see why you say that :)
[02:07:22] <lifeless> StevenK: anyhow, that was my guess
[02:08:30] <lifeless> StevenK: that said, I don't see any obviously wrong uses of StringIO/BytesIO via grep
[02:08:59] <StevenK> Ah ha. Pass unicode, and you get \x00's everywhere, put str() in, it's fine
[02:11:11] <lifeless> StevenK: it is exactly as I said
[02:11:12] <StevenK> with io.open(self.path, encoding='utf-8') as f:
[02:11:16] <lifeless> from cStringIO import StringIO
[02:11:21] <lifeless> StevenK: in email.parser
[02:11:33] <lifeless> StevenK: and then parsestr is
[02:11:38] <lifeless> return self.parse(StringIO(text), headersonly=headersonly)
[02:11:46] <StevenK> Yay
[02:11:59] <lifeless> StevenK: which is cStringIO.StringIO(text)
[02:12:03] <StevenK> lifeless: So I want nice things, how do I deal with this?
[02:12:06] <lifeless> and text is unicode
[02:12:41] <lifeless> StevenK: you encode it with an email appropriate coding so that its a bytestring
[02:13:06] <lifeless> StevenK: in either _get_metadata
[02:13:17] <lifeless> or _parsed_pkg_info
[02:16:45] <StevenK> lifeless: It comes from a Metadata class in the test, so I can fiddle
[02:17:08] <lifeless> oh, if its the test, yeah, just write it as a str
[02:18:20] <StevenK> I think the io.open line above will give me unicode no matter waht
[02:19:10] <lifeless> StevenK: yes, unless you tell it you want bytes
[02:19:16] <lifeless> StevenK: but what you actually want is native strings
[02:19:19] <lifeless> unicode on 3
[02:19:23] <lifeless> erm
[02:19:25] <lifeless> str on 3
[02:19:27] <lifeless> str on 2
[02:19:36] <lifeless> even though thasts unicode and bytes respectively
[02:20:20] <StevenK> Yeah, wrapping str() looks good
[02:20:31] <StevenK> Even though it just feels wrong
[02:32:00] <StevenK> lifeless: https://github.com/pypa/setuptools/pull/530 now passes everywhere, thanks
[02:40:02] <lifeless> StevenK: yw
[02:41:14] <StevenK> lifeless: If you want to glance over it at some point, that would be lovely
[02:44:09] <lifeless> am doing so
[02:45:01] <StevenK> lifeless: Oh, so email.parser on 2.7 does not use cStringIO?
[02:46:23] <lifeless> StevenK: it does, but cStringIO is less buggy
[02:47:19] <lifeless> StevenK: ok yeah, reviewed.
[03:01:48] <njs> awesomely terrible idea: package up cpython as a (not quite standard but whatever) wheel. write some sort of mashup of pip+venv where you can say "I want a venv with cpython 3.4 + this requirements.txt" and it just downloads and installs the whole thing (automagically picking the appropriate binaries for win/osx/linux etc.). run py2exe on this tool and distribute it as a standalone binary.
[03:29:51] <StevenK> lifeless: (Sorry, lunch) -- I decided to not union the extras since if a second requirement wants the same thing, it will be skipped at the top of the while loop because it's in the processed dict
[03:50:08] <lifeless> StevenK: yes, sometimes it would be skipped
[03:50:11] <lifeless> StevenK: but not always
[03:50:20] <lifeless> StevenK: a -> b, c[a]
[03:50:28] <lifeless> StevenK: b -> c[b]
[03:51:20] <lifeless> StevenK: my point here is that we're adding the ability to handle references to extras [it was silently ignored before I suspect]
[03:51:29] <lifeless> StevenK: so we should probably do it right
[03:52:10] <StevenK> lifeless: Do we want a testcase as well?
[03:52:32] <lifeless> StevenK: I suspect so yes
[03:53:00] <lifeless> StevenK: we probably also need to make sure that the loop handles c[a] being processed before c[b] is encountered
[03:53:05] <lifeless> StevenK: to handle it properly
[03:53:15] <StevenK> So two testcases?
[03:54:22] <lifeless> StevenK: or one pathological one
[03:54:48] <lifeless> a -> c[a]
[03:54:51] <lifeless> c[a] -> b
[03:54:55] <lifeless> b -> c[b]
[03:55:02] <lifeless> c[b] -> foo
[03:56:44] <lifeless> that has to work through c twice, but its not an infinite loop
[04:01:29] <StevenK> lifeless: Just because it's a novel: http://paste.openstack.org/show/492943/
[04:10:47] <lifeless> StevenK: c[a] isn't a dependency, the result should be a,b,c, foo
[04:11:22] <lifeless> sorry, c[a] isn't a distribution. The distributions are a,b,c,foo
[04:13:38] <StevenK> Right
[04:13:41] <StevenK> Duh
[04:15:12] <lifeless> StevenK: that said, tracking c[a] as the 'ting we've processed' is probably a good idea
[04:46:29] <StevenK> lifeless: We track the literal requirement string it appears, so we do
[05:02:32] <StevenK> Actually, to test the union we need a loop on b
[05:21:31] <lifeless> StevenK: oh?
[05:23:10] <StevenK> lifeless: The key in extra_req_mapping is the requirement, so to make sure we can deal with two things, shouldn't it turn up twice in the dep tree?
[05:24:16] <lifeless> StevenK: c[a] and c[b]
[05:24:33] <lifeless> StevenK: key is c, isn't it ?
[05:25:11] <StevenK> Nope, the key is whatever c[a] or c[b] depend on
[05:33:50] <lifeless> a depends on c[a]
[05:33:54] <lifeless> what is the key?
[05:34:28] <StevenK> a
[05:36:52] <StevenK> In fact, I'm wrong
[05:36:54] <StevenK> (Pdb) p extra_req_mapping
[05:36:54] <StevenK> defaultdict(<type 'set'>, {Requirement.parse('c[a]'): set([])})
[05:37:53] <StevenK> That's a depends on c[a]
[06:31:57] <lifeless> StevenK: so, get the test written, see what happens
[06:32:01] <lifeless> StevenK: it might just work, who knows
[06:32:24] <StevenK> I have, I'm trying to work out why it can't find foo
[06:52:52] <StevenK> GAH
[06:52:58] <StevenK> dist.info vs dist-info
[07:01:11] <StevenK> lifeless: New rev pushed, the new test added passes fine
[07:26:18] <lifeless> StevenK: +100
[08:17:21] <ronny> hi