-
Notifications
You must be signed in to change notification settings - Fork 8
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
Bugfix/incompatibility with setuptools 63.4.0 #8
Bugfix/incompatibility with setuptools 63.4.0 #8
Conversation
setuptools removed the `format_command` property of the `bdist` command, which setuptools-cythonize relies on. This results in the following error: ``` File "D:\win_temp\pip-build-env-avucl34u\overlay\Lib\site-packages\setuptools_cythonize.py", line 166, in set_default_wheel_format cls.format_command['wheel'] = ('bdist_wheel', "Python .whl file") AttributeError: type object 'CythonizeBdist' has no attribute 'format_command' ``` It works with setuptools versions <=63.3.0, so a workaround is to constrain the setuptools version to that.
Using the `bdist.format_command` property is not possible and not required anymore. The property was removed in setuptools 63.4.0 (commit c0a4ea65ab68c8c6cb6ad54cc646c58bede6f0f4 on the setuptools repo). So with setuptools 63.4.0 it is enough to update the `format_commands` dict, however this also requires setuptools 63.4.0 to work. If setuptools <63.4.0 is required, then the previous commit offers a solution.
I was not aware this interface was used publicly. I'll restore the compatibility shim. I'd recommend setuptools-cythonize to implement something like pypa/setuptools@b8d50cf for backward compatibility if it's unacceptable to drop support for older Setuptools. |
Setuptools v63.4.1 is going out and should address the incompatibility. I'd still like to see setuptools-cythonize adapt to the new preferred interface. |
Thanks for reporting @StefanD986! As @jaraco suggest it, I will implement a way to address the incompatibility |
Hi @StefanD986, Can you try if the changes I've made fit for your needs? |
I tested it with setuptools 63.4.0 and 63.4.1 (these were the problematic versions for me), and the changes solve it for these. Thanks! Sidenote: Trying this out is in theory easy (just specify the wheel as a direct reference) but was surprisingly hard: I was running into a bug in the |
…version 63.4.1 Jason R. Coombs (26): Revert "Limit the scope of deprecation of the upload_docs command." Run pyupgrade --py37-plus In DummyCommand, simplify setting of kwargs. Implement TempdirManager setup and teardown as a pytest fixture. Implement LoggingSilencer setup and teardown as a pytest fixture. Required building a fixture combiner. Ran unittest2pytest ⚫ Fade to black. 👹 Feed the hobgoblins (delint). Convert many tests to pytest native Remove compatibility shims for Setuptools. Replace save/restore of argv and cwd as pytest fixtures. Move setup/teardown from BuildExtTestCase into a fixture. Add tests capturing failure. Ref pypa/distutils#164. Use itertools.product to compute the product of two generators. Fixes pypa/distutils#164. Extract 'roots' variable. Add test compatibility on Windows. spell out read the docs Update changelog 👹 Feed the hobgoblins (delint). Update changelog Bump version: 63.3.0 → 63.4.0 Clean up cruft in changelog. Revert "Remove compatibility shims for Setuptools." Mark use of format_commands.append as deprecated. Ref anxuae/setuptools-cythonize#8. Update changelog. Bump version: 63.4.0 → 63.4.1 Manuel Kaufmann (3): Docs: enable tooltips on documentation Docs: create nice 404 pages Docs: pin sphinx-hoverxref as minor than v2
setuptools removed the
format_command
property of thebdist
command, which setuptools-cythonize relies on.This results in the following error:
This PR contains two solutions:
format_commands
dict
(note thes
at the end) is used, because since 63.3.0 thisdict
will retain the order, the list is not required/supported anymore. Because this is a fix that is not compatible with setuptools <63.3.0 the constraint in thesetup.py
was updated.@anxuae I would suggest to make separate releases for the two commits, so that people who cannot use setuptools 63.4.0 for any reason can still fall back to the backwards compatible first fix.