PMXBOT Log file Viewer

Help | Karma | Search:

#pypa-dev logs for Sunday the 3rd of July, 2016

(Back to #pypa-dev overview) (Back to channel listing) (Animate logs)
[00:01:29] <controversial> Hello
[00:01:42] <controversial> Having some trouble figuring out Jinja2 :P
[00:04:24] <controversial> So I'm trying to fix #1347
[00:04:41] <controversial> Here: https://github.com/pypa/warehouse/blob/master/warehouse/templates/packaging/detail.html#L98 an `is_vaild_uri` function is used
[00:05:02] <controversial> I'm trying to use this within a `map` filter to separate out all the URLs that aren't valid URIs
[00:05:09] <controversial> But I can't seem to do it
[00:05:29] <controversial> I tried: `{% if release.urls.items()|map(is_valid_uri)|list|length > 0 %}`
[00:05:48] <controversial> But it doesn't let me use this kind of function from within a `map`
[00:05:52] <controversial> How can I do this
[00:06:01] <controversial> dstufft: Any ideas?
[00:15:43] <controversial> additionally, why is the `*` at https://github.com/pypa/warehouse/blob/master/warehouse/filters.py#L44 not invalid syntax?
[00:16:19] <controversial> pyflakes seems to think it is
[00:19:49] <controversial> Never mind, guess it's not. I didn't think you could use it without a name
[02:35:53] <controversial> Does anyone have any idea why this build fails? It appears to work correctly on my machine. Is there another place I should register new filters? https://travis-ci.org/pypa/warehouse/builds/141936643
[12:40:33] <controversial> Hello all
[13:05:31] <controversial> nlh: Can you check out my PR to close #1337 ?
[13:05:53] <apollo13> hihi nice issue number
[13:06:09] <controversial> apollo13: Lol
[13:06:41] <nlh> controversial: thanks for the PR. I have seen it, but I have a couple of other things on my plate today
[13:06:47] <nlh> I'll try to take a look tomorrow morning
[13:06:56] <controversial> Ok, thanks ;)
[13:07:42] <controversial> apollo13: Would you be able to help me figure out why the build for this is failing: https://github.com/pypa/warehouse/pull/1352
[13:08:20] <controversial> It says it couldn't find the filter `contains_valid_uri`, even though I explicitly defined and registered it. Everything works fine when I test it.
[13:08:47] <controversial> I've registered it everywhere filters are mentioned in config.py, but is there another place it needs to go?
[13:10:11] <apollo13> yeah, you need to register it in the test too
[13:10:20] <apollo13> https://travis-ci.org/pypa/warehouse/jobs/141993841#L772
[13:10:33] <apollo13> grep the tests for that function and then add your filter to https://travis-ci.org/pypa/warehouse/jobs/141993841#L787 ff
[13:12:52] <apollo13> it is in tests/functional/test_templates.py
[13:13:22] <controversial> Oh, ok
[13:13:26] <JosephBywater> Hi
[13:13:28] <controversial> col thanks
[13:13:31] <controversial> *cool
[13:17:31] <controversial> apollo13: Fixed, I think
[13:17:36] <controversial> tests are still running
[13:26:34] <controversial> apollo13: Tests fixed.
[13:27:10] <controversial> ugh I have to write tests too D:
[13:27:34] <apollo13> of course, what did you think :D
[13:41:26] <controversial> apollo13: Idk, I'm just lazy. I try for 100% test coverage most of the time, though
[13:41:42] <controversial> Meaning all my repos are either 100% covered or not covered at all :)
[13:48:23] <controversial> apollo13: All checks pass :D
[13:49:08] <apollo13> mhm, while the test works, I would change it
[13:49:40] <apollo13> the goal of the function is to determine that at least one url works, so I'd have two invalid ones and then one valid and one invalid one
[13:53:46] <controversial> Ok
[13:53:47] <controversial> sure
[13:54:52] <apollo13> also, since you are still nicely in the line limit I'd collapse most of pytest.mark.parametrize
[13:54:52] <controversial> apollo13: Added another test with one of each
[13:55:12] <apollo13> ah the rest of the tests uses the same style
[13:55:13] <apollo13> nevermind then
[13:55:28] <controversial> apollo13: I wasn't even aware of a line limit
[13:55:44] <controversial> I've only used `unittest` lol
[13:56:19] <apollo13> I was refering to pep8
[14:06:34] <controversial> oh
[14:06:42] <controversial> apollo13: Could you check it out now?
[14:08:40] <apollo13> did https://github.com/pypa/warehouse/pull/1352/files#diff-ff99cb2dacf4a025805334880095b350R221 go over the line limit or what was the reason for splitting it? aside from that looks good to me
[14:09:00] <controversial> Yeah, it did
[14:09:23] <apollo13> and not sure if the doc string https://github.com/controversial/warehouse/blob/fcbad4fe588b3e3afee7d39e7750d271d85e3620/warehouse/filters.py#L144 is okay, what does pep8 suggest on how to write them?
[14:09:53] <controversial> I was reading PEP 257, and it's kind of ambiguous
[14:10:26] <controversial> It has a special case forĀ "one-line docstrings" https://www.python.org/dev/peps/pep-0257/#one-line-docstrings
[14:10:36] <apollo13> ah right, yeah
[14:11:05] <controversial> But reading on later in the file, it seems like "one line docstrings" could refer either to simple single-sentence things or docstrings that literally occupy one line
[14:11:54] <controversial> It recommends putting the closing quotes on a new line if you've got a multi-line docstring, but if I move the closing quotes then my docstring _does_ fit on one line
[14:11:58] <controversial> apollo13: What do you think?
[14:12:36] <controversial> Never mind, I'm going to move the closing quotes to a new line
[14:14:29] <JosephBywater> Hi
[14:17:33] <controversial> Hi
[16:47:41] <berker> dstufft: shouldn't https://github.com/pypa/warehouse/blob/master/warehouse/views.py#L206 be ``return HTTPNotFound()`` as stated at https://warehouse.readthedocs.io/development/patterns/#returning-vs-raising-http-exceptions
[17:09:35] <dstufft> berker: yea, must have snuck in somewhere :)
[17:39:04] <controversial> dstufft: Can you check out my PRs? Would you like me to rebase with the latest changes or will you?
[17:42:01] <dstufft> controversial: as long as it merges cleanly you don't need to rebase
[17:42:07] <controversial> ok
[17:42:18] <controversial> I usually rebase to avoid conflict
[17:42:31] <dstufft> I'm going to be trying to review the outstanding PRs here today
[17:43:37] <controversial> ok, cool
[18:09:51] <JosephBywater> dstufft: How long is a page cached for?
[18:10:13] <dstufft> JosephBywater: depends on which page
[18:10:18] <JosephBywater> Because some pages I visited yesterday still haven't changed
[18:10:24] <JosephBywater> dstufft: Project pages
[18:10:52] <dstufft> https://github.com/pypa/warehouse/blob/master/warehouse/packaging/views.py#L58
[18:11:14] <JosephBywater> Ok
[18:11:14] <dstufft> 1 day it looks like, unless someone uploads that project in the meantime and causes it to do an immediate purge
[18:11:22] <JosephBywater> Makes sense
[18:11:32] <JosephBywater> I don't think it's been a day yet :)
[18:12:31] <dstufft> you can check the response headers and look for ``Age`` to see how old the response is that is being served
[18:12:37] <dstufft> (in seconds)
[18:12:42] <JosephBywater> Ok
[18:13:37] <dstufft> You can also purge a single URL immediately by doing curl -XPURGE https://pypi.io/wahtever/url/
[18:14:15] <JosephBywater> It has been cached for 23.005278 hours (82819 seconds)
[18:14:24] <JosephBywater> So that's why it hasn't changed :
[18:15:22] <JosephBywater> dstufft: Ok, I just did that and it's updated now
[18:37:28] <JosephBywater> dstufft: Upgrade `amqp` too? [Requires.io](https://requires.io/github/pypa/warehouse/requirements/?branch=master)
[18:38:07] <dstufft> JosephBywater: it's a bit of a bug, amqp shouldn't be upgraded yet, it's pulled in by celery's dep tree and celery pins it to <2
[18:38:17] <JosephBywater> ok
[18:38:31] <dstufft> normally add add a requires.io directive to pin it to <2, but that is broken with the --hash lines we use :/
[18:38:36] <dstufft> normally I would add*
[18:41:34] <controversial> Where do the logs for this channel actually appear?
[18:45:51] <JosephBywater> controversial: what?
[18:46:19] <controversial> There's messages about logging every time you log in
[18:46:57] <JosephBywater> Oh, yeah
[19:01:09] <berker> dstufft: should I make statuspage.url configurable by an env variable?
[19:01:46] <dstufft> berker: yea, that's the normal way of handling it, see like https://github.com/pypa/warehouse/blob/master/warehouse/config.py#L145
[19:02:19] <dstufft> maybe_set(settings, "statuspuage.url", "STATUSPAGE_URL") or so will set the value of the env var STATUSPAGE_URL to the setting "statuspage.url"
[19:12:20] <berker> dstufft: so I was on the right path (just stole from elasticsearch.url), thanks :)