Open JuneStepp opened 1 week ago
Compilation vs. source cannot find the metadata as it's only created when you install it. I don't know how poetry works, but I assume you cannot access it either when you run your code via poetry run python -m example
either, so how would Nuitka be able to do it.
That said, something about FATAL: Error, including metadata for distribution 'example' without including related package ''
seems wrong and you may in fact be able to access it, but ""
seems strange for the package name, might be a misdetection of some sorts.
This does work at runtime, because the package is installed in editable mode. This happens automatically with poetry. The pip equivalent is pip install --editable .
. See https://setuptools.pypa.io/en/latest/userguide/development_mode.html. The files that end up created within site-packages in this case are example.pth
and example-0.1.0.dist-info/
.
Ok, Nuitka finds them at compile time, the editable ones, but during relaunch the .pth
effects that give metadata, that is lost, which is sort of the bug there then. I will look into that, could be easy.
I'm trying to access my project's full metadata at runtime.
Running
poetry run python -m nuitka example --run
(the other options are in the code file) outputs:When not using
--include-distribution-metadata
, the output is:The behavior is the same when not using package mode. I've tired quite a few other variations without any success thus far. Is this how the main package's metadata is supposed to be accessed with Nuitka?
Versions
Python is installed from this PPA on Ubuntu 20.04. Nuitka is installed with the latest Poetry using their official installer in a virtualenv generated by Poetry. I tried both Nuitka 2.3.10 and develop.
Minimal Example
full_example.zip
example/__main__.py:
pyproject.toml: