vpelletier / python-libusb1

Python ctype-based wrapper around libusb1
GNU Lesser General Public License v2.1
168 stars 65 forks source link

build fails against setuptools 58+ #79

Closed stanislavlevin closed 2 years ago

stanislavlevin commented 2 years ago

This project has the option use_2to3 in setup.py, which support has been removed in setuptools since version 58.0.0 https://setuptools.readthedocs.io/en/latest/history.html#v58-0-0:

2086: Removed support for 2to3 during builds. Projects should port to a unified codebase or pin to an older version of Setuptools using PEP 518 build-requires.

The build fails with:

/usr/bin/python3 setup.py build error in libusb1 setup command: use_2to3 is invalid.

stanislavlevin commented 2 years ago

Mostly it is due to https://docs.python.org/3/library/2to3.html#module-lib2to3:

Deprecated since version 3.10: Python 3.9 will switch to a PEG parser (see PEP 617), and Python 3.10 may include new language syntax that is not parsable by lib2to3’s LL(1) parser. The lib2to3 module may be removed from the standard library in a future Python version. Consider third-party alternatives such as LibCST or parso.

vpelletier commented 2 years ago

Thanks for the heads-up. Unfortunately, this may bring the end of 2.7 support in this module (and a few of my other modules).

mcuee commented 2 years ago

I think it is time to remove Python 2.7 support and probably Python 3.0/3.1/3.2/3.3/3.4 as well.

Ref: pyusb dropped the support of Python 2.7 and Python 3.5 in the 1.1.1 release earlier this year. https://github.com/pyusb/pyusb/commit/eaf690840b3b041646fc862a0f77e6b0bed24dc1

vpelletier commented 2 years ago

I pushed the 2to3 removal to master. I hesitated first doing a release with the significant recent changes, and then another one just dropping 2.7 support. But with setuptools out of the barn, it would already not be possible to install, so I guess it is pointless.

vpelletier commented 2 years ago

Released as 1.10.1 (.1 because of a restructured text mishap).

stanislavlevin commented 2 years ago

Thank you!

srenauld commented 2 years ago

For those of us constrained to python2.x, could you increase semver to indicate a breaking change?

We use nrfutil to generate DFU packages for a bunch of projects where I work. This new release broke the build as nrfutil improperly sets very loose requirements. On our CI setup I pinned it to 1.x; the change being a breaking change despite being a feature increment broke the build and caused a lot of headaches.

vpelletier commented 2 years ago

My apologies for the breakage. I re-released (with only README and setup.sh changes) 1.10.1 as 2.0.0, and yanked 1.10.1 from pypi.