Skip to main content

CI helper toolkit

Project description

cikit

cikit is a lightweight Python toolkit for building reproducible CI/CD pipelines.

It provides reusable building blocks for:

  • CI environment handling
  • provider abstraction (GitLab and local execution)
  • command execution
  • test execution and coverage reporting
  • lint integration (Ruff, Pylint)
  • Sphinx documentation generation
  • artifact management
  • badge generation
  • project metadata handling
  • build and pipeline reporting

The package is designed for projects that want to keep CI logic in Python instead of large shell scripts or complex YAML definitions.

Features

Environment Management

Resolve CI variables from multiple sources:

  • operating system environment
  • CI provider
  • project defaults
  • template expansion using ${VAR} syntax
from cikit.env import CiEnvironment

env = CiEnvironment()
print(env["PROJECT_ROOT"])
print(env["PIPELINE_ID"])

Command Execution

Run external tools with:

  • live output streaming
  • timeout handling
  • structured result objects
  • graceful process termination
from cikit.command import run_command

result = run_command(["pytest"])
result.check_returncode()

Lint Integration

Generate machine-readable and human-readable reports from:

  • Ruff
  • Pylint

Reports can be converted into reStructuredText and published as documentation artifacts.

Testing and Coverage

Built-in helpers for:

  • pytest execution
  • JUnit XML generation
  • coverage collection
  • Cobertura reports
  • CI summaries

Documentation Generation

Integrates with Sphinx and automatically publishes:

  • generated RST files
  • badges
  • coverage reports
  • build artifacts

Generated content can be included directly in project documentation.

Project Metadata

Read project information from:

  • pyproject.toml
  • cikit.toml

Generate version files and metadata artifacts from a unified project model.

Job Data and Metrics

Optional integration with the JobData backend allows pipelines to store:

  • build results
  • quality metrics
  • coverage values
  • historical trends

This data can be used to generate badges and timeline charts across multiple pipeline runs.

Installation

pip install cikit

or with uv:

uv add cikit

Quick Example

from cikit.env import CiEnvironment
from cikit.logging_utils import setup_logging
from cikit.command import run_command

setup_logging()

env = CiEnvironment()

result = run_command(
    ["pytest"],
    cwd=env["PROJECT_ROOT"],
)

result.check_returncode()

Typical Project Structure

project/
├── docs/
├── src/
├── tests/
├── pyproject.toml
└── public/
    ├── artifacts/
    ├── badges/
    └── rst/

Design Goals

  • Pure Python implementation
  • CI-provider abstraction
  • Reproducible builds
  • Local execution without CI infrastructure
  • Testability
  • Minimal external dependencies
  • Sphinx-friendly reporting
  • GitLab-oriented, but not GitLab-exclusive

Documentation

The full documentation contains:

  • CI environment reference
  • command execution API
  • lint reporting
  • testing helpers
  • Sphinx integration
  • JobData integration
  • artifact management
  • examples and recipes

License

GPL-3.0-or-later

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cikit-0.0.4.tar.gz (971.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cikit-0.0.4-py3-none-any.whl (107.3 kB view details)

Uploaded Python 3

File details

Details for the file cikit-0.0.4.tar.gz.

File metadata

  • Download URL: cikit-0.0.4.tar.gz
  • Upload date:
  • Size: 971.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.15

File hashes

Hashes for cikit-0.0.4.tar.gz
Algorithm Hash digest
SHA256 ef723c485a12902056f7e834e9b8a0cc41dd647a70cb5d54078288086a32e1b5
MD5 eb018475a0f24a6420dcc5fd63af5ef2
BLAKE2b-256 f7d7d001c83e84c7a480dffd051dc8a4d28654e446e16cff7908d892f1fde7b6

See more details on using hashes here.

File details

Details for the file cikit-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: cikit-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 107.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.15

File hashes

Hashes for cikit-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 8b4ab8fdfdb78babcea0bddc32a9fa38c56b5d7a781747af431c1758f8d806c5
MD5 b645fa3337e40e8f7e621c3ec03b4d21
BLAKE2b-256 e5f962bfdd8df1718978507cde2bf403ae94d875de4ef64d195907fca051cb9d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page