bsolomon1124 / pycld3

Python3 bindings for the Compact Language Detector v3 (CLD3)
Apache License 2.0
148 stars 6 forks source link

Wheel building fails for Python nightly (3.10) #18

Closed adbar closed 2 years ago

adbar commented 4 years ago

Hi, Python 3.10 seems to require a different syntax for wheel building (PEP 517).

I just caught the following error on Travis, see this log (https://travis-ci.org/github/adbar/trafilatura/jobs/715201011):

ERROR: Command errored out with exit status 1: command: /home/travis/virtualenv/python3.10-dev/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-suhzcy17/pycld3/setup.py'"'"'; file='"'"'/tmp/pip-install-suhzcy17/pycld3/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-plzmgvyb ... DEPRECATION: Could not build wheels for pycld3 which do not use PEP 517. pip will fall back to legacy 'setup.py install' for these. pip 21.0 will remove support for this functionality. A possible replacement is to fix the wheel build issue reported above. You can find discussion regarding this at https://github.com/pypa/pip/issues/8368.

adbar commented 2 years ago

Hi @bsolomon1124, Python 3.10 is out, any follow-up on this?

bsolomon1124 commented 2 years ago

I have neglected to get ahead of this so I will now play catch up as soon as I'm able to this week. Thank you for the reminder.

bsolomon1124 commented 2 years ago

@adbar are you able to re-run a build using the 3.10.0 final release or point me to such a failed build?

I see that your build failure occurred with 3.10.0a0. I very much want to help out and ensure compatibility with 3.10, but the package installs OK with or without wheel installed for me on MacOS:

$ python3 -V
Python 3.10.0

brad ~/Scripts/python/envs
$ python3 -m pip install pycld3
Collecting pycld3
  Downloading pycld3-0.22.tar.gz (726 kB)
     |████████████████████████████████| 726 kB 3.9 MB/s 
Using legacy 'setup.py install' for pycld3, since package 'wheel' is not installed.
Installing collected packages: pycld3
    Running setup.py install for pycld3 ... done
Successfully installed pycld3-0.22
WARNING: You are using pip version 21.2.3; however, version 21.2.4 is available.
You should consider upgrading via the '.../bin/python3 -m pip install --upgrade pip' command.

brad ~/Scripts/python/envs
$ python3 -m pip uninstall pycld3
Found existing installation: pycld3 0.22
Uninstalling pycld3-0.22:
  Would remove:
    .../lib/python3.10/site-packages/cld3/*
    .../lib/python3.10/site-packages/pycld3-0.22-py3.10.egg-info
Proceed (Y/n)? y
  Successfully uninstalled pycld3-0.22

brad ~/Scripts/python/envs
$ python3 -m pip install wheel
Collecting wheel
  Using cached wheel-0.37.0-py2.py3-none-any.whl (35 kB)
Installing collected packages: wheel
Successfully installed wheel-0.37.0
WARNING: You are using pip version 21.2.3; however, version 21.2.4 is available.
You should consider upgrading via the '.../bin/python3 -m pip install --upgrade pip' command.

brad ~/Scripts/python/envs
$ python3 -m pip install pycld3
Collecting pycld3
  Using cached pycld3-0.22.tar.gz (726 kB)
Building wheels for collected packages: pycld3
  Building wheel for pycld3 (setup.py) ... done
  Created wheel for pycld3: filename=pycld3-0.22-cp310-cp310-macosx_10_15_x86_64.whl size=510580 sha256=ccb5474ab97b8d5d0d0178bf0f2e0d145eea2211a386aa29c65932eda25e4291
  Stored in directory: /Users/brad/Library/Caches/pip/wheels/45/d5/83/9a7a38189ea5f936288b326094526bbc31fe8a4dc79587fb7a
Successfully built pycld3
Installing collected packages: pycld3
Successfully installed pycld3-0.22
WARNING: You are using pip version 21.2.3; however, version 21.2.4 is available.
You should consider upgrading via the '.../bin/python3 -m pip install --upgrade pip' command.
adbar commented 2 years ago

@bsolomon1124 Thanks for the prompt answer!

Here is a current example on GitHub actions, it seems to be the same problem and only affects Python 3.10: https://github.com/adbar/trafilatura/runs/3817456324

bsolomon1124 commented 2 years ago

it seems to be the same problem and only affects Python 3.10

That error seems to be different, indicating that protoc (protobuf) is required since there is no wheel available for Python 3.10, while there is a wheel used for lower versions.

adbar commented 2 years ago

You're right, they appear to be working on supporting Python 3.10: https://github.com/protocolbuffers/protobuf/pull/9034

adbar commented 2 years ago

@bsolomon1124 The problem now seems to be fixed, could you give it a try?

adbar commented 2 years ago

I'm closing the issue since things work, but you might want to think about a new release targeting Python 3.10 explicitly.

juhoinkinen commented 2 years ago

I'm closing the issue since things work, but you might want to think about a new release targeting Python 3.10 explicitly.

Hi @bsolomon1124! A release with wheels for Python 3.10 would be nice to have, especially now when Ubuntu 22.04 is released with 3.10 as the default Python version.