Questions about packaging a python package

Hello,

We are using Fedora (Silverblue 33) at the family laptop. To avoid data duplication I have created a common folder to which I 've given access to all users. This setup came with some problems that led
me to create the Folder Custodian package to address them.

When I showed it in ask-fedora it was suggested that I package it in COPR, which I did here.

While I figured out most things there are some I am still getting wrong.

The key question is that I cannot run the packages unit tests when requesting builds. I 've tried some things but they all failed. The key complication is that the package tests changing group ownership and that may or may not be possible to happen in the build environment. Any pointers on that would be appreciated.

P.S. I naively thought that, since I use python, I 'd be able to have both x86_64 and aarch64 support. Somehow the aarch64 builds fail. I haven’t had time to debug them yet so it may be something easy. Any pointers here would also be appreciated, but I do prioritize getting information about how to run the tests during a build.

1 Like

Yeah, if the unit tests require root permissions, that’s problematic. Is it possible to break out those tests so they can be skipped?

The tests themselves don’t require root permissions. I 've explicitly left out of the package’s scope anything requiring root to avoid introducing security issues.

However setting up the environment for the package to run after installation, or to run the tests requires root permissions. I 've solved thisat GitHub by requiring the CI step to use a custome docker image and run the tests in there.

I can remove the tests that require this special environment. The remaining tests however would only test minimal supported functionality.

It may well be that this use case is not supported by the package build infrastructture. The tests basically need the user running them to also belong to a second, currently hardcoded, group so they can test changing group ownership from the default to that. Don’t know if there’s a way to do that.

Ah, so – maybe what you want is this: https://docs.fedoraproject.org/en-US/ci/ ?

I 'll read about fedora CI, but not immediately. I m using GitHub actions for CI atm so that part is covered.

It looks like it’s best to defer running the tests when creating an rpm for now.