Skip to main content

checkup-git

Git repository metrics plugin for checkup.

Installation

pip install checkup-git

Requirements

  • Python >= 3.12
  • checkup
  • Git installed on the system

Usage

from checkup import CheckHub
from checkup_git import (
    GitProvider,
    GitDaysSinceLastUpdateMetric,
    GitTrackedFileCountMetric,
)

results = (
    CheckHub()
    .with_metrics([
        GitDaysSinceLastUpdateMetric(),
        GitTrackedFileCountMetric(),
    ])
    .with_providers([[
        GitProvider("./my_repo"),
    ]])
    .measure()
)

Provider

GitProvider

Extracts metadata from a git repository, including the last commit date and list of tracked files.

Available Metrics

GitDaysSinceLastUpdateMetric

Returns the number of days since the last git commit.

GitTrackedFileCountMetric

Returns the number of git tracked files, optionally filtered by a glob pattern. Configure by subclassing:

from checkup_git import GitTrackedFileCountMetric

class PythonTestFileCountMetric(GitTrackedFileCountMetric):
    name = "python_test_file_count"
    description = "Number of Python test files"
    pattern = "tests/test_*.py"

Creating Custom Metrics

Extend GitMetric to create custom git-based metrics:

from checkup_git import GitMetric

class MyCustomGitMetric(GitMetric):
    name = "my_custom_metric"
    description = "My custom git metric"

    def calculate(self, context, measurements):
        git_context = self.get_context(context)
        tracked_files = git_context.get("git_tracked_files", [])
        python_files = [f for f in tracked_files if f.endswith(".py")]
        return self.measure(value=len(python_files))

Metadata

Release files for checkup-git 0.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for checkup-git 0.4.2
File Size Uploaded
checkup_git-0.4.2.tar.gz 4.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for checkup-git 0.4.2
File Interpreter ABI Platform
checkup_git-0.4.2-py3-none-any.whl Python 3 none any Details

Total release size: 8.7 kB

Release files / checkup_git-0.4.2.tar.gz

Download URL checkup_git-0.4.2.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
7d6d2b41a45c108bf671db56a5882532ceadc1bf7b6711aa52cedf52baa7de35
BLAKE2b-256 checksum
How to use checksums
9a4a2bccb1bfe0d79af1cefcd4fec3187b15e03e8276b4b54710715dbc743136
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / checkup_git-0.4.2-py3-none-any.whl

Download URL checkup_git-0.4.2-py3-none-any.whl
Size 4.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1f535ab5fd861bf5a388d53643cb0f529a8782217fc943b2131ec5a409ced34b
BLAKE2b-256 checksum
How to use checksums
41c184ec26756aa74a3cfc74dc80a64f99e1de8949c2261b65f81e126923b28d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.4.2 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page