Fix workflow failures: add missing httpx dependency and format code#9
Fix workflow failures: add missing httpx dependency and format code#9
Conversation
…black Co-authored-by: pangerlkr <73515951+pangerlkr@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Fixes CI/workflow failures by ensuring the root requirements.txt contains httpx (needed by FastAPI/Starlette TestClient imports) and by applying Black formatting to Python files that are checked in CI.
Changes:
- Add
httpx==0.25.2to the rootrequirements.txtso thepython-app.ymlworkflow installs it. - Reformat select Python files with Black to satisfy
black --checkinci.yml. - Minor formatting-only adjustments to queries/validators for style compliance.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
requirements.txt |
Adds httpx==0.25.2 to align installed deps with tests/workflows. |
tests/test_python_modules.py |
Black formatting (line wrapping) in SHA1 test. |
gateway/main.py |
Black formatting of allowed_types list in IOC validator. |
gateway/main_production.py |
Black formatting of allowed_types list and a SQLAlchemy query chain. |
gateway/database.py |
Black formatting of sessionmaker(...) call. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @validator("ioc_type") | ||
| def validate_ioc_type(cls, v): | ||
| allowed_types = ["ip", "domain", "url", "hash", "email", "md5", "sha1", "sha256"] | ||
| allowed_types = [ |
There was a problem hiding this comment.
gateway/main_production.py is running with pydantic==2.5.0 (per requirements), but this model still uses the legacy @validator API. In Pydantic v2 this is deprecated and can emit DeprecationWarnings (and may fail CI if warnings are treated as errors). Consider migrating these validators to @field_validator (with @classmethod) for v2 consistency, or explicitly import validator from pydantic.v1 if you intend to keep v1-style validators here.
Two workflows were failing:
python-app.ymldue to missing httpx dependency andci.ymldue to unformatted code.Changes
Added
httpx==0.25.2to requirements.txt: FastAPI TestClient requires httpx (imported via starlette.testclient), but it was only present in gateway/requirements.txt. The python-app workflow installs only the main requirements.txt, causing test imports to fail.Formatted 4 Python files with Black: CI enforces strict formatting. Reformatted gateway/main.py, gateway/database.py, gateway/main_production.py, and tests/test_python_modules.py to meet style requirements.