Thank you for your interest in contributing to AI CLI Preparation! This document provides guidelines and information for contributors.
- Python 3.9 or higher
- Git
- Make (optional, for convenience targets)
- Fork and clone the repository:
git clone https://github.com/your-username/ai_cli_preparation.git
cd ai_cli_preparation- Create a virtual environment:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate- Install development dependencies:
pip install -e ".[dev]"
# OR
pip install -r requirements-dev.txtRun the full test suite:
pytestRun with coverage:
pytest --cov=cli_audit --cov-report=term --cov-report=htmlRun specific test files:
pytest tests/unit/test_config.py
pytest tests/integration/test_e2e_install.pyRun tests in parallel:
pytest -n autoRun linting:
flake8 cli_audit testsRun type checking:
mypy cli_auditFormat code with black:
black cli_audit testsSort imports with isort:
isort cli_audit testsRun security checks:
bandit -r cli_audit
safety checkRun all quality checks before committing:
# Formatting
black cli_audit tests
isort cli_audit tests
# Linting
flake8 cli_audit tests
mypy cli_audit
# Tests
pytest --cov=cli_audit
# Security
bandit -r cli_audit
safety checkWe use GitHub Actions for CI/CD. The following workflows are configured:
Runs on every push and pull request to main and develop branches:
- Lint and Type Check: Runs flake8 and mypy
- Test Suite: Runs pytest on multiple OS (Ubuntu, macOS, Windows) and Python versions (3.9-3.12)
- Security Scan: Runs bandit and safety checks
- Build: Builds distribution packages
- Documentation: Validates README and config files
- Integration E2E: Tests CLI execution and programmatic API
Triggers on version tags (e.g., v2.0.0):
- Builds distribution packages
- Creates GitHub release with changelog
- Publishes to PyPI (if configured)
- Publishes to Test PyPI (manual trigger)
Automatically creates PRs for:
- Python dependency updates (weekly)
- GitHub Actions updates (weekly)
For full CI/CD functionality, configure these GitHub secrets:
PYPI_API_TOKEN: PyPI API token for publishing releasesTEST_PYPI_API_TOKEN: Test PyPI token for testing releasesCODECOV_TOKEN: Codecov token for coverage reports (optional)
-
Create a feature branch:
git checkout -b feature/your-feature-name
-
Make your changes:
- Write clear, concise commit messages
- Add tests for new functionality
- Update documentation as needed
- Follow the existing code style
-
Run quality checks:
black cli_audit tests isort cli_audit tests flake8 cli_audit tests pytest --cov=cli_audit
-
Push your branch:
git push origin feature/your-feature-name
-
Create a Pull Request:
- Provide a clear description of your changes
- Reference any related issues
- Ensure all CI checks pass
- Request review from maintainers
- Follow PEP 8 guidelines (enforced by flake8)
- Use type hints where possible
- Maximum line length: 127 characters
- Use black for formatting
- Use isort for import sorting
- Add docstrings to all public functions and classes
- Use Google-style docstrings:
def example_function(param1: str, param2: int) -> bool: """ Brief description of function. Args: param1: Description of param1 param2: Description of param2 Returns: Description of return value Raises: ValueError: Description of when this is raised """
- Write tests for all new functionality
- Aim for >80% code coverage
- Use descriptive test names:
test_install_python_tool_with_pipx - Use fixtures for common setup
- Mock external dependencies (network, filesystem)
ai_cli_preparation/
├── cli_audit/ # Main package
│ ├── __init__.py # Public API exports
│ ├── config.py # Configuration management
│ ├── environment.py # Environment detection
│ ├── installer.py # Installation logic
│ ├── bulk.py # Bulk operations
│ ├── upgrade.py # Upgrade management
│ ├── reconcile.py # Reconciliation
│ └── breaking_changes.py # Breaking change detection
├── tests/
│ ├── unit/ # Unit tests
│ └── integration/ # Integration tests
├── scripts/ # Installation scripts
├── claudedocs/ # Claude-specific documentation
├── .github/
│ └── workflows/ # CI/CD workflows
├── README.md
├── CONTRIBUTING.md
├── pyproject.toml # Package configuration
├── pytest.ini # Pytest configuration
├── mypy.ini # Mypy configuration
└── .flake8 # Flake8 configuration
We use Semantic Versioning:
- MAJOR: Breaking changes
- MINOR: New features (backward compatible)
- PATCH: Bug fixes
-
Update version in:
cli_audit/__init__.py(__version__)pyproject.toml(version)
-
Update CHANGELOG.md (if exists)
-
Commit changes:
git commit -am "chore: bump version to X.Y.Z" -
Create and push tag:
git tag -a vX.Y.Z -m "Release version X.Y.Z" git push origin vX.Y.Z -
GitHub Actions will automatically:
- Run CI checks
- Build distribution packages
- Create GitHub release
- Publish to PyPI (if configured)
- Open an issue for bug reports or feature requests
- Check existing issues and PRs before creating new ones
- Join discussions in GitHub Discussions (if enabled)
- Be respectful and inclusive
- Focus on constructive feedback
- Help create a welcoming environment for all contributors
By contributing, you agree that your contributions will be licensed under the MIT License.