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 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: References: X-Mailbox-Line: From debian-python-request@lists.debian.org Tue Dec 20 00:09:48 2022 Old-Return-Path: 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: archive/latest/20626 List-ID: List-URL: 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: X-Original-References: <385ec8ae34ef53f01a86b49c0f15504f@posteo.de> <0b3389c79879f9ed7172cd1bac539406@posteo.de> Xref: csiph.com linux.debian.maint.python:14759 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