On 29. 08. 20 13:55, Alex Corcoles wrote:
Hi,
Hi Alex.
I'm dabbling in writing a small Python application (further details below to provide some context). This application:
- Has no dependencies other than the Python standard library
- Makes only sense to be installed using your distribution's package manager
Why? This is a requirement I don't understand.
...
I would like:
- Making it easy for developers to hack in the package. They should be able to use any Linux system to develop. I would provide scripts using containers (podman/docker) to run tests and create packages for all supported distros.
Making it pip installable makes it very easy to run. Using poetry makes it very easy to hack on.
- Keep the packaging in the main source Git repo
The RPM packaging or the Python (pip/poetry packaging)?
- Packaging should be fully automatized in CI/CD. All commits should generate packages for all supported distros (with a timestamped version) and push it to a repo (I would use COPR, ppa, etc.). Latest master should be easily installable using dnf, other branches should be easily installable for testing purposes.
That should be easily achievable with pip-installable packages with the help of setuptools_scm (possibly poetry also has something like this). Not sure about dnf/rpm packages. Copr has some CI abilities.
...
My questions (as a relative noob to RPM packaging- I've created and automated some RPM packaging, but mostly by winging it):
- Is any of the above a terrible idea I should reconsider?
That depends on the answer for my main question.
- Is there any project out there with similar goals doing things "correctly" I could "copy"?
I don't know any Python project with automatic Copr builds from git, but maybe look at a non-Python one?
https://copr.fedorainfracloud.org/coprs/dcantrell/rpminspect/package/rpminsp... https://github.com/rpminspect/rpminspect/blob/master/.copr/Makefile
- pyproject-rpm-macros looks like something useful for what I want to do, can it be used on to package for EL8? (I only see Fedora branches)
It cannot. pyproject-rpm-macros heavaily relies on technology not yet (fully) available in EPEL 8 which is unfortunately now an ancient distribution when it comes to leading edge stuff :(
- RPM buildrequires generators are missing (old RPM) - new Python RPM dependency generators would have to be backported ideally with parametric generators from Fedora 33+'s RPM - RHEL 8 has an ancient pip version 9, it might work, however nobody was brave enough to try it) - tox 3.13+ is needed (EPEL 8 has tox 3.4) for %tox