question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build.py - suppress_known_deprecation needs to reference method not module

See original GitHub issue

New 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:closed
  • Created 2 years ago
  • Comments:23 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
kayhayencommented, Dec 15, 2021

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.

0reactions
kayhayencommented, Dec 16, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python - Module Not Found - Stack Overflow
All modules in Python have to have a certain directory structure. You can find details here. Create an empty file called __init__.py under...
Read more >
6. Modules — Python 3.11.1 documentation
Such a file is called a module; definitions from a module can be imported into other modules or into the main module (the...
Read more >
Python Modules and Packages – An Introduction
This article explores Python modules and Python packages, two mechanisms that facilitate modular programming. Modular programming refers to the process of ...
Read more >
How To Write Modules in Python 3 | DigitalOcean
This tutorial will guide you through writing Python modules for you ... with python hello.py nothing will happen since we have not told...
Read more >
Access Python Modules from MATLAB - Getting Started
You do not need to import modules in order to use them. ... Create a Python object and call a method on it....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found