Skip to content

Commit 8232433

Browse files
fix(ci+lint): unblock main + dependabot (#18)
Two preexisting issues kept CI red on main: 1) src/pitchcritic/extractor.py:47 had a 108-char line that ruff E501 (max 100) was failing on. Hoisted the size_mb / max_mb computations to locals so the f-string fits in 100 cols. Message content is identical. 2) .pre-commit-config.yaml pinned `types-all` as a mypy additional_dependency. `types-all` is yanked on PyPI and pulls the broken `types-pkg-resources` placeholder, so pre-commit install always fails. The repo's actual imports (anthropic, fastapi, pdfplumber, pydantic, rich, typer) all ship inline type info — no external stubs needed. Net effect: main goes green; dependabot PR #17 (idna 3.11 to 3.15) should auto-unblock once CI rebuilds.
1 parent 5abfe79 commit 8232433

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

.pre-commit-config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,5 @@ repos:
1010
rev: v1.15.0
1111
hooks:
1212
- id: mypy
13-
additional_dependencies: [types-all]
1413
args: [--ignore-missing-imports]
1514
files: ^src/

src/pitchcritic/extractor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ def extract_pdf(path: Path | str) -> PitchContent:
4343
if file_size == 0:
4444
raise ExtractionError("PDF file is empty (0 bytes)")
4545
if file_size > MAX_PDF_SIZE_BYTES:
46-
raise ExtractionError(
47-
f"PDF too large: {file_size / 1024 / 1024:.1f} MB (max {MAX_PDF_SIZE_BYTES // 1024 // 1024} MB)"
48-
)
46+
size_mb = file_size / 1024 / 1024
47+
max_mb = MAX_PDF_SIZE_BYTES // 1024 // 1024
48+
raise ExtractionError(f"PDF too large: {size_mb:.1f} MB (max {max_mb} MB)")
4949

5050
content_hash = _file_hash(path)
5151
if content_hash in _extraction_cache:

0 commit comments

Comments
 (0)