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.2.tar.gz (963.5 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.2-py3-none-any.whl (99.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for cikit-0.0.2.tar.gz
Algorithm Hash digest
SHA256 c76e2dbd78bc4fc7767e2621dc01e840bafed24ce306dac79a958d28daad4532
MD5 c6047496ce8bd07473ecbccc4b5e1b15
BLAKE2b-256 8fc8bf675706800a286cf7488f3fd1b92e7ae613c5b027e56625e62cd1cc751b

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for cikit-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bca689cc7f6aefd8eba949ee359141413419042fe3509639b8488ee53d1cb1bb
MD5 fae5a78e92ecbd99eef72f027d1e717b
BLAKE2b-256 908b109c8fcd9a76011f92bea40f3456181852eca46c36ade225d4c5076649c9

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