Skip to content

Commit 8d6e863

Browse files
fix(deps): switch from pip-compile to uv pip compile (#538)
## Summary Switches dependency compilation from pip-compile to uv pip compile to fix Renovate compatibility issues with the `--no-strip-extras` flag. ## Problem Renovate's pip-compile manager has a bug where it only supports `--no-strip-extras` for `uv pip compile`, not for regular `pip-compile`. This blocks Renovate from creating security vulnerability PRs for Python dependencies. ## Solution Switch from `pip-compile` to `uv pip compile` which: - ✅ Supports `--no-strip-extras` flag in Renovate - ✅ 10-100x faster compilation times - ✅ Drop-in replacement with same command structure - ✅ Aligns with unstructured and unstructured-inference repos ## Changes ### Makefile - Targets Python 3.12 (via `--python-version 3.12`) - Adds `--no-emit-package pip` and `--no-emit-package setuptools` flags - Replaces all `pip-compile` commands with `uv pip compile` ### Requirements Files Expected differences from `pip-compile` to `uv pip compile`: **Cosmetic changes:** - Header format updated to reflect uv compilation - Path references include `./` prefix (e.g., `-r ./requirements/base.in`) - Footer wording changed from "unsafe" to "excluded from the output" **constraints.txt expansion:** - `uv` includes transitive dependencies of constrained packages - Added `cryptography`, `cffi`, `charset-normalizer`, `pycparser` (all dependencies of pinned `pdfminer-six==20260107`) - This improves reproducibility by locking the entire dependency tree for constrained packages No version changes to any packages - all dependencies remain at the same versions as before. ## Testing ```bash make pip-compile ``` ## References - Renovate source: [common.ts](https://github.com/renovatebot/renovate/blob/main/lib/modules/manager/pip-compile/common.ts) - uv pip compile docs: https://docs.astral.sh/uv/pip/compile/ - Companion PR in unstructured: Unstructured-IO/unstructured#4202 <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Switches dependency compilation to `uv pip compile` and updates generated requirement files accordingly. > > - Replace `pip-compile` with `uv pip compile` in `Makefile`, targeting Python 3.12 and adding `--no-emit-package pip`/`setuptools`; update `compile-all-base` loop > - Regenerate `requirements/base.txt`, `test.txt`, and `constraints.txt` with uv headers/footers and `./` path prefixes > - Expand `constraints.txt` to include transitive deps of constrained packages (e.g., `cryptography`, `cffi`, `charset-normalizer`, `pycparser`) > - No dependency version changes > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit ba94b9a. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
1 parent e464c16 commit 8d6e863

4 files changed

Lines changed: 50 additions & 49 deletions

File tree

Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,18 @@ pip-compile: compile-all-base
4747

4848
.PHONY: compile-test
4949
compile-test:
50-
pip-compile --upgrade -o requirements/test.txt requirements/base.txt requirements/test.in
50+
uv pip compile --python-version 3.12 --upgrade -o requirements/test.txt requirements/base.txt requirements/test.in --no-emit-package pip --no-emit-package setuptools
5151

5252
.PHONY: compile-base
5353
compile-base:
54-
pip-compile --upgrade requirements/base.in
54+
uv pip compile --python-version 3.12 --upgrade requirements/base.in -o requirements/base.txt --no-emit-package pip --no-emit-package setuptools
5555

5656
.PHONY: compile-all-base
5757
compile-all-base: compile-base compile-test
58-
@$(foreach file,$(BASE_REQUIREMENTS),echo -e "\n\ncompiling: $(file)" && pip-compile --no-strip-extras --upgrade $(file) || exit;)
58+
@for file in $(BASE_REQUIREMENTS); do \
59+
echo -e "\n\ncompiling: $$file"; \
60+
uv pip compile --python-version 3.12 --upgrade --no-strip-extras $$file -o $${file%.in}.txt --no-emit-package pip --no-emit-package setuptools || exit 1; \
61+
done
5962

6063
.PHONY: clean-requirements
6164
clean-requirements:

requirements/base.txt

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
#
2-
# This file is autogenerated by pip-compile with Python 3.12
3-
# by the following command:
4-
#
5-
# pip-compile --no-strip-extras ./requirements/base.in
6-
#
1+
# This file was autogenerated by uv via the following command:
2+
# uv pip compile --python-version 3.12 --no-strip-extras ./requirements/base.in -o ./requirements/base.txt --no-emit-package pip --no-emit-package setuptools
73
accelerate==1.12.0
84
# via unstructured-inference
95
aiofiles==25.1.0
@@ -20,7 +16,7 @@ anyio==4.12.0
2016
# starlette
2117
backoff==2.2.1
2218
# via
23-
# -r requirements/base.in
19+
# -r ./requirements/base.in
2420
# unstructured
2521
beautifulsoup4==4.14.3
2622
# via unstructured
@@ -40,7 +36,7 @@ charset-normalizer==3.4.4
4036
# unstructured
4137
click==8.3.1
4238
# via
43-
# -r requirements/base.in
39+
# -r ./requirements/base.in
4440
# nltk
4541
# python-oxmsg
4642
# uvicorn
@@ -66,7 +62,7 @@ emoji==2.15.0
6662
et-xmlfile==2.0.0
6763
# via openpyxl
6864
fastapi==0.128.0
69-
# via -r requirements/base.in
65+
# via -r ./requirements/base.in
7066
filelock==3.20.1
7167
# via
7268
# huggingface-hub
@@ -167,7 +163,7 @@ nltk==3.9.2
167163
# via unstructured
168164
numpy==1.26.4
169165
# via
170-
# -c requirements/constraints.in
166+
# -c ./requirements/constraints.in
171167
# accelerate
172168
# contourpy
173169
# matplotlib
@@ -218,7 +214,7 @@ pdf2image==1.17.0
218214
# via unstructured
219215
pdfminer-six==20260107
220216
# via
221-
# -c requirements/constraints.in
217+
# -c ./requirements/constraints.in
222218
# unstructured
223219
# unstructured-inference
224220
pi-heif==1.1.1
@@ -249,7 +245,7 @@ protobuf==6.33.2
249245
# proto-plus
250246
psutil==7.2.1
251247
# via
252-
# -r requirements/base.in
248+
# -r ./requirements/base.in
253249
# accelerate
254250
# unstructured
255251
pyasn1==0.6.1
@@ -263,7 +259,7 @@ pycocotools==2.0.11
263259
pycparser==2.23
264260
# via cffi
265261
pycryptodome==3.23.0
266-
# via -r requirements/base.in
262+
# via -r ./requirements/base.in
267263
pydantic==2.12.5
268264
# via
269265
# fastapi
@@ -276,7 +272,7 @@ pyparsing==3.3.1
276272
# via matplotlib
277273
pypdf==6.5.0
278274
# via
279-
# -r requirements/base.in
275+
# -r ./requirements/base.in
280276
# unstructured
281277
# unstructured-client
282278
pypdfium2==5.2.0
@@ -311,14 +307,14 @@ rapidfuzz==3.14.3
311307
# unstructured
312308
# unstructured-inference
313309
ratelimit==2.2.1
314-
# via -r requirements/base.in
310+
# via -r ./requirements/base.in
315311
regex==2025.11.3
316312
# via
317313
# nltk
318314
# transformers
319315
requests==2.32.5
320316
# via
321-
# -r requirements/base.in
317+
# -r ./requirements/base.in
322318
# google-api-core
323319
# huggingface-hub
324320
# requests-toolbelt
@@ -344,7 +340,7 @@ soupsieve==2.8.1
344340
# via beautifulsoup4
345341
starlette==0.41.2
346342
# via
347-
# -c requirements/constraints.in
343+
# -c ./requirements/constraints.in
348344
# fastapi
349345
sympy==1.14.0
350346
# via
@@ -399,7 +395,7 @@ typing-inspection==0.4.2
399395
tzdata==2025.3
400396
# via pandas
401397
unstructured[all-docs]==0.18.24
402-
# via -r requirements/base.in
398+
# via -r ./requirements/base.in
403399
unstructured-client==0.42.6
404400
# via unstructured
405401
unstructured-inference==1.1.1
@@ -409,7 +405,7 @@ unstructured-pytesseract==0.3.15
409405
urllib3==2.6.2
410406
# via requests
411407
uvicorn==0.40.0
412-
# via -r requirements/base.in
408+
# via -r ./requirements/base.in
413409
webencodings==0.5.1
414410
# via html5lib
415411
wrapt==2.0.1
@@ -421,5 +417,5 @@ xlrd==2.0.2
421417
xlsxwriter==3.2.9
422418
# via python-pptx
423419

424-
# The following packages are considered to be unsafe in a requirements file:
420+
# The following packages were excluded from the output:
425421
# setuptools

requirements/constraints.txt

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
1-
#
2-
# This file is autogenerated by pip-compile with Python 3.12
3-
# by the following command:
4-
#
5-
# pip-compile --no-strip-extras ./requirements/constraints.in
6-
#
1+
# This file was autogenerated by uv via the following command:
2+
# uv pip compile --python-version 3.12 --no-strip-extras ./requirements/constraints.in -o ./requirements/constraints.txt --no-emit-package pip --no-emit-package setuptools
73
anyio==4.12.0
84
# via starlette
5+
cffi==2.0.0
6+
# via cryptography
7+
charset-normalizer==3.4.4
8+
# via pdfminer-six
9+
cryptography==46.0.3
10+
# via pdfminer-six
911
idna==3.11
1012
# via anyio
1113
numpy==1.26.4
12-
# via -r requirements/constraints.in
14+
# via -r ./requirements/constraints.in
15+
pdfminer-six==20260107
16+
# via -r ./requirements/constraints.in
17+
pycparser==2.23
18+
# via cffi
1319
starlette==0.41.2
14-
# via -r requirements/constraints.in
20+
# via -r ./requirements/constraints.in
1521
typing-extensions==4.15.0
1622
# via anyio

requirements/test.txt

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
#
2-
# This file is autogenerated by pip-compile with Python 3.12
3-
# by the following command:
4-
#
5-
# pip-compile --no-strip-extras ./requirements/test.in
6-
#
1+
# This file was autogenerated by uv via the following command:
2+
# uv pip compile --python-version 3.12 --no-strip-extras ./requirements/test.in -o ./requirements/test.txt --no-emit-package pip --no-emit-package setuptools
73
anyio==4.12.0
84
# via
95
# httpx
@@ -33,7 +29,7 @@ babel==2.17.0
3329
beautifulsoup4==4.14.3
3430
# via nbconvert
3531
black==25.12.0
36-
# via -r requirements/test.in
32+
# via -r ./requirements/test.in
3733
bleach[css]==6.3.0
3834
# via nbconvert
3935
build==1.3.0
@@ -49,7 +45,7 @@ charset-normalizer==3.4.4
4945
# via requests
5046
click==8.3.1
5147
# via
52-
# -r requirements/test.in
48+
# -r ./requirements/test.in
5349
# black
5450
comm==0.2.3
5551
# via
@@ -62,7 +58,7 @@ debugpy==1.8.19
6258
decorator==5.2.1
6359
# via ipython
6460
deepdiff==8.6.1
65-
# via -r requirements/test.in
61+
# via -r ./requirements/test.in
6662
defusedxml==0.7.1
6763
# via nbconvert
6864
execnb==0.1.16
@@ -79,7 +75,7 @@ fastcore==1.10.0
7975
fastjsonschema==2.21.2
8076
# via nbformat
8177
flake8==7.3.0
82-
# via -r requirements/test.in
78+
# via -r ./requirements/test.in
8379
fqdn==1.5.1
8480
# via jsonschema
8581
ghapi==1.0.8
@@ -90,7 +86,7 @@ httpcore==1.0.9
9086
# via httpx
9187
httpx==0.28.1
9288
# via
93-
# -r requirements/test.in
89+
# -r ./requirements/test.in
9490
# jupyterlab
9591
idna==3.11
9692
# via
@@ -137,7 +133,7 @@ jsonschema[format-nongpl]==4.25.1
137133
jsonschema-specifications==2025.9.1
138134
# via jsonschema
139135
jupyter==1.1.1
140-
# via -r requirements/test.in
136+
# via -r ./requirements/test.in
141137
jupyter-client==8.7.0
142138
# via
143139
# ipykernel
@@ -198,7 +194,7 @@ mccabe==0.7.0
198194
mistune==3.2.0
199195
# via nbconvert
200196
mypy==1.19.1
201-
# via -r requirements/test.in
197+
# via -r ./requirements/test.in
202198
mypy-extensions==1.1.0
203199
# via
204200
# black
@@ -210,7 +206,7 @@ nbconvert==7.16.6
210206
# jupyter
211207
# jupyter-server
212208
nbdev==2.4.7
213-
# via -r requirements/test.in
209+
# via -r ./requirements/test.in
214210
nbformat==5.10.4
215211
# via
216212
# jupyter-server
@@ -293,11 +289,11 @@ pytest==9.0.2
293289
# pytest-mock
294290
# pytest-xdist
295291
pytest-cov==7.0.0
296-
# via -r requirements/test.in
292+
# via -r ./requirements/test.in
297293
pytest-mock==3.15.1
298-
# via -r requirements/test.in
294+
# via -r ./requirements/test.in
299295
pytest-xdist==3.8.0
300-
# via -r requirements/test.in
296+
# via -r ./requirements/test.in
301297
python-dateutil==2.9.0.post0
302298
# via
303299
# arrow
@@ -406,5 +402,5 @@ wheel==0.45.1
406402
widgetsnbextension==4.0.15
407403
# via ipywidgets
408404

409-
# The following packages are considered to be unsafe in a requirements file:
405+
# The following packages were excluded from the output:
410406
# setuptools

0 commit comments

Comments
 (0)