[IPython-dev] iPython binary wheels for OS-X

Paul Moore p.f.moore at gmail.com
Mon Dec 9 18:43:49 EST 2013


On 9 December 2013 23:03, MinRK <benjaminrk at gmail.com> wrote:
> One of the sticky things with wheels (and easy with setup.py) is that a
> readline package should only be a dependency if stdlib readline is actually
> libedit. That's true of System Python and Python.org, but it is not true of
> conda Python or macports (both of which regularly pip install ipython, so it
> matters, even though they both have IPython packages). So if IPython is
> going to start building wheels, it needs to be able to express dependencies
> like that, and the platform is simply insufficient information.

This is similar to some of the current debates on distutils-sig around
compatibility checking for wheels, where the same issue arises. On the
one hand, we want to avoid executing arbitrary code at install time
(because doing so makes static introspection impossible, among other
things) and yet we need to be able to express constraints people need.
So we need to make sure we understand those constraints.

So on that basis, can you tell me (or point me at the relevant code)
how IPython determines whether readline is needed? In the setup.py I
see

if not setupext.check_for_readline():
        if sys.platform == 'darwin':
            requires.append('readline')
        elif sys.platform.startswith('win'):
            # Pyreadline 64 bit windows issue solved in versions >=1.7.1
            # Also solves issues with some older versions of pyreadline that
            # satisfy the unconstrained depdendency.
            requires.append('pyreadline>=1.7.1')
        else:
            pass

which is basically a platform check if check_for_readline fails. The
key thing in check_for_readline appears to me to be whether
readline.__doc__ contains "libedit". Is that what you need? Obviously
pip/wheel would never implement something this specific, but I *could*
see a conditional something like "check the value of a variable
imported from a module on the installation target machine" as being
worth discussion.

I'd quite happily argue, though, that if the core readline library is
sufficiently broken when built with libedit on OSX to cause all of
these problems, then that should surely be flagged as a bug with core
Python. Maybe Python should just not build the builtin readline if all
it has available is libedit - has any OSX user had this discussion
with the core team?

Paul



More information about the IPython-dev mailing list