Skip to content
This repository

Better support Pypy #719

Closed
fperez opened this Issue August 21, 2011 · 5 comments

3 participants

Fernando Perez Min RK Thomas Kluyver
Fernando Perez
Owner

With pypy 1.6, ipython 0.10.2 works reasonably well, but current master completely fails to even start, with this error:

Original exception was:
Traceback (most recent call last):
  File "app_main.py", line 53, in run_toplevel
  File "/home/fperez/usr/bin//ipython", line 7, in 
    launch_new_instance()
  File "/home/fperez/usr/lib/python2.6/site-packages/IPython/frontend/terminal/ipapp.py", line 385, in launch_new_instance
    app.initialize()
  File "/home/fperez/usr/lib/python2.6/site-packages/IPython/frontend/terminal/ipapp.py", line 299, in initialize
    self.init_shell()
  File "/home/fperez/usr/lib/python2.6/site-packages/IPython/frontend/terminal/ipapp.py", line 319, in init_shell
    ipython_dir=self.ipython_dir)
  File "/home/fperez/usr/lib/python2.6/site-packages/IPython/config/configurable.py", line 295, in instance
    inst = cls(*args, **kwargs)
  File "/home/fperez/usr/lib/python2.6/site-packages/IPython/frontend/terminal/interactiveshell.py", line 113, in __init__
    user_global_ns=user_global_ns, custom_exceptions=custom_exceptions
  File "/home/fperez/usr/lib/python2.6/site-packages/IPython/core/interactiveshell.py", line 388, in __init__
    self.init_history()
  File "/home/fperez/usr/lib/python2.6/site-packages/IPython/core/interactiveshell.py", line 1399, in init_history
    self.history_manager = HistoryManager(shell=self, config=self.config)
  File "/home/fperez/usr/lib/python2.6/site-packages/IPython/core/history.py", line 127, in __init__
    self.new_session()
  File "/home/fperez/usr/lib/python2.6/site-packages/IPython/core/history.py", line 154, in new_session
    self.session_number = cur.lastrowid
  File "/home/fperez/usr/lib/python2.6/site-packages/IPython/utils/traitlets.py", line 302, in __set__
    new_value = self._validate(obj, value)
  File "/home/fperez/usr/lib/python2.6/site-packages/IPython/utils/traitlets.py", line 310, in _validate
    return self.validate(obj, value)
  File "/home/fperez/usr/lib/python2.6/site-packages/IPython/utils/traitlets.py", line 873, in validate
    self.error(obj, value)
  File "/home/fperez/usr/lib/python2.6/site-packages/IPython/utils/traitlets.py", line 333, in error
    raise TraitError(e)
TraitError: The 'session_number' trait of a HistoryManager instance must be an integer, but a value of 590L  was specified.

We should look into making the traits type checks be more pypy-friendly, if possible. Pypy now has preliminary numpy support, so it's starting to become slowly a contender for scientific use.

Min RK
Owner

it's probably pretty easy to get the traits, etc. working for terminal IPython. However, I think the qtconsole, notebook, and parallel code are simply nonstarters thanks to pyzmq.

Fernando Perez
Owner

Sure! I just figured we should do our best, for now, to keep the console/readline ipython working in pypy.

Later, as they make more progress on extension support, we'll see about the pieces that need zmq, but all that worries me much less.

We've always said there is a 'core' part of ipython that runs with only the stdlib. That's the part I want to try to keep pypy-friendly.

Min RK
Owner
Thomas Kluyver
Collaborator

I've done this a couple of times, and kept meaning to commit the fix. Changing Int to CInt gets it started, but there are still some problems with readline.

Thomas Kluyver takluyver referenced this issue from a commit in takluyver/ipython August 22, 2011
Thomas Kluyver Use casting trait for session number in history, so IPython will star…
…t on PyPy.

Closes gh-719
4d5d46f
Min RK minrk closed this September 09, 2011
Min RK
Owner

There's still room for improvement here, but PR #722 should have closed this, but the auto-close failed.

Brian E. Granger ellisonbg referenced this issue from a commit January 10, 2012
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.