Hi gabber,
On 12/2/24 16:46, Gabriel Wicki wrote:
Hi there!
I have created a Python application that seems to build just fine (using
a pyproject.toml file and the hatchling build system, by invoking
`python3 -m build`), including script entrypoints and everything.
Unfortunately I am not as lucky with my Guix packaging attempts. My
Python project creates a wheel and a tar.gz dist file with the
corresponding entry_points.txt file, but the pyproject-build-system's
create-entrypoints phase does not seem to pick it up. Making the guix
build fail I see that no entry_points.txt makes its way into the build
process. Am I doing it wrongly? Am I missing something? Is this a
known issue?
Thanks for any and all pointers leading me further down the path
gabber
I worked on packaging some software with pyproject-build-system recently and may
have encountered a similar issue with a fix you can try.
My conclusion was that pyproject-build-system expects a certain format when
parsing entrypoints, and drops any that do not match it. In my case, the
entrypoint in my pyproject.toml appeared to be ignored because a colon ":" is
always expected in the format. My original intention was for the module itself
to be executed, but the build system seems to only accept entrypoints that call
a function via a format like "MODULE[.SUBMODULE]:FUNCTION".
If you want to have a look at the code itself and the exact regexp(s), the
parsing for entrypoints happens in (guix build pyproject-build-system):
<https://git.savannah.gnu.org/cgit/guix.git/tree/guix/build/pyproject-build-system.scm#n284>
Cheers,
aurtzy