Skip to main content

Fast Python syntax, import, and architecture checker designed for CI/CD and Git hooks

Project description

pyci-check

Fast Python syntax and import checker designed for CI/CD and Git hooks.

Features

  • High-performance parallel processing - Uses ThreadPoolExecutor
  • 🔍 Dual-layer checking - Syntax (AST) + Import (static/dynamic)
  • 🎯 Flexible scope - Check entire project, directories, or specific files
  • 🔧 Auto-integrates ruff config - Reads from pyproject.toml
  • 🪝 Git hooks support - Append mode, preserves existing hooks
  • 📦 Zero external dependencies - Uses only Python standard library
  • 🌐 Multi-language - English, Traditional Chinese, Simplified Chinese

Installation

pip install pyci-check

Or with uv (recommended):

# Preferred (adds to pyproject.toml)
uv add pyci-check

# Or direct install
uv pip install pyci-check

Quick Start

# Check entire project (syntax + import static analysis)
pyci-check check

# Check syntax only
pyci-check syntax

# Check imports (static, safe)
pyci-check imports

# Install Git pre-commit hook
pyci-check install-hooks

Main Commands

  • check [paths...] - Run all checks (syntax + import)
  • syntax [paths...] - Check Python syntax only
  • imports [paths...] - Check import dependencies only
  • install-hooks - Install Git hooks (append mode)
  • uninstall-hooks - Remove pyci-check's Git hooks

Common Options

  • --quiet - Reduce output
  • --fail-fast - Stop on first error
  • --venv PATH - Specify virtual environment
  • --i-understand-this-will-execute-code - Enable dynamic import checking

Configuration

Configure in pyproject.toml:

[tool.pyci-check]
language = "en"  # or "zh_TW", "zh_CN"
import-timeout = 30

# Auto-reads ruff config
[tool.ruff]
src = ["src", "tests"]
exclude = [".venv", "build", "dist"]

Documentation

Full documentation available on GitHub:

CI/CD Integration

GitHub Actions

- name: Check Python syntax and imports
  run: |
    pip install pyci-check
    pyci-check check

With ruff

pyci-check check      # Syntax + import checking
ruff check --fix        # Lint + auto-fix
ruff format             # Format

License

MIT License

Links

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

pyci_check-0.3.2.tar.gz (114.7 kB view details)

Uploaded Source

Built Distribution

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

pyci_check-0.3.2-py3-none-any.whl (50.1 kB view details)

Uploaded Python 3

File details

Details for the file pyci_check-0.3.2.tar.gz.

File metadata

  • Download URL: pyci_check-0.3.2.tar.gz
  • Upload date:
  • Size: 114.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyci_check-0.3.2.tar.gz
Algorithm Hash digest
SHA256 b01dd88a3dd1305cd77d71d273df3c1a3781f3725f26e6a9342512aa3f7a475a
MD5 13bbf727aba4386b77bd8e11fcf68b1b
BLAKE2b-256 1abc82580aeffd5c5ca75ec3e48a0daa433f9b13829befefd555f875f506833a

See more details on using hashes here.

File details

Details for the file pyci_check-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: pyci_check-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 50.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyci_check-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 208571f429b101839594fa69dd75178a4b0dc17305b6c845a9eb191e4390aa38
MD5 a59d0e051519d19f4a912ed2ca596b51
BLAKE2b-256 1d6bc68d634f0ee81ee22314f112aed94ee46d1e0ebbfdc8c7783e7e16bdb2db

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