Skip to content

Commit 00a055f

Browse files
bluetclaude
andcommitted
chore: requirements.txt for Snyk (works around uv.lock unsupported)
Snyk's Python plugin doesn't yet support uv.lock files (snyk-python-plugin #251 still open as of 2026-05-11), so the snyk PR check errors when poetry.lock disappears in the migration. Generate requirements.txt from uv.lock as a snyk-readable manifest until upstream support lands. - requirements.txt: generated via `uv export --format requirements-txt --no-dev --no-emit-project`. Includes hashes; ~954 lines. - .pre-commit-config.yaml: add a local hook that auto-regenerates the file whenever uv.lock or pyproject.toml changes. Uses `language: system` so it runs against whatever uv is on PATH. - CLAUDE.md: document the workaround and the upstream issue, with a note to remove this once Snyk ships uv support. Tradeoff: one auto-generated file in the repo with a clear "don't edit by hand" mechanism. Better than carrying poetry.lock alongside uv.lock (which would defeat the migration's purpose) or making snyk a non-blocking check (security regression). Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 34fe90b commit 00a055f

3 files changed

Lines changed: 968 additions & 0 deletions

File tree

.pre-commit-config.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,16 @@ repos:
3939
- id: bandit
4040
args: [-ll, -i, -x, tests]
4141
name: bandit (security check)
42+
43+
# Auto-regenerate requirements.txt from uv.lock so Snyk (which doesn't
44+
# yet support uv.lock — snyk/snyk-python-plugin#251) has a manifest it
45+
# can scan. Local hook so it runs against whatever uv is on PATH.
46+
# Only triggers when uv.lock or pyproject.toml changed.
47+
- repo: local
48+
hooks:
49+
- id: uv-export-requirements
50+
name: uv export → requirements.txt (for Snyk)
51+
language: system
52+
entry: uv export --format requirements-txt --no-dev --no-emit-project --output-file requirements.txt
53+
files: ^(uv\.lock|pyproject\.toml)$
54+
pass_filenames: false

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ See `docs/custom_providers.md` for the full guide.
214214
## Known Quirks
215215

216216
- Build backend stays `poetry-core>=2.1.3` (poetry-core 2.x reads PEP 621 `[project]`); package management is uv (#105). PyPI publish uses `python -m build`.
217+
- `requirements.txt` is auto-generated from `uv.lock` via a pre-commit hook (`uv export --format requirements-txt --no-dev --no-emit-project`). It exists only because Snyk doesn't yet support uv.lock ([snyk-python-plugin#251](https://github.com/snyk/snyk-python-plugin/issues/251)). Don't edit by hand; touch `uv.lock` and let the hook regenerate it. Remove this workaround once Snyk ships uv support.
217218
- GeoIP database bundled in `proxybroker/data/`
218219
- Entry points: `__main__.py` (module), `py2exe_entrypoint.py` (executable)
219220
- ProxyPool.remove() is O(N log N) - acceptable for correctness

0 commit comments

Comments
 (0)