Skip to content

Comments

Add constraint dependencies to pyproject.toml#5248

Merged
charliermarsh merged 4 commits intoastral-sh:mainfrom
Di-Is:support-constraint-in-pyproject
Jul 21, 2024
Merged

Add constraint dependencies to pyproject.toml#5248
charliermarsh merged 4 commits intoastral-sh:mainfrom
Di-Is:support-constraint-in-pyproject

Conversation

@Di-Is
Copy link
Contributor

@Di-Is Di-Is commented Jul 20, 2024

Resolves #4467.

Summary

This PR implements the following

  1. Add tool.uv.constraint-dependencies to pyproject.toml
  2. Support to refer tool.uv.constraint-dependencies in uv lock
  3. Support to refer tool.uv.constraint-dependencies in uv pip compile/install

These are analogues of the override features implemented in #3839 and #4369.

Test Plan

Add test.

@Di-Is Di-Is changed the title Use constraint dependency from workspace setting file with the uv lock Support constraint dependencies in uv lock. Jul 20, 2024
@Di-Is Di-Is changed the title Support constraint dependencies in uv lock. Support constraint dependencies in uv lock Jul 20, 2024
@charliermarsh charliermarsh self-assigned this Jul 20, 2024
@charliermarsh
Copy link
Member

Thanks, this is looking great! Do you mind adding the analogous changes to crates/uv/src/settings.rs? See overrides_from_workspace.

@Di-Is Di-Is changed the title Support constraint dependencies in uv lock Add constraint dependencies to pyproject.toml Jul 21, 2024
@Di-Is
Copy link
Contributor Author

Di-Is commented Jul 21, 2024

I modified crates/uv/src/settings.rs to reference tool.uv.constraint-dependencies.

Copy link
Member

@charliermarsh charliermarsh left a comment

Choose a reason for hiding this comment

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

Thank you.

@charliermarsh charliermarsh merged commit 32ad332 into astral-sh:main Jul 21, 2024
@charliermarsh charliermarsh added enhancement New feature or improvement to existing functionality preview Experimental behavior labels Jul 21, 2024
@Di-Is Di-Is deleted the support-constraint-in-pyproject branch July 22, 2024 11:00
@purajit
Copy link

purajit commented Aug 24, 2024

Incredible! We had one use-case where we might have been forced to use the pip interface, I didn't see anything in the docs, but luckily Google surfaced this PR! Works perfectly.

charliermarsh added a commit that referenced this pull request Feb 18, 2025
## Summary

Resolves #6913. 

Add `tool.uv.build-constraint-dependencies` to pyproject.toml.
The changes are analogous to the constraint-dependencies feature
implemented in #5248.

Add documentation for `build-constraint-dependencies`

## Test Plan

Add tests for `uv lock`, `uv add`, `uv pip install` and `uv pip
compile`.

---------

Co-authored-by: Charlie Marsh <[email protected]>
loic-lescoat pushed a commit to loic-lescoat/uv that referenced this pull request Mar 2, 2025
…al-sh#11585)

## Summary

Resolves astral-sh#6913. 

Add `tool.uv.build-constraint-dependencies` to pyproject.toml.
The changes are analogous to the constraint-dependencies feature
implemented in astral-sh#5248.

Add documentation for `build-constraint-dependencies`

## Test Plan

Add tests for `uv lock`, `uv add`, `uv pip install` and `uv pip
compile`.

---------

Co-authored-by: Charlie Marsh <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or improvement to existing functionality preview Experimental behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support constraints in pyproject.toml

3 participants