|
| 1 | +--- |
| 2 | +description: Makefile-based development workflow for Python projects using Poetry |
| 3 | +globs: ["Makefile", "pyproject.toml", "**/*.py"] |
| 4 | +alwaysApply: true |
| 5 | +--- |
| 6 | + |
| 7 | +# Python Project Development Workflow |
| 8 | + |
| 9 | +## Available Makefile Targets |
| 10 | + |
| 11 | +### Setup |
| 12 | +- `make setup-init` - Complete first-time setup (configure venv, lock, install all deps) |
| 13 | +- `make setup-venv` - Configure Poetry to use .venv in project directory |
| 14 | + |
| 15 | +### Installation |
| 16 | +- `make install` - Install main dependencies only |
| 17 | +- `make install-dev` - Install main + dev dependencies |
| 18 | +- `make install-test` - Install main + test dependencies |
| 19 | +- `make install-all` - Install all dependencies (main + dev + test) |
| 20 | + |
| 21 | +### Dependency Management |
| 22 | +- `make lock` - Regenerate poetry.lock from pyproject.toml |
| 23 | +- `make update-deps` - Update dependencies to latest compatible versions |
| 24 | + |
| 25 | +### Testing |
| 26 | +- `make test` - Run unit tests without coverage |
| 27 | +- `make test-with-coverage` - Run unit tests with coverage reporting |
| 28 | + |
| 29 | +### Code Quality |
| 30 | +- `make lint-python` - Lint Python code with flake8 |
| 31 | +- `make lint-yaml` - Lint YAML files with yamllint |
| 32 | +- `make format-python` - Format Python code with black |
| 33 | +- `make pre-commit` - Run all quality checks (format, lint, test) |
| 34 | + |
| 35 | +### Build |
| 36 | +- `make build` - Build the Python package |
| 37 | + |
| 38 | +### Cleanup |
| 39 | +- `make clean` - Clean test artifacts, build artifacts and temporary files |
| 40 | +- `make clean-all` - Clean everything including virtual environment |
| 41 | + |
| 42 | +### Help |
| 43 | +- `make help` - Show all available targets |
| 44 | + |
| 45 | +## Project Setup |
| 46 | + |
| 47 | +**Quick Start:** |
| 48 | +```bash |
| 49 | +make setup-init # Complete first-time setup |
| 50 | +make test-with-coverage # Verify installation |
| 51 | +``` |
| 52 | + |
| 53 | +## Python Environment |
| 54 | +- **Poetry** - Dependency management |
| 55 | +- **Python 3.11+** - Minimum version (supports 3.11, 3.12, 3.13) |
| 56 | +- **`.venv/`** - Virtual environment (project-local) |
| 57 | +- **Dependencies** in `pyproject.toml`: |
| 58 | + - Main: requests |
| 59 | + - Test: pytest, pytest-cov, pytest-mock, pytest-gitignore, coverage, mock, flake8 |
| 60 | + - Dev: setuptools, wheel, yamllint, black |
| 61 | + |
| 62 | +## Development Workflow |
| 63 | + |
| 64 | +**Daily development:** |
| 65 | +```bash |
| 66 | +# 1. Make code changes |
| 67 | +# 2. Run all quality checks before committing |
| 68 | +make pre-commit # Format, lint, and test everything |
| 69 | +# Or run individual checks: |
| 70 | +make format-python # Auto-format |
| 71 | +make lint-python # Lint Python |
| 72 | +make lint-yaml # Lint YAML |
| 73 | +make test-with-coverage # Test with coverage |
| 74 | +make clean # Remove artifacts |
| 75 | +``` |
| 76 | + |
| 77 | +## Project Structure |
| 78 | +- Main package: `ssllabsscan/` |
| 79 | +- Tests: `tests/` |
| 80 | +- CLI entry point: `ssllabs-scan` (defined in pyproject.toml) |
| 81 | +- Configuration: `pyproject.toml` |
| 82 | + |
| 83 | +## CLI Tool Usage |
| 84 | +After installation with `poetry install` or `pip install .`: |
| 85 | +```bash |
| 86 | +ssllabs-scan # Main CLI tool |
| 87 | +ssllabs-scan --help # Show help |
| 88 | +``` |
0 commit comments