Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.python > #14759

Re: How do you create entry-points for Python applications?

From Stuart Prescott <stuart@debian.org>
Newsgroups linux.debian.maint.python
Subject Re: How do you create entry-points for Python applications?
Date 2022-12-20 01:10 +0100
Message-ID <FEymJ-bPjW-11@gated-at.bofh.it> (permalink)
References (2 earlier) <FEgJb-bEro-1@gated-at.bofh.it> <FEgSR-bEzJ-5@gated-at.bofh.it> <FEhOV-bF8f-1@gated-at.bofh.it> <FEihX-bFhP-1@gated-at.bofh.it> <FEo41-bIWk-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



On 20/12/2022 00:09, Danial Behzadi دانیال بهزادی wrote:
>  > The only package I maintain that I can think of at the moment with 
> entrypoints and project.toml is too complicated to be a good example.
> 
> That shouldn't be so much different from setup.py projects and there are 
> plenty of them in archive.

In general, the Debian tooling installs the package and so the upstream 
build system should generate the entry points scripts no matter which 
approach is used.

There are some differences to be aware of:

If the pybuild 'distutils' plugin is used (i.e. with a setup.py 
project), then the entry points will be created at the "install" step 
and should land in debian/*/usr/bin; you may need to move them into the 
right binary package.

If the pybuild 'pyproject' plugin is used (i.e. with a pyproject.toml 
project), then the entry points will be created in the "build" step. 
They will land in the pybuild {home_dir}/scripts directory and be 
available to the "test" target in PATH for any cli tests that are in the 
test suite. They will get copied into debian/*/usr/bin during the 
"install" step and you may need to move them into the right binary package.

The main things that the packager needs to be aware of are:

* the packaging needs to move the entry points scripts into the correct 
binary package; that might be a debian/package.install file or it might 
be a mv in debian/rules.

* make sure there's a tight enough dependency between the package that 
contains the entry points scripts and the package that contains the 
modules; the entry points scripts include exact versioning on the 
upstream version of the module and if the binary packages don't have 
dependencies that enforce that requirement, the entry points script can 
fail at run time for the user. («python3-foo (= ${binary:Version})» 
should be ok for packages that are only arch:all).

cheers
Stuart

-- 
Stuart Prescott   http://www.nanonanonano.net/ stuart@nanonanonano.net
Debian Developer  http://www.debian.org/       stuart@debian.org
GPG fingerprint   90E2 D2C1 AD14 6A1B 7EBB 891D BBC1 7EBB 1396 F2F7

Back to linux.debian.maint.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

How do you create entry-points for Python applications? c.buhtz@posteo.jp - 2022-12-18 20:20 +0100
  Re: How do you create entry-points for Python applications? Danial Behzadi دانیال بهزادی <dani.behzi@ubuntu.com> - 2022-12-18 23:10 +0100
    Re: How do you create entry-points for Python  applications? c.buhtz@posteo.jp - 2022-12-19 06:20 +0100
      Re: How do you create entry-points for Python applications? Scott Kitterman <debian@kitterman.com> - 2022-12-19 06:30 +0100
        Re: How do you create entry-points for Python  applications? c.buhtz@posteo.jp - 2022-12-19 07:30 +0100
          Re: How do you create entry-points for Python applications? Scott Kitterman <debian@kitterman.com> - 2022-12-19 08:00 +0100
            Re: How do you create entry-points for Python applications? Danial Behzadi دانیال بهزادی <dani.behzi@ubuntu.com> - 2022-12-19 14:10 +0100
              Re: How do you create entry-points for Python applications? Stuart Prescott <stuart@debian.org> - 2022-12-20 01:10 +0100
  Re: How do you create entry-points for Python applications? Andrey Rahmatullin <wrar@debian.org> - 2022-12-19 14:40 +0100

csiph-web