PMXBOT Log file Viewer

Help | Karma | Search:

#pypa logs for Wednesday the 26th of March, 2014

(Back to #pypa overview) (Back to channel listing) (Animate logs)
[00:12:40] <wsanchez_> I wanna put mysql-connector-python==1.0.10 into a requirements file, but that results in:
[00:12:41] <wsanchez_> Some externally hosted files were ignored (use --allow-external mysql-connector-python to allow).
[00:12:41] <wsanchez_> Which is OK, but if I stick —allow-external into the file, I get an exception. Pilot error?
[00:26:37] <dstufft> wsanchez_: --allow-external mysql-connector-python
[00:27:21] <dstufft> https://gist.github.com/dstufft/f9e0b7a0183ac13ec77e
[00:27:34] <dstufft> pretend django-celery says mysql-connector-python
[00:36:25] <wsanchez_> That raises for me:
[00:36:25] <wsanchez_> Traceback (most recent call last):
[00:36:25] <wsanchez_> File "<stdin>", line 2, in <module>
[00:36:27] <wsanchez_> File "setup.py", line 99, in <module>
[00:36:29] <wsanchez_> install_requirements = read_requirements("py_base.txt")
[00:36:31] <wsanchez_> File "setup.py", line 93, in read_requirements
[00:36:33] <wsanchez_> parse_requirements(joinpath(requirements_dir, reqs_filename))
[00:36:35] <wsanchez_> File "/Users/wsanchez/Developer/IMS/Server/.develop/roots/py_modules/lib/python2.7/site-packages/pip/req.py", line 1605, in parse_requirements
[00:36:37] <wsanchez_> finder.allow_external |= set([normalize_name(line).lower()])
[00:36:39] <wsanchez_> AttributeError: 'NoneType' object has no attribute 'allow_external'
[00:36:56] <wsanchez_> lemme push my code up.
[00:37:51] <dstufft> are you using pip as an API
[00:38:20] <wsanchez_> …yes
[00:38:53] <dstufft> you probably need to construct a finder instancce and pass it into that function
[00:40:06] <wsanchez_> raise happens here: https://github.com/burningmantech/ranger-ims/blob/master/Server/setup.py#L93
[00:42:59] <wsanchez_> Why I'm doing this is less obvious in this project, but in others the idea is that there is a directory of requirements files. One for base (always needed) requirements, one for stuff you need while developing, and then optionally one each for optional requirements associated with optional features.
[00:45:40] <dstufft> any reason you don't just declare these in your setup.py with extras
[00:46:56] <wsanchez_> Because that's code, and it seems cleaner to just have some text files. Here's a better example: http://trac.calendarserver.org/browser/CalendarServer/trunk/requirements
[00:51:02] <dstufft> wsanchez_: some text files that you read by callng an undocmented private method of pip inside of code vs some static dictionaries in a .py file? ;)
[00:51:11] <dstufft> also https://caremad.io/blog/setup-vs-requirement/
[00:51:36] <wsanchez_> pip.req.parse_requirements is private?
[00:51:53] <wsanchez_> Or is all of pip's API private?
[00:52:50] <wsanchez_> Trying to remember how I found out about that function
[00:53:02] <dstufft> we techincally don't support being used as an API yea, I mean we try not to break it and what not
[00:53:12] <dstufft> but for instance, in 1.6 that function moves
[00:53:25] <dstufft> to pip.req.req_file.parse_requirements
[00:53:40] <wsanchez_> Ah, probably StackOverflow, eg: http://stackoverflow.com/questions/14399534/how-can-i-reference-requirements-txt-for-the-install-requires-kwarg-in-setuptool
[00:54:35] <dstufft> probably people are going to have some breakage
[00:54:38] <dstufft> if they were doing that
[00:54:47] <wsanchez_> ok so you're saying I'm off in the weeds so I should'a packed a machete.
[00:55:15] <dstufft> yea more or less
[00:55:25] <wsanchez_> fair enough
[00:58:39] <dstufft> wsanchez_: the correct answer to not duplicate stuff is to use "." or "-e ." in the requirements.txt
[00:58:41] <dstufft> fwiw
[00:58:47] <dstufft> you can also specify extras with that
[00:59:16] <wsanchez_> hrm.
[00:59:22] <wsanchez_> …reading that blog post
[01:00:05] <dstufft> I'm not super good at words
[01:00:13] <wsanchez_> :-)
[01:00:51] <dstufft> if you're familar with ruby and bundler at all yehuda katz has a similar post which inspired my post (linked at the bottom) which may be eaier to understand too
[01:01:36] <wsanchez_> I started to read a Ruby book a long time ago and saw something about the syntax for strings that made me close the book and move on.
[01:02:13] <dstufft> haha
[01:02:16] <dstufft> I know that feel
[01:03:12] <dstufft> the primary take away is that setup.py lists symbolic names that don't specify where to get stuff from, and requirements.txt has a "location to get stuff from" (defualting to PyPI) which when pared with that symbolic name gives you an "aboslute" name
[01:06:37] <Alex_Gaynor> dstufft: in practice isn't the distinction bullshit because setuptools will happilly make up a place to get some stuff from?
[01:08:47] <wsanchez_> It does seem like there's still unnecessary duplication. At a minimum it's too easy for information in setup.py and requirements files to get out of sync and for one not to notice.
[01:10:07] <dstufft> Alex_Gaynor: well setuptools is bad yes
[01:10:14] <dstufft> wsanchez_: you don't have to list things in your requirements file
[01:10:28] <dstufft> https://github.com/dstufft/warehouse/blob/master/requirements.txt#L1-L2
[01:10:35] <dstufft> ^ installs all of WArehouse's dependencies
[01:10:38] <dstufft> without duplicating them
[01:10:56] <wsanchez_> hrm
[01:11:08] <dstufft> you can also do like
[01:11:09] <dstufft> -e .[test]
[01:11:14] <dstufft> to install a "test" extra too
[01:11:32] <dstufft> less moving parts at install time this way
[01:11:43] <dstufft> afk for dinner
[01:33:26] <wsanchez_> dstufft: Thanks for the info. I posted on http://stackoverflow.com/questions/14399534/ that using the API may not be a great idea and will rethink my use of requirements.txt. Also off to dinner; laters.
[01:44:48] <Ivo> dstufft: do we actually mention anywhere that pip is explicitly not considered a library?
[01:44:57] <Ivo> (or should be)
[02:07:45] <dstufft> Ivo: dunno
[02:07:53] <dstufft> Ivo: we certainly don't document the API at all
[02:08:23] <Ivo> seems like a murphy's law
[02:08:41] <Ivo> could they have done so?
[02:08:46] <Ivo> yes, they have.
[11:04:06] <ronny> how do i teach pip self-signed ssl certs?
[11:09:31] <dstufft> ronny: --cert on the CLI
[11:09:36] <dstufft> or PIP_CERT env var
[11:09:43] <dstufft> or cert in the ~/.pip/pip.conf
[11:12:18] <ronny> ah, i had a old version
[11:12:42] <ronny> dstufft: btw, how do i stop pip install --download from asking for every single file?
[11:13:02] <dstufft> asking?
[11:13:08] <dstufft> what's it asking
[11:13:20] <ronny> if it should wipe/overwrite/keep
[11:14:20] <ronny> oO
[11:14:23] <ronny> wait a moment
[11:14:25] <ronny> fml
[11:15:02] <jezdez> --exists-action (s)witch, (i)gnore, (w)ipe, (b)ackup
[11:15:29] <ronny> i was on pip 1.1 again, forgot to update after a recreation of the virtualenv
[11:15:52] <Ivo> y u no update virtualenv
[11:16:05] <ronny> say hello debian
[11:16:22] <Ivo> sudo pip install pip setuptools virtualenv
[11:16:28] <Ivo> **** the system
[11:16:35] <Ivo> *add a -U in there
[11:16:35] <ronny> nope
[11:16:52] <dstufft> ronny: FWIW you don't have to install virtualenv to use it
[11:17:30] <dstufft> if you'd rather use a newer version without installing it :) or manually upgrade, it's up to you doesn't matter to me :)
[11:18:44] <ronny> just no system install
[11:19:12] <dstufft> you might also like pip install --user virtualenv
[11:19:42] <ronny> btw, does pip --cert completely replace the used certs, or does it add to the certs to check against?
[11:20:00] <dstufft> replaces
[11:20:29] <ronny> so id have to make a whole bundle for my company?
[11:20:35] <ronny> is there a howto for doing that?
[11:21:01] <ronny> (we have servers with self-signed certs)
[11:21:11] <Ivo> 'whole bundle'? you just use your company's CA
[11:22:37] <dstufft> ronny: CA bundles are just concated files
[11:23:12] <dstufft> https://github.com/kennethreitz/requests/blob/master/requests/cacert.pem
[11:41:25] <ronny> k
[11:41:32] <Ivo> dstufft: how do you find out whats wrong with pypi rst... :/
[11:42:16] <Ivo> python setup.py check -smr works just fine
[11:42:21] <Ivo> https://pypi.python.org/pypi/pipa
[11:42:30] <dstufft> Ivo: fuck around with https://bitbucket.org/pypa/pypi/src/ec1282bfe85c12c93005ca7271f56c9df5c9445e/description_utils.py?at=default#cl-102 until you figure it out
[11:46:20] <mgedmin> Ivo, pip install restview; restview --long-description [--strict]
[11:47:57] <Ivo> omfg cannot wait for cryptography 0.3
[11:48:49] <Ivo> "quickly install package"... uses pyopenssl... takes 13mb >_<
[11:51:22] <mgedmin> Ivo, actually restview --long-description is unhappy because pypa's setup.py refuses to run under python2, but restview -e 'python3 setup.py --long-description' --strict works
[11:51:27] <mgedmin> and emits this error message: <string>:65: (INFO/1) Hyperlink target "pip.conf" is not referenced.
[11:51:34] <mgedmin> HTH
[11:56:40] <Ivo> godamn i hate rst links
[11:56:59] <Ivo> they suck so much compared to markdown >_<
[11:58:18] <Ivo> mgedmin: thankyou
[11:59:01] <dstufft> someday pypi will support Md
[11:59:22] <Ivo> tektnoic submitted a patch for that
[11:59:35] <dstufft> yea
[12:00:09] <dstufft> It's not how it'll work long term, it's relies on the MD being unrenderable, which not all MD is, some of it just renders terribly wrong
[12:00:15] <Ivo> ronny: if you're interested, i made a simple local pypi server made to do pip --cert correctly, if you would like to 'see how it works' https://pypi.python.org/pypi/pipa
[12:00:28] <dstufft> plus it makes it pretty annoying if you want to add a third markup type
[12:00:45] <dstufft> long term the metadata will support different markup types
[12:01:03] <ronny> Ivo: we have a devpi behind https
[12:01:06] <Ivo> pfmoore: man, you gotta step away from the argument and just ask for actual working code branches :)
[12:01:16] <dstufft> oh hey pfmoore is here!?
[12:01:33] <Ivo> yah he has been running an irc client sometimes lately
[12:01:36] <Ivo> it seems
[12:01:45] <ronny> btw, is there a reason why pip refuses subsubdomains on a subdomain wildcard
[12:02:05] <ronny> wilcard is *.domain.com, servername is name.expossedvia.domain.com
[12:02:11] <mgedmin> browsers refuse them too, don't they?
[12:02:15] <dstufft> they should
[12:02:23] <dstufft> the RFC states that a * is only good for a single segment
[12:02:24] <ronny> firefox allows a exception
[12:03:02] <dstufft> probably we could add an option to not check, but it'd disable SSL alltogether
[12:03:08] <dstufft> Theuni2: ping ;)
[12:03:25] <ronny> hi Theuni2
[12:58:39] <Theuni2> yo!
[12:59:12] <Theuni2> dstufft: see our somewhat long issue last week when the fastly issue escalated o_O
[12:59:34] <dstufft> Theuni2: I see that! I'm glad y'all got it fixed :]
[12:59:45] <dstufft> apparently sending data around some tubes is kind of hard
[13:04:28] <Theuni2> especially when people f*$#& with the standards
[15:23:20] <pfmoore> dstufft: Ivo: I'm running an offline client (irccloud) so I just look like I'm here ;-) But yeah, Ivo, you're right re working code.
[15:38:20] <Ivo> Theuni2: life wouldn't be interesting if people didn't fuck with the standards
[15:39:13] <Theuni2> life would be much more interesting if people fucked people instead.
[15:40:40] <Ivo> I'm not sure we're ever satisfied with how many things we've fucked
[15:40:55] <Theuni2> no one ever is
[15:41:12] <Ivo> #justhumanthings
[17:24:28] <DanielHolth> What was that talk about cross-compiling using distutils? Is that a thing?
[17:25:06] <dstufft> kind of
[23:17:32] <nZac_> Question about local git repositories as Python packages. I am testing a Sphinx theme in directory X with project Y's documentation. I `pip install -e X` to install the theme in project Y. However if I make changes (git commit) to the theme how can I update project Y's copy? pip install --upgrade -e ../path/to/package/repo doesn't work, Would pip install --upgrade -e theme-name doesn't work.
[23:20:08] <pfmoore> nZac_: pip install -e should make project Y refer directly to X, not use a copy. So you shouldn't need to do anything, just make the changes in X and Y will see them immediately.
[23:20:36] <nZac_> pfmoore: thanks for the response. I am not seeing those changes.
[23:21:05] <nZac_> Can you think of anyplace I could have messed it up?
[23:21:28] <pfmoore> hmm, that's odd - but you refer to themes rather than Python files, so maybe there's something different going on. Sorry, I'm not sure what that could be
[23:21:54] <pfmoore> I don't know anything about how Sphinx organises themes, I'm afraid...
[23:22:43] <nZac_> Well, at least I know I am installing it correctly with -e for editable.
[23:23:16] <tomprince> Do you have sphinx installed in the virtualenv?
[23:25:30] <tomprince> ^--- nZac_
[23:25:36] <nZac_> tomprince: sure do
[23:26:29] <nZac_> I think I just figured it out... pfmoore was right it was something totally unrelated. I had to make clean and the make html to pull in the changes
[23:26:32] <tomprince> I'd be tempted to add some prints to conf.py to print out where sphinx is actully loading things from. So 'import sphinx_theme; print sphinx_theme.__file__' et al.
[23:27:21] <nZac_> -e appeared to be the correct action, I was just not completing all the proper steps. Thanks for the help tomprince ad pfmoore!
[23:56:14] <unstable> I have a package pyxmlsec in my requirements.txt, though it's failing on ...
[23:56:15] <unstable> Downloading/unpacking pyxmlsec Could not find any downloads that satisfy the requirement pyxmlsec Some externally hosted files were ignored (use --allow-external pyxmlsec to allow).