vrasneur/pyfasttext

pip install fails with Cython 0.28

Closed this issue · 3 comments

Cython 0.28 was released yesterday. pip install pyfasttext using this Cython breaks with:

Collecting pyfasttext
  Downloading pyfasttext-0.4.4.tar.gz (235kB)
    Complete output from command python setup.py egg_info:
    Collecting cysignals
      Downloading cysignals-1.6.9.tar.gz (85kB)
    Building wheels for collected packages: cysignals
      Running setup.py bdist_wheel for cysignals: started
      Running setup.py bdist_wheel for cysignals: finished with status 'done'
      Stored in directory: /root/.cache/pip/wheels/c3/dd/fa/e7a20f8ca22a48bb55b07486dde4e8ed256907192218339b72
    Successfully built cysignals
    Installing collected packages: cysignals
    Successfully installed cysignals-1.6.9

    Error compiling Cython file:
    ------------------------------------------------------------
    ...
          ret['label'] = self.label
          return ret

        cdef size_t index = 0
        args = get_fasttext_args(self.ft)
        args_map = get_args_map(args)
                               ^
    ------------------------------------------------------------

    src/pyfasttext.pyx:264:28: Cannot assign type 'shared_ptr[const Args]' to 'const shared_ptr[const Args]'
    Compiling src/pyfasttext.pyx because it depends on /usr/local/lib/python2.7/dist-packages/cysignals/signals.pxd.
    [1/1] Cythonizing src/pyfasttext.pyx
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-_kbz9r/pyfasttext/setup.py", line 88, in <module>
        'FASTTEXT_VERSION': get_fasttext_commit_hash()}),
      File "/usr/local/lib/python2.7/dist-packages/Cython/Build/Dependencies.py", line 1026, in cythonize
        cythonize_one(*args)
      File "/usr/local/lib/python2.7/dist-packages/Cython/Build/Dependencies.py", line 1146, in cythonize_one
        raise CompileError(None, pyx_file)
    Cython.Compiler.Errors.CompileError: src/pyfasttext.pyx

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-_kbz9r/pyfasttext/

If I do pip install Cython==0.27.3 first I can successfully install pyfasttext

The above was run using Python 2.7.12 on Ubuntu 16.0.4.3

Thanks for the report!

It looks like a regression in Cython: cython/cython#2148

Let's just wait a little bit until a Cython maintainer comments in the issue :-)

Please try the latest Cython master, it should fix this issue.

@scoder confirmed this now works with Cython 0.28.1.