[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

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





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


Reply to: