-
Notifications
You must be signed in to change notification settings - Fork 497
feat: pypi-options.dependency-overrides #3948
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
Merged
Merged
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
31dce2d
feat(model): add dependency override in model
HernandoR db9204e
fix: change PIXI_BUILD_API_VERSION_NAME from const to static
HernandoR 1b293f6
feat(pypi): add dependency overrides to PypiOptions and TOML deserial…
HernandoR 2547567
test(snap): update snap relating to dependency override
HernandoR 28afc35
feat(pypi): add support for dependency overrides in resolve_pypi func…
HernandoR 8106c97
feat(schema): add dependency overrides for numpy in project.pypi-options
HernandoR e4f40af
Merge branch 'main' into lz/feat/pypi-overide
nichmor 9e36530
更新 model.py
HernandoR 8897783
更新 override.md
HernandoR c206e1c
feat(override): add samples, and updated marks
HernandoR 950b691
remove commented code
HernandoR e220df0
draft: test(overide)
HernandoR e099dfb
test(depency_overrides): add genrated lock file.
HernandoR a830d3e
fix typo
HernandoR 8b74fb3
Merge branch 'main' into lz/feat/pypi-overide
HernandoR c1b9808
fix
HernandoR 17f2e48
test(snap): update snaps
HernandoR e7f7fcd
fix(lint)
HernandoR d386b9f
feat(nav): add Dependency Overrides section to Advanced documentation
HernandoR 5aa356c
Merge branch 'main' into lz/feat/pypi-overide
HernandoR 7bcc730
Merge branch 'main' into lz/feat/pypi-overide
HernandoR 02e7c73
fix: improve error handling for dependency overrides in resolve_pypi
HernandoR f5aaa03
test: enhance pypi overrides test to verify lock file contents
HernandoR 60ffd25
Merge branch 'main' into lz/feat/pypi-overide
HernandoR fe9983d
Merge branch 'main' into lz/feat/pypi-overide
tdejager 06fdaa0
chore(doc): fix wrongfull comment
HernandoR 523e783
doc(override): update how override interact with other
HernandoR 802bd09
Merge branch 'main' into lz/feat/pypi-overide
nichmor 524549b
test(pypi_options): update merge test to include dependency_overrides
HernandoR 026053e
Merge branch 'main' into lz/feat/pypi-overide
nichmor 42de699
remove the redundend todo, since it has been implement
HernandoR ba07228
Merge branch 'main' into lz/feat/pypi-overide
HernandoR 336091c
Merge branch 'main' into lz/feat/pypi-overide
HernandoR f278422
Merge branch 'main' into lz/feat/pypi-overide
HernandoR 4af4ba6
Merge branch 'main' into lz/feat/pypi-overide
tdejager File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,4 +11,5 @@ find-links: | |
| no-build-isolation: [] | ||
| index-strategy: ~ | ||
| no-build: ~ | ||
| dependency-overrides: ~ | ||
| no-binary: ~ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,4 +9,5 @@ find-links: ~ | |
| no-build-isolation: [] | ||
| index-strategy: ~ | ||
| no-build: ~ | ||
| dependency-overrides: ~ | ||
| no-binary: ~ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,5 +19,6 @@ PypiOptions { | |
| }, | ||
| ), | ||
| ), | ||
| dependency_overrides: None, | ||
| no_binary: None, | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| ## Overview | ||
|
|
||
| Sometimes our direct dependency declares outdated intermediate dependency or is too tight to solve with other direct dependencies. In this case, we can override the intermediate dependency in our `pyproject.toml`or `pixi.toml` file. | ||
|
|
||
| > [!Note] This option is not recommended unless you know what you are doing, as uv will ignore all the version constraints of the dependency and use the version you specified. | ||
|
|
||
| ## Example | ||
| ### Override a dependency version | ||
| ```toml | ||
| # pyproject.toml | ||
| [tool.pixi.pypi-options.dependency-overrides] | ||
| numpy = ">=2.0.0" | ||
| ``` | ||
| or in `pixi.toml`: | ||
|
|
||
| ```toml | ||
| # pixi.toml | ||
| [pypi-options.dependency-overrides] | ||
| numpy = ">=2.0.0" | ||
| ``` | ||
| This will override the version of `numpy` used by all dependencies to be at least `2.0.0`, regardless of what the dependencies specify. | ||
| This is useful if you need a specific version of a library that is not compatible with the versions specified by your dependencies. | ||
|
|
||
| ### Override a dependency version in a specific feature | ||
| it can also be specified in feature level, | ||
| ```toml | ||
| [features.dev.pypi-options.dependency-overrides] | ||
| numpy = ">=2.0.0" | ||
| ``` | ||
| This will override the version of `numpy` used by all dependencies in the `dev` feature to be at least `2.0.0`, regardless of what the dependencies specify when the `dev` feature is enabled. | ||
|
|
||
| ### Interact with other overrides | ||
| For a specific environment, all the `dependency-overrides` defined in different features will be combined in the order they were when defining the environment. | ||
|
|
||
| If the same dependency is overridden multiple times, we'll use the override from the **prior** feature in that environment. | ||
|
|
||
| Also, the default feature will always come, and come last in the list of all overrides. | ||
|
|
||
| ```toml | ||
| # pixi.toml | ||
| [pypi-options] | ||
| dependency-overrides = { numpy = ">=2.1.0" } | ||
|
|
||
| [pypi-dependencies] | ||
| numpy = ">=1.25.0" | ||
|
|
||
| [feature.dev.pypi-options.dependency-overrides] | ||
| numpy = "==2.0.0" | ||
|
|
||
| [feature.outdated.pypi-options.dependency-overrides] | ||
| numpy = "==1.21.0" | ||
|
|
||
| [environments] | ||
| dev = ["dev"] | ||
| outdated = ["outdated"] | ||
| conflict_a=["outdated", "dev"] | ||
| conflict_b=["dev","outdated"] | ||
| ``` | ||
| the following constrains are merged out: | ||
| default: `numpy >= 2.1.0` | ||
| dev: `numpy == 2.0.0` | ||
| outdated: `numpy == 1.21.0` | ||
| conflict_a: `numpy == 1.21.0` (from `outdated`) | ||
| conflict_b: `numpy == 2.0.0` (from `dev`) | ||
|
|
||
| This may contrast with the intuition that all overrides are applied and combined to a result, but it is done this way to avoid conflicts and confusion. Since users are granted fully control over the overrides, it is up to ourselves to choose the right overrides for the environment. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.