Build.py - suppress_known_deprecation needs to reference method not module
See original GitHub issueNew feature introduced from issue #1285 Related to issue #1306
Nuitka version - 0.6.18.2 Windows 10 Python 3.6.8 - installed using choco - choco install python3 --version 3.6.8 nuitka installed using pip poetry version 1.1.12 C:\python36\Scripts - added to windows PATH. I can call nuitka and poetry directly from cmd line
nuitka --version 0.6.18.2 Commercial: None Python: 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 24 2018, 00:16:47) [MSC v.1916 64 bit (AMD64)] Flavor: Unknown Executable: C:\Python36\python.exe OS: Windows Arch: x86_64
python -m pip freeze --all (only relevant packages copied here) Cython==0.29.25 Nuitka==0.6.18.2 wheel==0.37.0 setuptools==59.5.0 build==0.7.0
While I have been unable to get poetry to use nuitka - issue raised https://github.com/python-poetry/poetry/issues/4871 I attempted to build the wheel using pip package build and found a bug
Steps to reproduce
Same pyproject.toml as issue #1306
with build installed pip install build
python -m build --wheel
* Creating venv isolated environment...
* Installing packages in isolated environment... (nuitka, setuptools>=59.5.0, wheel)
* Getting dependencies for wheel...
running egg_info
writing UNKNOWN.egg-info\PKG-INFO
writing dependency_links to UNKNOWN.egg-info\dependency_links.txt
writing top-level names to UNKNOWN.egg-info\top_level.txt
reading manifest file 'UNKNOWN.egg-info\SOURCES.txt'
writing manifest file 'UNKNOWN.egg-info\SOURCES.txt'
* Installing packages in isolated environment... (wheel)
* Building wheel...
Traceback (most recent call last):
File "C:\Users\212708371\AppData\Local\pypoetry\Cache\virtualenvs\hello-world-example-n2vEQI7P-py3.6\lib\site-packages\pep517\in_process\_in_process.py", line 363, in <module>
main()
File "C:\Users\212708371\AppData\Local\pypoetry\Cache\virtualenvs\hello-world-example-n2vEQI7P-py3.6\lib\site-packages\pep517\in_process\_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "C:\Users\212708371\AppData\Local\pypoetry\Cache\virtualenvs\hello-world-example-n2vEQI7P-py3.6\lib\site-packages\pep517\in_process\_in_process.py", line 262, in build_wheel
metadata_directory)
File "C:\Users\212708~1\AppData\Local\Temp\build-env-4x366x1c\lib\site-packages\nuitka\distutils\Build.py", line 39, in build_wheel
with suppress_known_deprecation():
TypeError: 'module' object is not callable
When forcing setuptools to an earlier version in the pyproject.toml requires - setuptools==42 - I get a different error
python -m build --wheel
* Creating venv isolated environment...
* Installing packages in isolated environment... (nuitka, setuptools==42, wheel)
* Getting dependencies for wheel...
running egg_info
writing UNKNOWN.egg-info\PKG-INFO
writing dependency_links to UNKNOWN.egg-info\dependency_links.txt
writing top-level names to UNKNOWN.egg-info\top_level.txt
reading manifest file 'UNKNOWN.egg-info\SOURCES.txt'
writing manifest file 'UNKNOWN.egg-info\SOURCES.txt'
* Installing packages in isolated environment... (wheel)
* Building wheel...
running bdist_nuitka
running build
Missing both compile_packages and py_modules, aborting...
ERROR Backend subproccess exited when trying to invoke build_wheel
It should be a simple fix in Build.py
if not hasattr(setuptools.build_meta, "suppress_known_deprecation"):
@contextlib.contextmanager
def suppress_known_deprecation():
yield
else:
suppress_known_deprecation = setuptools.build_meta
should be
if not hasattr(setuptools.build_meta, "suppress_known_deprecation"):
@contextlib.contextmanager
def suppress_known_deprecation():
yield
else:
suppress_known_deprecation = setuptools.build_meta.suppress_known_deprecation
I am leaning towards the second error - Missing both compile_packages and py_modules - being my own user error until I can investigate further. If needed, I can create an issue for that if not.
Issue Analytics
- State:
- Created 2 years ago
- Comments:23 (14 by maintainers)
Top GitHub Comments
Yes, that looks good, maybe once they do that, poetry and setuptools could use the same values, just dreaming. It’s so great when people create a new config file to place stuff, just one more standard, because the others are supposedly bad.
The preparing of the metadata is something that poetry itself obviously needs to handle, and then it should give that to the backend. But I guess it doesn’t do that, or if it does, Nuitka doesn’t pick up on that.