Comment

Comment by wilkystyle

If you can use uv, try the --exclude flag, e.g.:

    uv pip install -r requirements.txt --exclude excludes.txt
excludes.txt is basically like an inverse requirements.txt. Your requirements.txt could have this...

    pandas
    scikit-learn
    matplotlib

...while excludes.txt has this...

    numpy
... and uv would resolve the dependencies in requirements.txt, excluding numpy from the dependency graph entirely and ignoring any dependencies that would have been introduced by numpy itself.

EDIT: You can also configure this for uv directly in a pyproject.toml file:

    [tool.uv]
    exclude-dependencies = ["numpy"]
parent wilkystyle 10 days ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton