Nuitka: Nuitka fails to install with poetry and python > 3.9

Before submitting an Issue, please review the Issue Guidelines.

  • Please check whether the bug was already reported or fixed ✔️

  • Please check out if the develop version of Nuitka works better for you. ✔️

  • Nuitka version, full Python version, flavor, OS, etc. as output by this command.

❯ python -m nuitka --version
1.5.5
Commercial: None
Python: 3.10 | packaged by conda-forge | (main, Feb  1 2023, 21:38:11)
Flavor: Anaconda Python
Executable: /Users/user/miniforge3/envs/project/bin/python
OS: Darwin
Arch: arm64
  • How did you install Nuitka and Python Via poetry
❯ poetry --version
Poetry (version 1.4.2)
❯ poetry show nuitka
 name         : nuitka
 version      : 1.5.5
 description  : Python compiler with full language support and CPython compatibility

dependencies
 - orderedset >=2.0.3
 - subprocess32 *

When installing the package, the package fails to build orderset, with the error below.

lib/orderedset/_orderedset.c:17344:19: error: call to undeclared function '_PyGen_Send'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
              ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
                    ^
  lib/orderedset/_orderedset.c:17344:17: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
              ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
                  ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  lib/orderedset/_orderedset.c:17349:19: error: call to undeclared function '_PyGen_Send'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
              ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
                    ^
  lib/orderedset/_orderedset.c:17349:17: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
              ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
                  ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  lib/orderedset/_orderedset.c:17433:19: error: call to undeclared function '_PyGen_Send'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
              ret = _PyGen_Send((PyGenObject*)yf, NULL);
                    ^
  lib/orderedset/_orderedset.c:17433:17: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
              ret = _PyGen_Send((PyGenObject*)yf, NULL);
                  ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  17 warnings and 3 errors generated.
  error: command '/usr/bin/clang' failed with exit code 1

orderset is no longer supported and it does not build on python > 3.9.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 20 (12 by maintainers)

Most upvoted comments

This is part of the hotfix release 1.5.7 that I just made. It’s going to hit commercial tomorrow probably.

I did some further investigation on the Poetry side.

In order to extract requirements, Poetry

  1. searches for Requires-Dist entries in PKG-INFO (and doesn’t find any)
  2. searches for a requires.txt (and will not find one)
  3. tries to parse setup.py (and fails because install_requires is not a fix list)
  4. triggers a PEP517 build and thereby gets a requires.txt that contains only the requirements of poetry’s Python version and platform (without markers)

(It stops if it finds at least one entry in one of the sources.)

Thus, no requires.txt is better than before, at least if Poetry’s environment and the target environment(s) are “similar enough”. (The optimum for Poetry would be a PKG-INFO (or requires.txt) with all requirements including environment markers.)

Considering that the specific requirements of Nuitka are platform independent for Python >= 3.7 (i.e. for all Python versions that have not yet reached their EOL) that might be sufficient for the typical Poetry user.

By the way, if you want to see what Poetry will deduce, you can run:

from pathlib import Path
from poetry.inspection.info import PackageInfo
print(PackageInfo.from_sdist(Path("Nuitka-1.5.6.tar.gz")).requires_dist)

So, I removed requires.txt which had no bad effect on newer pip at least, the file seems unused for pip install.

>>> pkginfo.SDist("dist/Nuitka-1.6rc0.tar.gz").requires
()
>>> pkginfo.SDist("dist/Nuitka-1.6rc0.tar.gz").requires_dist
()

From the looks of that code, that should make peotry happy, but not know about the platform specific dependencies. It sounds like poetry doesn’t like that anyway. My main issue is that I do not know what else is actually using requires.txt and maybe old pip is in fact using that. But I believe for pip in all versions, this file is ignored, and it’s only a metadata being recorded from during the runtime of the sdist creation, in which case it’s probably fine if that is empty.