Fast Python syntax and import checker 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 onlyimports [paths...]- Check import dependencies onlyinstall-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:
- Full README - Complete guide with examples
- Usage Guide - Detailed usage and configuration
- Validation Docs - Check documentation with examples
- 中文文档 - Traditional Chinese
- 简体中文 - Simplified Chinese
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
- Homepage: https://github.com/coseto6125/pyci-check
- Documentation: https://github.com/coseto6125/pyci-check/blob/main/docs/en/USAGE.md
- Bug Reports: https://github.com/coseto6125/pyci-check/issues
- Changelog: https://github.com/coseto6125/pyci-check/releases
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.2.0.tar.gz
(97.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyci_check-0.2.0.tar.gz.
File metadata
- Download URL: pyci_check-0.2.0.tar.gz
- Upload date:
- Size: 97.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
109d0db740c7e3db682f8e64fceb06be84e91acd2215aaa64e11d4835b13c6ef
|
|
| MD5 |
837c26d6d3ea1c2cfaf6edf714769638
|
|
| BLAKE2b-256 |
6312b21b5619c9029a738414850d302469b65a19a66c655b24f5507b4e8c1f99
|
File details
Details for the file pyci_check-0.2.0-py3-none-any.whl.
File metadata
- Download URL: pyci_check-0.2.0-py3-none-any.whl
- Upload date:
- Size: 34.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a675d2d125219dc486ed393ba4e08b8b76c533fb26b5375e5fe0e40ae9da26e
|
|
| MD5 |
ed8328e302d423bd941f3fdf46414b01
|
|
| BLAKE2b-256 |
c5b7ae017de75fad5bf83fadc774efe1cc17f2ad9929bd602b79935a97a203d1
|