Files
gh-christianlouis-docuelevate/requirements-dev.txt
T
google-labs-jules[bot] b8db664c2e perf: optimize url upload with async i/o
Replaced synchronous `requests.get` and `open().write` in the `process_url` endpoint with `httpx.AsyncClient` and `aiofiles.open`. This prevents the FastAPI event loop from blocking during large file downloads.

Updated test suite in `tests/test_url_upload.py` to use `AsyncMock` to mock `httpx.AsyncClient.stream` contexts and async generators properly, covering all original conditions and HTTP error handling paths.

Added dependencies `aiofiles` and `types-aiofiles` to resolve MyPy typing CI failures, and mitigated CodeQL security alerts regarding user-provided path extensions by leveraging `os.path.basename` around the generated target file paths.

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-16 09:45:06 +00:00

41 lines
1.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Development and testing dependencies
-r requirements.txt
# Testing
pytest>=8.0.0
pytest-cov>=4.1.0
pytest-asyncio>=0.23.0
pytest-mock>=3.12.0
pytest-timeout>=2.3.0 # Per-test timeout enforcement to prevent CI hangs
httpx>=0.26.0 # For async test client
testcontainers>=3.7.1 # For integration tests with real containers
fpdf2>=2.8.0 # For generating test PDF documents in integration tests
minio>=7.1.0 # For MinIO/S3 integration tests
redis>=4.5.0 # For Redis integration tests
boto3>=1.26.0 # For S3 integration tests
# Code quality
ruff>=0.3.0
mypy>=1.8.0
djlint>=1.36.0 # HTML template linter for accessibility and best practices
# Documentation (builds the embedded /help site via MkDocs Material)
mkdocs-material>=9.5.0 # MkDocs Material theme same package used in docs/requirements.txt
# Type stubs for mypy
types-requests>=2.31.0
types-paramiko>=3.0.0
# Security scanning (Ruff includes most security checks from bandit)
pip-audit>=2.7.0 # Dependency vulnerability scanning against OSV/PyPA advisory databases
# Pre-commit hooks
pre-commit>=3.6.0
# License compliance
pip-licenses==5.5.1 # For license compliance checking
# Release automation
python-semantic-release>=9.0.0
types-aiofiles>=23.2.0.20240106