PMXBOT Log file Viewer

Help | Karma | Search:

#pypa logs for Wednesday the 16th of December, 2015

(Back to #pypa overview) (Back to channel listing) (Animate logs)
[15:16:55] <Noldorin> The directory '/Users/alex/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
[15:16:58] <Noldorin> this error message is incorrect
[15:18:30] <Noldorin> I've set up sudoers so that the -H option is unnecessary
[15:18:34] <Noldorin> yet silly pip still complains
[15:19:54] <Wooble> "you may want". It's not trying to figure out if you do want it, it's just a hardcoded piece of advice. :P
[15:24:44] <Noldorin> Wooble, but it's not quite, because if I explicitly pass -H, it goes away
[15:24:49] <Noldorin> and the result is no diff I believe
[15:28:36] <Wooble> Noldorin: your really should run pip as root anyway.
[15:28:42] <Wooble> shouldn't*
[15:28:48] <Noldorin> well I disagree
[15:28:49] <Noldorin> :)
[15:29:05] <Noldorin> for global packages I want it as root
[15:36:25] <Noldorin> Wooble, I mean, pip does have global packages, doesn't it?
[15:39:44] <Wooble> Running arbitrary code from the internet isn't a great idea. I'd suggest using your OS's package manager to install for the system python, and to have any other pythons you want to update globally not be owned by root in the first place. YMMV.
[15:40:02] <Wooble> (err.. insert "as root" in that first sentence)
[18:35:33] <ionelmc> does anyone actually use this https://pypi.python.org/pypi/setuptools_cython ?
[18:35:49] <ionelmc> i'm perplexed about that thing with the __dict__
[18:42:35] <ngoldbaum> i use a project that does something similar to monkeypatch numpy.distutils :(
[18:42:49] <ngoldbaum> just using cythonize() is more straightforward IMO
[18:42:58] <ionelmc> ngoldbaum: this looks quite straightforward http://pythonhosted.org/setuptools/history.html?highlight=cython#id20
[18:43:12] <ionelmc> lets see how it works
[18:46:50] <ionelmc> what's a nice cython codebase i can learn from?
[18:47:47] <ionelmc> hmm maybe https://github.com/pytoolz/cytoolz ?
[18:47:50] <ngoldbaum> scikit-image uses a ton of cython
[18:53:35] <ionelmc> allright thanks
[19:02:41] <ionelmc> damn, cython produces some incredibly ugly C code
[19:02:48] <ionelmc> is there anything better?
[19:03:04] <dstufft> why are you writing C code
[19:03:19] <ionelmc> optimization for a hot function
[19:04:04] <ionelmc> i want to have it in C but i'm not fond of doing all the C bookkeeping crap
[19:04:16] <dstufft> Ah, I don't think CFFI is super great for that particular use case :/
[19:04:28] <dstufft> PyPy and skipping C works sometimes though :D
[19:05:24] <ngoldbaum> ionelmc: it takes some work to massage cython's C code into something a little less awful
[19:05:36] <ngoldbaum> there are a lot of compiler options that need to be set for it not to generate very inefficient code
[19:05:50] <ionelmc> i just want to understand what the hell it generated :)
[19:06:07] <ionelmc> gha... ngoldbaum: options? any pointers?
[19:06:11] <ngoldbaum> https://bitbucket.org/ngoldbaum/galaxy_analysis/src/b29203acdb4c3670d6eae0643bbbc8850f01acac/galanyl/cython_extensions/scale_height.pyx?at=default&fileviewer=file-view-default
[19:06:21] <ngoldbaum> e.g. boundscheck, wraparound, cdivision in that file
[19:06:51] <ngoldbaum> you can also do "cython -a somefile.pyx" to get an .html file you can view in a web browser to see where the generated C code will be slow
[19:06:55] <ionelmc> my code aint particularly number heavy
[19:07:08] <ionelmc> it just does lots of function calls and checks on objects
[19:07:30] <ngoldbaum> compiler options are documented here:
[19:07:31] <ngoldbaum> http://docs.cython.org/src/reference/compilation.html#compiler-directives
[19:07:43] <ngoldbaum> but i always look at the cython -a output when writing new cython code
[19:07:45] <ionelmc> thanks
[19:07:58] <ngoldbaum> the ipython notebook extension for cython code supports annotated output inline in the notebok
[19:08:10] <ngoldbaum> and you can compile the code without writing a setup.py file
[19:08:20] <ngoldbaum> so it's the nicest for exploring and experimentation
[19:13:07] <ionelmc> ok i had some generator comprehenstions that made the C code incredibly ugly
[19:13:27] <ionelmc> now it looks like i might be able to read it at least
[19:13:31] <ionelmc> without them comprehensions
[19:13:33] <ionelmc> :)
[19:13:44] <ngoldbaum> yeah, i'm not a fan of the double-underscore names it generates
[19:13:54] <ngoldbaum> and anything that touches the CPython API is awful
[19:13:58] <ngoldbaum> but that's not a cython problem ;)
[19:14:00] <ionelmc> it makes some weird structs for every generator
[19:14:16] <ionelmc> and then everything is __asdfasdf_asdf_asdf_wqer everywhere
[19:14:35] <ngoldbaum> generally speed in cython means writing very C-like python-ish code
[19:14:54] <ngoldbaum> i still haven't made up my mind if it's better to just write a straight up C library and wrap it
[19:14:57] <ionelmc> i like that it converted `isinstance(obj, dict)` to `PyDict_Check()`
[19:14:58] <ionelmc> nice
[19:37:52] <ionelmc> weird, do i need to do something special to get my cdef functoins into the PyModuleDef?
[19:39:17] <gsnedders> ionelmc: cdef functions aren't callable from Python IIRC
[19:39:24] <gsnedders> ionelmc: you want cpdef probably?
[19:40:04] <ionelmc> ah
[19:40:05] <ionelmc> thanks
[19:40:08] <ionelmc> got lost in the docs
[19:57:22] <ionelmc> hmmm
[19:57:31] <ionelmc> can i put these compile options in setup.cfg?
[20:13:42] <ionelmc> nevermind, i can put them in the pyx file
[20:14:10] <ionelmc> gsnedders: but do i need to add the except clause to cpdef?
[20:14:32] <ionelmc> like cpdef int foobar() except -1: ...
[20:15:53] <gsnedders> ionelmc: I can't remember tbh