igraph / python-igraph

Python interface for igraph
GNU General Public License v2.0
1.31k stars 249 forks source link

PyPy-friendly Release Request #244

Closed luav closed 4 years ago

luav commented 5 years ago

Make sure that these boxes are checked before submitting your issue -- thank you!

The latest python-igraph release installable from PyPI (python-igraph==0.7.1.post6) fails execution under PyPy because of the minor bug, which was fixed in March (#213) and have not been released yet:

$ pypy3  algorithms/fast_consensus.py ...
Traceback (most recent call last):
  File "algorithms/fast_consensus.py", line 11, in <module>
    import igraph as ig
  File "/home/ubuntu/.local/lib/pypy3.6/site-packages/igraph/__init__.py", line 36, in <module>
    from igraph.clustering import *
  File "/home/ubuntu/.local/lib/pypy3.6/site-packages/igraph/clustering.py", line 33, in <module>
    from igraph.compat import property
  File "/home/ubuntu/.local/lib/pypy3.6/site-packages/igraph/compat.py", line 58, in <module>
    property = __builtins__["property"]
TypeError: 'module' object is not subscriptable (key 'property')

Can you please release some version of the python-igraph after that fix to simplify distribution of the dependent projects that rely on igraph and assumed to be executed under PyPy?!

szhorvat commented 5 years ago

A new release is going to be issued within a month or so. A lot of work is being currently done to make this happen.

szhorvat commented 5 years ago

I should note that I am not deeply involved with the Python interface (I contribute to the C core), thus I can't comment on plans about PyPy support. All I can say is that a release is coming

ntamas commented 5 years ago

@luav can PyPy install stuff with pip from git repos directly? If so, you can probably run pip -U git+https://github.com/igraph/python-igraph.git; pip is smart enough to check out the submodule with the required revision of the C core of igraph and do the compilation.

luav commented 5 years ago

@ntamas Thanks, pip install of the repository works fine:

$ sudo apt-get install -y libtool flex
$ pypy3 -m pip install --user -U git+https://github.com/igraph/python-igraph.git
ntamas commented 4 years ago

@luav Do you happen to know whether pypy can make use of Python wheels, and if so, how shall we build a Python wheel in advance for the next release so there is no need to compile anything when installing python-igraph? I cannot promise that we will implement this for 0.8 but it would be great if we could set it up at least in a CI environment.

luav commented 4 years ago

@ntamas Typically, PyPy uses own version of the wheels: https://doc.pypy.org/en/latest/install.html#installing-more-modules. From the user perspective it works exactly like the CPython wheels but generates different binaries. In practice, you can use CPython wheels with PyPy but then in most cases end up with such issues.
Thus, to support both CPython and PyPy, you should have the dedicated environments for each of them. I'm not sure that there exists a straight-forward way to avoid the dedicated compilation for PyPy... To speed up the compilation by avoiding unnecessary recompilation, you can employ caching.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.