Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add constraint dependencies to pyproject.toml #5248

Merged
merged 4 commits into from
Jul 21, 2024

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
54 checks passed
@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 pushed a commit that referenced this pull request Aug 26, 2024
…6596)

Add missing portions of documents reported in #6518 and #5248(Comment).

## Summary

<img width="600" alt="override"
src="https://github.com/user-attachments/assets/062f0036-8672-4c68-b21c-aebdeb79b58b">

<img width="600" alt="constraint"
src="https://github.com/user-attachments/assets/f5ef1aa2-0662-4352-a1a0-3af1127fb7fb">
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