kivy: Add a check for python version in `make` and gracefully exit rather than fail on python version 2.

Software Versions

  • Python:
  • OS: OSX 10.15.6
  • Kivy: master 27 sept 2020
  • Kivy installation method: clone master and make

Describe the bug Make fails with python referring to python2 does not fail gracefully

Expected behavior

 kivy % make 
python setup.py build_ext —inplace
Python version 2 is not supported, please use python3

To Reproduce

> git clone github.com/kivy/kivy
> cd kivy
> make 

Code and Logs and screenshots

 kivy % make 
python setup.py build_ext --inplace
  File "setup.py", line 1050
    def glob_paths(*patterns, excludes=('.pyc', )):
                                     ^
SyntaxError: invalid syntax
make: *** [build] Error 1

Additional context Add any other context about the problem here.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (15 by maintainers)

Commits related to this issue

Most upvoted comments

Honestly my personal use case is using make, that’s why I wanted to add the Make only solution. This is good enough for users that compile from git.

For the setup.py change I fear doing it this way is begging for consequences down the line….

But you wouldn’t use setup.py directly these days, except after you have a working install, for normal users. So we just need to make sure that installing with pip returns a clear error. We don’t have to make it return a nice error for users who don’t use pip, because hopefully they would know about Python2 not being supported.

Even editable install is installed with pip initially. So we just need to add the appropriate metada and hopefully pip not even try to run setup.py if the min version is violated.

On Sun, Sep 27, 2020, 11:06 AM Gabriel Pettier notifications@github.com wrote:

the other setup.py is not for make users, it’s to allow anyone to run setup.py and get a legible error if they are using python2.7, it might be a bit heavy handed, but i don’t see another way to avoid the syntax error otherwise (or avoiding using python3 syntax in setup.py).

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kivy/kivy/issues/7109#issuecomment-699646921, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMRN7QNZGOZ2V4BFO5RDFDSH5IGRANCNFSM4R3OSS3Q .