Adds typed configuration objects and optional dependency injection to adapters, making tests simpler while keeping the existing env-var defaults for production.
Config package (python_repositories/config/): RedisConfig, MinioConfig, and load_dotenv() with .env support via python-dotenv
Adapter injection: RedisAdapter and MinioAdapter accept optional config= and client= keyword arguments; injected clients are not closed on disconnect()
Backward compatible: RedisAdapter() / MinioAdapter() still load from environment variables (and .env when present)
Test reorganization:
Interface and adapter unit tests moved/renamed to follow 1:1 source-file naming
Integration tests marked with @pytest.mark.integration
Shared test constants in tests/conftest.py; mock fixtures in tests/unit/conftest.py
Integration tests use explicit config objects instead of global os.environ mutation
Docs: README updated with config injection, .env, and pytest marker usage; added .env.example
Test plan
uv run pytest tests/unit/ -v — 54 passed, no Docker
uv run pytest -m "not integration" -v — unit tests from repo root
uv run pytest -v — full suite, 101 passed (requires Docker)
## Summary
Adds typed configuration objects and optional dependency injection to adapters, making tests simpler while keeping the existing env-var defaults for production.
- **Config package** (`python_repositories/config/`): `RedisConfig`, `MinioConfig`, and `load_dotenv()` with `.env` support via `python-dotenv`
- **Adapter injection**: `RedisAdapter` and `MinioAdapter` accept optional `config=` and `client=` keyword arguments; injected clients are not closed on `disconnect()`
- **Backward compatible**: `RedisAdapter()` / `MinioAdapter()` still load from environment variables (and `.env` when present)
- **Test reorganization**:
- Interface and adapter unit tests moved/renamed to follow 1:1 source-file naming
- Integration tests marked with `@pytest.mark.integration`
- Shared test constants in `tests/conftest.py`; mock fixtures in `tests/unit/conftest.py`
- Integration tests use explicit config objects instead of global `os.environ` mutation
- **Docs**: README updated with config injection, `.env`, and pytest marker usage; added `.env.example`
## Test plan
- [x] `uv run pytest tests/unit/ -v` — 54 passed, no Docker
- [x] `uv run pytest -m "not integration" -v` — unit tests from repo root
- [x] `uv run pytest -v` — full suite, 101 passed (requires Docker)
- [x] `uv run mypy python_repositories/` — clean
- [x] Pre-commit hooks pass (ruff, mypy, pyupgrade, prettier)
Introduce typed config objects, optional adapter injection, and .env loading to simplify testing while preserving env-based defaults for production usage.
Co-authored-by: Cursor <cursoragent@cursor.com>
Default TLS to enabled for production MinIO setups while keeping local and integration tests on plain HTTP via explicit secure=false configuration.
Co-authored-by: Cursor <cursoragent@cursor.com>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Adds typed configuration objects and optional dependency injection to adapters, making tests simpler while keeping the existing env-var defaults for production.
python_repositories/config/):RedisConfig,MinioConfig, andload_dotenv()with.envsupport viapython-dotenvRedisAdapterandMinioAdapteraccept optionalconfig=andclient=keyword arguments; injected clients are not closed ondisconnect()RedisAdapter()/MinioAdapter()still load from environment variables (and.envwhen present)@pytest.mark.integrationtests/conftest.py; mock fixtures intests/unit/conftest.pyos.environmutation.env, and pytest marker usage; added.env.exampleTest plan
uv run pytest tests/unit/ -v— 54 passed, no Dockeruv run pytest -m "not integration" -v— unit tests from repo rootuv run pytest -v— full suite, 101 passed (requires Docker)uv run mypy python_repositories/— cleanTest Coverage Report:
5e32787b90to3aa91280ecTest Coverage Report: