-
-
Notifications
You must be signed in to change notification settings - Fork 176
Closed as not planned
Description
Describe the bug
If cython isn't available, then the import fails but gets suppressed:
yarl/packaging/pep517_backend/_backend.py
Lines 43 to 48 in 0ca5599
| with suppress(ImportError): | |
| # NOTE: Only available for wheel builds that bundle C-extensions. Declared | |
| # NOTE: by `get_requires_for_build_wheel()` and | |
| # NOTE: `get_requires_for_build_editable()`, when `--pure-python` | |
| # NOTE: is not passed. | |
| from Cython.Build.Cythonize import main as _cythonize_cli_cmd |
However the imported function is always invoked during the build:
yarl/packaging/pep517_backend/_backend.py
Line 303 in 0ca5599
| _cythonize_cli_cmd(cythonize_args) |
Since there is no fallback, this causes a NameError and a subsequent build failure
To Reproduce
- Set up build environment without Cython
python -m build
Expected behavior
Succesful compilation without cython support.
Logs/tracebacks
Running command Building wheel for yarl (pyproject.toml)
**********************
* Accelerated build *
**********************
Traceback (most recent call last):
File "/nix/store/slhj69him45n2pck7wkknnffi4ay0jy0-python3.11-pip-23.2.1/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
main()
File "/nix/store/slhj69him45n2pck7wkknnffi4ay0jy0-python3.11-pip-23.2.1/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/slhj69him45n2pck7wkknnffi4ay0jy0-python3.11-pip-23.2.1/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/qp5zys77biz7imbk6yy85q5pdv7qk84j-python3-3.11.6/lib/python3.11/contextlib.py", line 81, in inner
return func(*args, **kwds)
^^^^^^^^^^^^^^^^^^^
File "/build/yarl-1.9.3/packaging/pep517_backend/_backend.py", line 325, in build_wheel
with maybe_prebuild_c_extensions(
File "/nix/store/qp5zys77biz7imbk6yy85q5pdv7qk84j-python3-3.11.6/lib/python3.11/contextlib.py", line 137, in __enter__
return next(self.gen)
^^^^^^^^^^^^^^
File "/build/yarl-1.9.3/packaging/pep517_backend/_backend.py", line 304, in maybe_prebuild_c_extensions
_cythonize_cli_cmd(cythonize_args)
^^^^^^^^^^^^^^^^^^
NameError: name '_cythonize_cli_cmd' is not definedPython Version
3.11.6multidict Version
6.0.4yarl Version
1.9.3OS
NixOS 23.05
Additional context
No response
Code of Conduct
- I agree to follow the aio-libs Code of Conduct