Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install error Python 3.8 / Cython 0.29.10 #404

Closed
PouueT opened this issue Jul 27, 2020 · 3 comments
Closed

Install error Python 3.8 / Cython 0.29.10 #404

PouueT opened this issue Jul 27, 2020 · 3 comments

Comments

@PouueT
Copy link

PouueT commented Jul 27, 2020

Context:

  • Fresh development install in Linux Ubuntu 20.04
  • Python 3.8 virtual environnent
  • cython 0.29.21
  • pip3 install -e mpf is OK

But pip3 install -e mpf-mc result with errors, example :

122 | PyAPI_FUNC(PyCodeObject *) PyCode_New(
    |    
                    ^~~~~~~~~~

  /tmp/pip-install-7s88whfo/mpf-mc/mpfmc/core/audio/sound_file.c:318:11: error: too many arguments to function ‘PyCode_New'
318 |           PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
    | 
                              ^~~~~~~~~~

In fact, the problem is related to Python 3.8 / Cython API changes : cython/cython@761f996
https://bugs.python.org/issue37221
https://docs.python.org/3.8/c-api/code.html ( PyCode_New(...) )

As of today, Cython master branch close to release tag 0.29.21 looks likes this, Line 488 :
https://github.com/cython/cython/blob/master/Cython/Utility/ModuleSetupCode.c

List of MPF-MC concerned files :

$ git grep PyCode_New\(a,\ 0
mpfmc/core/audio/audio_interface.c:          PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
mpfmc/core/audio/playlist_controller.c:          PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
mpfmc/core/audio/track.c:          PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
mpfmc/core/audio/track_sound_loop.c:          PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
mpfmc/core/audio/track_standard.c:          PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
mpfmc/uix/bitmap_font/bitmap_font.c:          PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)

Quick and dirty fix for test purpose (Tested OK) :
Remove '0' arg :

-          PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+         PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)

@qcapen @jabdoa2 , I guess real problems comes from being able to cythonize / regenarate those files with local cythons.
(And what to decide to keep in master branch for pre generated files ?)

By default, with setup.py, we have skip_cython True and uses pre cythonized c sources.
It doesn't look like cythonizing sources with a local cython install works:
$ export USE_CYTHON=y
modify setup.py MAX_CYTHON_STRING = '0.29.21'
-> skipping '/xxxxxxx/mpf-mc/mpfmc/core/audio/sound_file.c' Cython extension (up-to-date)

Side note :
Currently, in mpf-debian-installer-dev.zip -> install-mpf-dependencies :
pip3 install -I Cython==0.27.3
Maybe we can update the install shell script to have a working package combination (with python 3.5 to 3.X) ?

@PouueT PouueT changed the title Install error Python 3.8 / Cython 0.29.10 Install error Python 3.8 / Cython 0.29.10 (Installer not found Error : Jul 27, 2020
@PouueT PouueT changed the title Install error Python 3.8 / Cython 0.29.10 (Installer not found Error : Install error Python 3.8 / Cython 0.29.10 Jul 27, 2020
@jabdoa2
Copy link
Collaborator

jabdoa2 commented Aug 5, 2020

@qcapen any thoughts on this?

@qcapen
Copy link
Collaborator

qcapen commented Aug 5, 2020 via email

@jabdoa2
Copy link
Collaborator

jabdoa2 commented Aug 14, 2020

@PouueT I see that Quinn commited the change to dev. Could you test if that works for you?

@PouueT PouueT closed this as completed Nov 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants