From b9224dd0311f7b55c96d4adda012b38831c8b691 Mon Sep 17 00:00:00 2001 From: zanewalker Date: Mon, 5 Jan 2026 22:11:58 +0000 Subject: [PATCH] (Feat): Initial Commit. --- .coverage | Bin 0 -> 53248 bytes .gitignore | 15 + .python-version | 1 + CONTRIBUTING.md | 221 +++++++++ LICENSE | 21 + README.md | 359 ++++++++++++++ SETUP_GUIDE.md | 228 +++++++++ examples/basic_usage.py | 42 ++ examples/event_handling.py | 71 +++ pyproject.toml | 147 ++++++ src/fastapi_route_loader/__init__.py | 23 + src/fastapi_route_loader/container.py | 285 +++++++++++ src/fastapi_route_loader/events.py | 122 +++++ src/fastapi_route_loader/loader.py | 99 ++++ src/fastapi_route_loader/py.typed | 0 tests/__init__.py | 0 tests/test_container.py | 351 ++++++++++++++ tests/test_events.py | 190 ++++++++ tests/test_integration.py | 261 ++++++++++ tests/test_loader.py | 160 +++++++ uv.lock | 663 ++++++++++++++++++++++++++ 21 files changed, 3259 insertions(+) create mode 100644 .coverage create mode 100644 .gitignore create mode 100644 .python-version create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE create mode 100644 README.md create mode 100644 SETUP_GUIDE.md create mode 100644 examples/basic_usage.py create mode 100644 examples/event_handling.py create mode 100644 pyproject.toml create mode 100644 src/fastapi_route_loader/__init__.py create mode 100644 src/fastapi_route_loader/container.py create mode 100644 src/fastapi_route_loader/events.py create mode 100644 src/fastapi_route_loader/loader.py create mode 100644 src/fastapi_route_loader/py.typed create mode 100644 tests/__init__.py create mode 100644 tests/test_container.py create mode 100644 tests/test_events.py create mode 100644 tests/test_integration.py create mode 100644 tests/test_loader.py create mode 100644 uv.lock diff --git a/.coverage b/.coverage new file mode 100644 index 0000000000000000000000000000000000000000..6577456647a436414d0b19ec6dd386d6b2bf4b18 GIT binary patch literal 53248 zcmeI)%WoS+90%~(N9;JUyRO>Gq*0YQfYQ(;uGIqt4kXY>R8*osK%CgF?Mb|?ch}ur z=YfVu5wD0=(~;W_3q5)PL=VuGXM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N=$D^j-hs_y11futuFA009U<00Izz00bZa0SG_<0$l-3 z(O5x#{;wEM8U0~_00bZa0SG_<0uX=z1Rwwb2teQj3TRp(7k&TV_?j7i8$TJ}(+U;{ zKmY;|fB*y_009U<00Izz00fRi;IytQxfk`vKV}%aN)hZRnX?*gdRcp1{q@VqmiAqd zkB=627G_l1x~zWt)vX^G%QKc?3-nJ_N0kMp>zA4OLQPhnxbtu{qv*L@@%%T@_y3Jw znDNB;)A)^6us{F;5P$##AOHafKmY;|fB*y_a7+a<^uB(PUzMGvZ~(>nms=l`sD zOsj>kApijgKmY;|fB*y_009U<00Iy=kbwOBAJ_i}qCz4FKmY;|fB*y_009U<00Izz mz_AsO-~Y$;|FLa81P%cRKmY;|fB*y_009U<00Iy=kih?1!qqMS literal 0 HcmV?d00001 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0f8e84d --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +# Python-generated files +__pycache__/ +*.py[oc] +build/ +dist/ +wheels/ +*.egg-info + +# Virtual environments +.venv +htmlcov/ +scripts/ +.vscode/ +.pytest_cache +.qodo \ No newline at end of file diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..c8cfe39 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.10 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..6bf4988 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,221 @@ +# Contributing to FastAPI Route Loader + +Thank you for your interest in contributing to fastapi-route-loader! This document provides guidelines and instructions for contributing. + +## Development Setup + +1. **Clone the repository** + ```bash + git clone https://github.com/yourusername/fastapi-route-loader.git + cd fastapi-route-loader + ``` + +2. **Set up the development environment** + ```bash + # Run the setup script + bash scripts/setup.sh + + # Or manually: + python3 -m venv .venv + source .venv/bin/activate + pip install -e ".[dev]" + ``` + +3. **Verify the setup** + ```bash + bash scripts/verify.sh + ``` + +## Development Workflow + +### Running Tests + +```bash +# Run all tests +pytest + +# Run with coverage +pytest --cov=fastapi_route_loader --cov-report=html + +# Run specific test file +pytest tests/test_container.py + +# Run specific test +pytest tests/test_container.py::TestRouterContainer::test_add_router +``` + +### Code Quality + +We use strict linting and type checking: + +```bash +# Run ruff linter +ruff check . + +# Auto-fix issues +ruff check --fix . + +# Format code +ruff format . + +# Run type checker +pyright +``` + +### Code Style Guidelines + +- **Type Hints**: All functions must have complete type hints +- **Docstrings**: All public functions and classes must have docstrings +- **Line Length**: Maximum 88 characters (enforced by ruff) +- **Imports**: Use absolute imports, organized by ruff +- **Python Version**: Code must be compatible with Python 3.10+ + +### Commit Messages + +Follow conventional commit format: + +``` +(): + + + +