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

2.0.1 fails to build with Python 3.11.0a2 #81

Closed
hegjon opened this issue Nov 30, 2021 · 5 comments
Closed

2.0.1 fails to build with Python 3.11.0a2 #81

hegjon opened this issue Nov 30, 2021 · 5 comments

Comments

@hegjon
Copy link

hegjon commented Nov 30, 2021

Python 3.11 is planned to be included in Fedora 37. To make that update smoother, we're building Fedora packages with a pre-releases of Python 3.11.

Stack trace:

CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
LDFLAGS='-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 '
/usr/bin/python3 setup.py build '--executable=/usr/bin/python3 -s'
Traceback (most recent call last):
  File "/builddir/build/BUILD/libusb1-2.0.1/setup.py", line 159, in <module>
    version=versioneer.get_version(),
            ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/libusb1-2.0.1/versioneer.py", line 1483, in get_version
    return get_versions()["version"]
           ^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/libusb1-2.0.1/versioneer.py", line 1415, in get_versions
    cfg = get_config_from_root(root)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/libusb1-2.0.1/versioneer.py", line 344, in get_config_from_root
    parser = configparser.SafeConfigParser()
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'configparser' has no attribute 'SafeConfigParser'. Did you mean: 'RawConfigParser'?
error: Bad exit status from /var/tmp/rpm-tmp.9TIXxZ (%build)
    Bad exit status from /var/tmp/rpm-tmp.9TIXxZ (%build)

@hroncok
Copy link

hroncok commented Nov 30, 2021

Updating bundled versioneer should fix this.

@vpelletier
Copy link
Owner

I believe 032073e should fix this, but I do not have available 3.11 to test. Could you check if it does fix the issue ?

@hugovk
Copy link

hugovk commented Jan 13, 2022

Yes, or at least I can install fine with Python 3.11:

2.0.1

$ python3.11 -m pip install .
Processing /private/tmp/python-libusb1
  Preparing metadata (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/hugo/.pyenv/versions/3.11-dev/bin/python3.11 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/python-libusb1/setup.py'"'"'; __file__='"'"'/private/tmp/python-libusb1/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/pip-pip-egg-info-l6pmsztc
       cwd: /private/tmp/python-libusb1/
  Complete output (15 lines):
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/private/tmp/python-libusb1/setup.py", line 159, in <module>
      version=versioneer.get_version(),
              ^^^^^^^^^^^^^^^^^^^^^^^^
    File "/private/tmp/python-libusb1/versioneer.py", line 1483, in get_version
      return get_versions()["version"]
             ^^^^^^^^^^^^^^
    File "/private/tmp/python-libusb1/versioneer.py", line 1415, in get_versions
      cfg = get_config_from_root(root)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/private/tmp/python-libusb1/versioneer.py", line 344, in get_config_from_root
      parser = configparser.SafeConfigParser()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  AttributeError: module 'configparser' has no attribute 'SafeConfigParser'. Did you mean: 'RawConfigParser'?
  ----------------------------------------
WARNING: Discarding file:///private/tmp/python-libusb1. Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

master

$ python3.11 -m pip install .
Processing /private/tmp/python-libusb1
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: libusb1
  Building wheel for libusb1 (setup.py) ... done
  Created wheel for libusb1: filename=libusb1-2.0.1+3.g86ad8ab-py3-none-any.whl size=61903 sha256=ccb78c022cd801e180a88cd50385e2d5ccca34a8daa08ab2a391ce393d3e3bc2
  Stored in directory: /Users/hugo/Library/Caches/pip/wheels/67/81/e9/f1f078d6b87e62d9d20214dc8ef58dc9527fdc0e55d7afa81b
Successfully built libusb1
Installing collected packages: libusb1
  Attempting uninstall: libusb1
    Found existing installation: libusb1 2.0.1+3.g86ad8ab
    Uninstalling libusb1-2.0.1+3.g86ad8ab:
      Successfully uninstalled libusb1-2.0.1+3.g86ad8ab
Successfully installed libusb1-2.0.1+3.g86ad8ab

note

Versioneer 0.21 is compatible with Python 3.6+, so you may need to drop EOL 3.4-3.5 (3.6 is also EOL):

cycle latest release eol
3.10 3.10.1 2021-10-04 2026-10-04
3.9 3.9.9 2020-10-05 2025-10-05
3.8 3.8.12 2019-10-14 2024-10-14
3.7 3.7.12 2018-06-27 2023-06-27
3.6 3.6.15 2016-12-23 2021-12-23
3.5 3.5.10 2015-09-30 2020-09-13
3.4 3.4.10 2014-03-16 2019-03-18

But 3.4-3.5 are little used. Here's the pip installs for libusb1 from PyPI for December 2021:

category percent downloads
3.6 67.43% 146,358
3.8 11.49% 24,936
3.7 8.70% 18,877
3.9 4.81% 10,430
null 4.34% 9,414
2.7 2.38% 5,164
3.10 0.80% 1,738
3.5 0.05% 98
3.4 0.01% 18
3.11 0.00% 4
Total 217,037

Date range: 2021-12-01 - 2021-12-31

Source: pip install -U pypistats && pypistats python_minor libusb1 --last-month

@vpelletier
Copy link
Owner

Thanks for the test and heads-up about version usage & compatibility. I did not know pypi was still collecting stats ever since these were removed from the webpage.

I just started working on releasing the next version, but found that libusb 1.0.25 was just released, and that my unit tests are making it unhappy (segfault when freeing a transfer). I reported the issue to libusb.

@vpelletier
Copy link
Owner

I fixed the test issues with 1.0.25, and released python-libusb1 3.0.0 (major bump because of the drop of <py3.6).

I believe this resolves this bug report, thanks !

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

4 participants