Skip to content

Latest commit

 

History

History
119 lines (79 loc) · 2.86 KB

File metadata and controls

119 lines (79 loc) · 2.86 KB

Contributing to RPMeta

Thank you for your interest in contributing to RPMeta! This document provides guidelines and information for contributors to the project.

Table of Contents

Development Setup

Prerequisites

  • Python 3.10 or higher
  • Docker or Podman (for containerized testing)
  • Just command runner (for automation)

Setting Up Your Development Environment

  1. Clone the repository:

    git clone https://github.com/fedora-copr/rpmeta.git
    cd rpmeta
  2. Install pre-commit hooks (optional but recommended):

    pip install pre-commit
    pre-commit install

Testing

RPMeta uses pytest for testing.

Running Tests Locally

To run tests locally in your development environment:

# Run all tests
pytest

# Run specific test categories
pytest test/unit
pytest test/integration
pytest test/e2e

Running Tests in Containers

The project uses the just command runner to automate testing in containers, which ensures consistent testing environments. Run:

just --list

to see every recipe available, including its documentation. You can run tests, manage versioning and build testing or experimenting containers with it.

Code Style and Linting

The project uses pre-commit hooks for code style enforcement, linting, and formatting. Configuration is defined in .pre-commit-config.yaml.

Rather than running linting tools directly, you should use pre-commit:

# Run pre-commit on all files
pre-commit run --all-files

# Run pre-commit on staged files only
pre-commit run

Pre-commit will automatically run these checks in isolated environment before each commit if you've installed the hooks as described in the setup section.

If you need to bypass the hooks for a particular commit (not recommended for normal development, you'll still need to fix it in PR):

git commit -m "Your message" --no-verify

Version Management

The canonical version is defined in rpmeta/__init__.py as the __version__ variable. All other files (like pyproject.toml and the spec file) reference this version.

To check the current version:

python scripts/update_version.py

# or using the just target
just version-get

To update the version across all files:

python scripts/update_version.py NEW_VERSION

# or using the just target
just version-set NEW_VERSION

For example:

just version-set 0.2.0

Creating a Release

  1. Update the version number as described in Version Management, commit and push the new version.
  2. Create a new release on GitHub with release notes.
  3. The CI/CD pipeline will build and publish the package to PyPI and Copr.