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 Nuitka'd wheel file using poetry not working

See original GitHub issue

New feature introduced from issue #1285

Nuitka version - 0.6.18.1 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 - installed using their install_poetry.py script. I also tried version 1.2.0a2 installed using their --preview option C:\python36\Scripts - added to windows PATH. I can call nuitka and poetry directly from cmd line

nuitka --version 0.6.18.1 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.1 wheel==0.37.0 setuptools==59.5.0

When running “poetry build -f wheel” it still builds open source wheel files.

poetry build -f wheel
Building hello-world-example (0.1.0)
  - Building wheel
  - Built hello_world_example-0.1.0-py3-none-any.whl

Using 7z to look inside the whl file shows the open source original py files

I tried having nuitka installed in my global site packages and in the poetry venv - poetry install. I even tried adding a print(“BLAH BLAH”) to the nuitka.distutils.Build file (both global and venv) and that doesn’t get printed.

Hello World example src
hello_world.py - contains only print(‘Hello World’)

pyproject.toml

[tool.poetry]
version = "0.1.0"
name = "hello-world-example"
description = "Hello places and things"
packages = [
    {include = "src" },
]
keywords = [
    "Hello",
]
classifiers = [
    "Programming Language :: Python :: 3",
    "License :: Other/Proprietary License",
    "Operating System :: OS Independent"
]
authors = ["Hello World <hello@world.com>"]
homepage = "https://www.helloworld.com"

[tool.poetry.dependencies]
python = "3.6.8"

[tool.poetry.dev-dependencies]
nuitka = "0.6.18.1"

[build-system]
requires = ["setuptools>=42", "wheel", "nuitka"]
build-backend = "nuitka.distutils.Build"

[virtualenvs]
create = true
in-project = true

nuitka --onefile src\hello_world.py Creates hello_world.exe which works as expected

Building a compiled whl using Nuitka would be fantastic and I appreciate you implementing this. Hopefully this is just a case of under-documentation and the fault is on my end but the Use Case 5 description seemed pretty straight forward.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bsvedincommented, Dec 13, 2021

Update on the poetry issue. It has been closed Quote

poetry build is not a general build tool for python packages. It is only for building a package from a poetry project. And so it doesn’t care about the given build-backend and uses its own automatically.

It looks like poetry only builds poetry wheel files - BUT - the pyproject.toml can be used by other tools to build a wheel file - e.g. https://github.com/pypa/build - which do honor the build-backend content

0reactions
bsvedincommented, Dec 9, 2021

I also realized that non-existent requires as well as non-existent build-backend are not checked. I opened issue https://github.com/python-poetry/poetry/issues/4871 with them. I appreciate you looking at this so quickly. I think it must be on their end as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Best way to build a frozen dependencies Python wheel package
I would like to know the best way to build a python package (using poetry) but with all its dependencies frozen. And yes,...
Read more >
Poetry - Python dependency management and packaging ...
Easily build and package your projects with a single command. ... Supports source distribution and wheels. Share your work. Publish. Make your work...
Read more >
poeblix - PyPI
Poetry plugin that adds support for building wheel files using the poetry.lock file, and data_files just like in setup.py.
Read more >
Configure a Poetry environment | PyCharm Documentation
Project dependencies are recorded in the pyproject.toml file that specifies required packages, scripts, plugins, and URLs. See the pyproject reference for more ...
Read more >
Package Python Projects the Proper Way with Poetry
Create a Python Project with Poetry. Enough with the foreplay, let's see how Poetry streamlines not only dependency management but nearly ...
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