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?

Path csiph.com!news.samoylyk.net!weretis.net!feeder8.news.weretis.net!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Stuart Prescott <stuart@debian.org>
Newsgroups linux.debian.maint.python
Subject Re: How do you create entry-points for Python applications?
Date Tue, 20 Dec 2022 01:10:01 +0100
Message-ID <FEymJ-bPjW-11@gated-at.bofh.it> (permalink)
References <FE7mx-byMF-7@gated-at.bofh.it> <FEa14-bAw0-9@gated-at.bofh.it> <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>
X-Mailbox-Line From debian-python-request@lists.debian.org Tue Dec 20 00:09:48 2022
Old-Return-Path <stuart.debian@nanonanonano.net>
X-Amavis-Spam-Status No, score=-5.15 tagged_above=-10000 required=5.3 tests=[BAYES_00=-2, BODY_8BITS=1.5, FOURLA=0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, LDO_WHITELIST=-5, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001] autolearn=ham autolearn_force=no
X-Policyd-Weight NOT_IN_SBL_XBL_SPAMHAUS=-1.5 CL_IP_EQ_HELO_IP=-2 (check from: .nanonanonano. - helo: .mail-pf1-f180.google. - helo-domain: .google.) FROM/MX_MATCHES_HELO(DOMAIN)=-2; rate: -5.5
X-Gm-Message-State ANoB5pl2Iay/toQ5zR9I7b0ncUwB6KV3Q5dqixLsNQqpovV+skvQyM9J qlXzd+zphbUtTEt7qN02Wo0MWNeZ8PveSbnE
X-Google-SMTP-Source AA0mqf6xkW9QOk5hj62HwFOxsKUXfVyMqFs9hHsmTFJ1AiwKLnDi9jDm+7UTjXg4xUF1r+oNpB0hrw==
X-Received by 2002:a05:6a00:8cf:b0:56c:361c:a9af with SMTP id s15-20020a056a0008cf00b0056c361ca9afmr57950136pfu.10.1671494965396; Mon, 19 Dec 2022 16:09:25 -0800 (PST)
MIME-Version 1.0
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0
Content-Language en-GB
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 8bit
X-Mailing-List <debian-python@lists.debian.org> archive/latest/20626
List-ID <debian-python.lists.debian.org>
List-URL <https://lists.debian.org/debian-python/>
List-Archive https://lists.debian.org/msgid-search/c61a54cb-8fe6-3f91-6505-1d5a5fd15f09@debian.org
Approved robomod@news.nic.it
Lines 48
Organization linux.* mail to news gateway
Sender robomod@news.nic.it
X-Original-Date Tue, 20 Dec 2022 11:09:20 +1100
X-Original-Message-ID <c61a54cb-8fe6-3f91-6505-1d5a5fd15f09@debian.org>
X-Original-References <385ec8ae34ef53f01a86b49c0f15504f@posteo.de> <D98B9DF7-DD0F-499E-A16D-CA85A51249B9@ubuntu.com> <e3d36b800a02b1ddd1d38c3f21b982a5@posteo.de> <A3FE81D0-7EE0-4CBC-A12A-B29F98CD1C7C@kitterman.com> <0b3389c79879f9ed7172cd1bac539406@posteo.de> <B2B72495-41E3-43F8-82C7-67449D7EC986@kitterman.com> <BFF75D11-3D5A-4FAC-8809-5F6F5BEB0401@ubuntu.com>
Xref csiph.com linux.debian.maint.python:14759

Show key headers only | 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