unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* pyproject build (hatchling) with entry-points
@ 2024-12-02 21:46 Gabriel Wicki
  2024-12-02 23:05 ` aurtzy
  0 siblings, 1 reply; 2+ messages in thread
From: Gabriel Wicki @ 2024-12-02 21:46 UTC (permalink / raw)
  To: help-guix

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: pyproject build (hatchling) with entry-points
  2024-12-02 21:46 pyproject build (hatchling) with entry-points Gabriel Wicki
@ 2024-12-02 23:05 ` aurtzy
  0 siblings, 0 replies; 2+ messages in thread
From: aurtzy @ 2024-12-02 23:05 UTC (permalink / raw)
  To: Gabriel Wicki, help-guix

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-12-03  0:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-02 21:46 pyproject build (hatchling) with entry-points Gabriel Wicki
2024-12-02 23:05 ` aurtzy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).