forked from astral-sh/uv
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support private locks and environments for workspace members (astral-…
- Loading branch information
Showing
12 changed files
with
287 additions
and
54 deletions.
There are no files selected for viewing
This file contains 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 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 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,15 @@ | ||
This is a simple workspace with 2 applications `app1` and `app2` and 2 libraries. | ||
|
||
The applications have conflicting dependencies: | ||
|
||
- `app1` depends on `numpy == 2.0.0` | ||
- `app2` depends on `numpy == 1.26.4` | ||
|
||
Both `app1` and `app2` depend on another workspace member `shared_lib`, which in turn depends on | ||
`shared_corelib`. | ||
|
||
The workspace will create 3 `uv.lock` and `.venv`: | ||
|
||
- in the root, containing `shared_lib` and `shared_corelib` | ||
- in `app1`, with `app1`, `shared_lib`, `shared_corelib` | ||
- in `app2`, with `app2`, `shared_lib`, `shared_corelib` |
This file contains 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,9 @@ | ||
from shared_lib import hello_shared | ||
import numpy as np | ||
|
||
def main(): | ||
hello_shared() | ||
print(f"numpy {np.__version__}") | ||
|
||
if __name__ == "__main__": | ||
main() |
This file contains 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,18 @@ | ||
[project] | ||
name = "app1" | ||
version = "1.0.0" | ||
requires-python = ">=3.12" | ||
dependencies=[ | ||
"shared_lib", | ||
"numpy == 2.0.0", | ||
] | ||
|
||
[build-system] | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" | ||
|
||
[tool.hatch.build.targets.wheel] | ||
packages = ["app1"] | ||
|
||
[tool.uv.sources] | ||
shared_lib = { workspace = true } |
This file contains 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,9 @@ | ||
from shared_lib import hello_shared | ||
import numpy as np | ||
|
||
def main(): | ||
hello_shared() | ||
print(f"numpy {np.__version__}") | ||
|
||
if __name__ == "__main__": | ||
main() |
This file contains 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,18 @@ | ||
[project] | ||
name = "app2" | ||
version = "1.0.0" | ||
requires-python = ">=3.12" | ||
dependencies=[ | ||
"shared_lib", | ||
"numpy == 1.26.4", | ||
] | ||
|
||
[build-system] | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" | ||
|
||
[tool.hatch.build.targets.wheel] | ||
packages = ["app1"] | ||
|
||
[tool.uv.sources] | ||
shared_lib = { workspace = true } |
This file contains 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,3 @@ | ||
[tool.uv.workspace] | ||
members = ["shared_*"] | ||
private-members = ["app*"] |
Oops, something went wrong.