Skip to main content

A Python-native CI/CD framework for defining, testing, and transpiling pipelines.

Project description

logo_pygha_dark

A Python-native CI/CD framework for defining, testing, and transpiling pipelines to GitHub Actions.

Read the Full Documentation


CI Status Documentation Status Coverage Lint (Ruff) Type Check (mypy) Security (Bandit) License


Example: Define a CI Pipeline with pygha

Below is an example of a Python-defined pipeline that mirrors what most teams use in production —
build, lint, test, coverage, and deploy — all orchestrated through pygha.

from pygha import job, default_pipeline
from pygha.steps import shell, checkout

# Define a default pipeline that triggers on main and dev branches,
# and on pull requests to main.
default = default_pipeline(
    on_push=['main', 'dev'],
    on_pull_request='main'
)

@job(name='lint')
def lint():
    """Static analysis and style checks."""
    checkout()
    shell('pip install -U pip ruff mypy')
    shell('ruff check .')
    shell('mypy src')

@job(name='build', depends_on=['lint'])
def build():
    """Build the package."""
    checkout()
    shell('pip install -U build')
    shell('python -m build')

@job(name='test', depends_on=['build'])
def test():
    """Run unit tests with coverage."""
    checkout()
    shell('pip install -e .[dev]')
    shell('pytest --cov=src --cov-report=xml')

@job(name='deploy', depends_on=['test'])
def deploy():
    """Deploy to PyPI when pushing a tagged release."""
    checkout()
    shell('pip install twine')
    shell('if [[ "$GITHUB_REF" == refs/tags/* ]]; then twine upload dist/*; fi')

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

pygha-0.1.0.tar.gz (42.6 kB view details)

Uploaded Source

Built Distribution

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

pygha-0.1.0-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file pygha-0.1.0.tar.gz.

File metadata

  • Download URL: pygha-0.1.0.tar.gz
  • Upload date:
  • Size: 42.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pygha-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b0286bd2e2d99317eee3a7a807a3db5b243ddc6037305f4a35d8274753367c2f
MD5 50e1464fb2d25651d4aff8c970dcbd5c
BLAKE2b-256 177c35495b566c372fc6f86a7f0c83a7ec97b71a3f73470cf70d6b306905737f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygha-0.1.0.tar.gz:

Publisher: publish_pypi.yml on parneetsingh022/pygha

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pygha-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pygha-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pygha-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ffad594cbf9eda9b3a8c48f97f3530c71aec44994c41f1d69e11007b94447fa3
MD5 4c6842125ce1b06f72bbd1a2c59a45f1
BLAKE2b-256 617e8c38f7aca81695c47120ccf9ba67f37059a1e026ca8fb9c73c335cb5b516

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygha-0.1.0-py3-none-any.whl:

Publisher: publish_pypi.yml on parneetsingh022/pygha

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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