Skip to content

fix(deps): switch from pip-compile to uv pip compile#4202

Merged
lawrence-u10d merged 2 commits intomainfrom
fix/switch-to-uv-pip-compile
Jan 21, 2026
Merged

fix(deps): switch from pip-compile to uv pip compile#4202
lawrence-u10d merged 2 commits intomainfrom
fix/switch-to-uv-pip-compile

Conversation

@lawrence-u10d
Copy link
Contributor

@lawrence-u10d lawrence-u10d commented Jan 21, 2026

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 causes 32 warnings in every Renovate run:

WARN: pip-compile error
errorMessage: "Option --no-strip-extras not supported (yet)"

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-inference and platform-plugins repos

Implementation Details

The Makefile now uses:

  • --python-version 3.10 flag to ensure consistent dependency resolution
  • --no-emit-package pip --no-emit-package setuptools flags (matches pip-compile's "unsafe" package behavior)
  • Proper shell for loop instead of $(foreach) for better variable expansion
  • --upgrade flag on all compile commands

Expected Diff Changes

The following differences in .txt files are expected and safe when switching from pip-compile to uv pip compile:

  1. Header format - Just formatting, no functional change
  2. Constraint paths - uv normalizes relative paths with ./ prefix (deps/constraints.txt./deps/constraints.txt)
  3. coverage[toml]coverage (test.txt) - Since we use .coveragerc for config (not pyproject.toml), the [toml] extra isn't needed. pip-compile was including it unnecessarily.
  4. importlib-metadata + zipp added (dev.txt) - These are Python 3.10 backports (stdlib in 3.11+). uv correctly includes them for Python 3.10.
  5. Dependency comment cleanup - Removed references to packages that are no longer in the dependency tree

Testing

make pip-compile

References


Note

Migrates dependency compilation to uv pip compile and refreshes all requirement lockfiles accordingly.

  • Replace pip-compile with uv pip compile in requirements/Makefile (adds --python-version 3.10, --upgrade, --no-emit-package pip/setuptools, and uses a shell for loop for batch compilation; includes --no-strip-extras for base files)
  • Regenerate requirements/*.txt with uv: new uv headers, normalized ./-prefixed paths (including constraints), and updated "via" comments
  • Minor dependency changes: dev.txt now includes importlib-metadata and zipp for Python 3.10 compatibility; otherwise versions remain consistent

Written by Cursor Bugbot for commit 0584298. This will update automatically on new commits. Configure here.

cursor[bot]

This comment was marked as outdated.

Switches dependency compilation from pip-compile to uv pip compile to fix
Renovate compatibility issues with the --no-strip-extras flag.

Benefits:
- Renovate supports --no-strip-extras for uv pip compile
- 10-100x faster compilation times
- Aligns with unstructured-inference and platform-plugins
- Drop-in replacement with same command structure

Ref: Renovate pip-compile manager only supports --no-strip-extras for uv,
not for regular pip-compile
@lawrence-u10d lawrence-u10d force-pushed the fix/switch-to-uv-pip-compile branch from 277d516 to 0117c40 Compare January 21, 2026 02:50
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@socket-security
Copy link

socket-security bot commented Jan 21, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedpypi/​zipp@​3.23.0100100100100100
Addedpypi/​importlib-metadata@​8.7.1100100100100100

View full report

- Add --python-version 3.10 flag to ensure consistent dependency resolution
- Add --no-emit-package flags for pip and setuptools (matches pip-compile behavior)
- Fix compile-all-base to use proper shell for loop instead of $(foreach)
- Re-add --upgrade flag to all compile commands

Expected diff changes from pip-compile to uv pip compile:
- Header format updated to uv style
- Constraint paths normalized with ./ prefix (deps/constraints.txt → ./deps/constraints.txt)
- coverage[toml] → coverage (not needed since we use .coveragerc)
- importlib-metadata + zipp added (Python 3.10 backports, correctly included by uv)
- exceptiongroup and tomli handling improved for Python 3.10 compatibility

Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
@lawrence-u10d lawrence-u10d force-pushed the fix/switch-to-uv-pip-compile branch from 8de630a to 0584298 Compare January 21, 2026 04:22
lawrence-u10d added a commit to Unstructured-IO/unstructured-api that referenced this pull request Jan 21, 2026
## 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>
@lawrence-u10d lawrence-u10d added this pull request to the merge queue Jan 21, 2026
Merged via the queue into main with commit 95fea7e Jan 21, 2026
72 of 73 checks passed
@lawrence-u10d lawrence-u10d deleted the fix/switch-to-uv-pip-compile branch January 21, 2026 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants