Skip to content

Repository files navigation

Rift

Rift is a tool to manage RPM packages development effectively during their complete lifecycle. It provides commands to perform the following actions:

  • Creating new packages, either from scratch or imported from existing sources.
  • Maintain and updates packages.
  • Launch and report automatic advanced integration and functional tests.

The tests are performed in virtual machines for more isolation and provide more flexibility in the tests environments.

Tests

To run the unit tests and static analysis, some dependencies are required:

$ dnf -y install python3-pip python3-jinja2 python3-PyYAML python3-rpm python3-dnf python3-pytest python3-pytest-cov sudo rpm-sign rpmlint openssh-clients genisoimage qemu qemu-user qemu-img qemu-virtiofsd mock createrepo_c python3-yaml python3-xmltodict python3-boto3 pylint

We recommand the use of Fedora as developpement environnement.

Run this command for static source code linting:

$ pylint lib/rift

Run this command to run unit tests:

$ pytest

Pytest is configured in pyproject.toml and in pytest.ini files.

Important

Unit tests download virtual machine images from the Internet. The unit tests use the value of https_proxy environment variable as the Rift proxy configuration parameter, if this variable is defined in your environment. If you do not have direct access to Internet, you must define this environment variable with your network's proxy server to run the tests successfully.

Formatting

Python code is formatted with Ruff. Install it with either:

$ pip install ruff
$ uv tool install ruff

Format and sort imports manually with:

$ ruff check --fix lib tests && ruff format lib tests

prek runs Ruff plus generic file checks (trailing whitespace, end-of-file newlines, YAML/TOML syntax, merge-conflict markers, LF line endings) as a git commit hook and in CI on every push and pull request to master. Install it with either:

$ pip install prek
$ uv tool install prek

Then enable the commit hook:

$ prek install

Or run all hooks on the whole tree with:

$ prek run --all-files

About

A tool to build and validate packages and make your own RPM based repository

Resources

Stars

3 stars

Watchers

11 watching

Forks

Releases

Packages

Contributors

Languages