-
Notifications
You must be signed in to change notification settings - Fork 8
Add uv workspace options for sub package installation
#90
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 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
034bd4f
Add `uv` workspace options for sub package installation
huin 238c195
refactor subworkspace tests for composability
huin 492b67d
Refactor tests to use subprocess cwd rather than calling chdir.
huin f0ff1db
chore: bump all build-systems to later uv-build version
huin 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
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 @@ | ||
| 3.13 |
Empty file.
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,43 @@ | ||
| from nox import Session, options | ||
|
|
||
| from nox_uv import session | ||
|
|
||
| options.default_venv_backend = "uv" | ||
|
|
||
| PKG_ONE = "package-one" | ||
| PKG_TWO = "package-two" | ||
|
|
||
|
|
||
| def _run_binaries(s: Session) -> None: | ||
| for run_binary in s.posargs: | ||
| s.run(run_binary) | ||
|
|
||
|
|
||
| @session | ||
| def run_with_no_packages(s: Session) -> None: | ||
| _run_binaries(s) | ||
|
|
||
|
|
||
| @session(uv_packages=[PKG_ONE]) | ||
| def run_with_package_one(s: Session) -> None: | ||
| _run_binaries(s) | ||
|
|
||
|
|
||
| @session(uv_packages=[PKG_TWO]) | ||
| def run_with_package_two(s: Session) -> None: | ||
| _run_binaries(s) | ||
|
|
||
|
|
||
| @session(uv_packages=[PKG_ONE, PKG_TWO]) | ||
| def run_with_packages_one_and_two(s: Session) -> None: | ||
| _run_binaries(s) | ||
|
|
||
|
|
||
| @session(uv_all_packages=True) | ||
| def run_with_all_packages(s: Session) -> None: | ||
| _run_binaries(s) | ||
|
|
||
|
|
||
| @session(uv_packages=[PKG_ONE], uv_all_packages=True) | ||
| def run_explicit_and_all_packages(s: Session) -> None: | ||
| _run_binaries(s) |
Empty file.
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,23 @@ | ||
| [build-system] | ||
| build-backend = "uv_build" | ||
| requires = [ "uv-build>=0.9,<0.10" ] | ||
|
johnthagen marked this conversation as resolved.
Outdated
|
||
|
|
||
| [project] | ||
| name = "package-one" | ||
| version = "0.1.0" | ||
| description = "Project for testing nox-uv" | ||
| readme = "README.md" | ||
| requires-python = ">=3.9" | ||
| classifiers = [ | ||
| "Private :: Do Not Upload", | ||
| "Programming Language :: Python :: 3 :: Only", | ||
| "Programming Language :: Python :: 3.9", | ||
| "Programming Language :: Python :: 3.10", | ||
| "Programming Language :: Python :: 3.11", | ||
| "Programming Language :: Python :: 3.12", | ||
| "Programming Language :: Python :: 3.13", | ||
| "Programming Language :: Python :: 3.14", | ||
| ] | ||
|
|
||
| [project.scripts] | ||
| package-one-bin = "package_one.main:main" | ||
Empty file.
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,6 @@ | ||
| def main() -> None: | ||
| print("Hello from package-one!") | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() |
Empty file.
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,23 @@ | ||
| [build-system] | ||
| build-backend = "uv_build" | ||
| requires = [ "uv-build>=0.9,<0.10" ] | ||
|
johnthagen marked this conversation as resolved.
Outdated
|
||
|
|
||
| [project] | ||
| name = "package-two" | ||
| version = "0.1.0" | ||
| description = "Project for testing nox-uv" | ||
| readme = "README.md" | ||
| requires-python = ">=3.9" | ||
| classifiers = [ | ||
| "Private :: Do Not Upload", | ||
| "Programming Language :: Python :: 3 :: Only", | ||
| "Programming Language :: Python :: 3.9", | ||
| "Programming Language :: Python :: 3.10", | ||
| "Programming Language :: Python :: 3.11", | ||
| "Programming Language :: Python :: 3.12", | ||
| "Programming Language :: Python :: 3.13", | ||
| "Programming Language :: Python :: 3.14", | ||
| ] | ||
|
|
||
| [project.scripts] | ||
| package-two-bin = "package_two.main:main" | ||
Empty file.
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,6 @@ | ||
| def main() -> None: | ||
| print("Hello from package-two!") | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() |
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,26 @@ | ||
| [project] | ||
| name = "subworkspace" | ||
| version = "0.1.0" | ||
| description = "Workspace for testing nox-uv" | ||
| readme = "README.md" | ||
| requires-python = ">=3.9" | ||
| classifiers = [ | ||
| "Private :: Do Not Upload", | ||
| "Programming Language :: Python :: 3 :: Only", | ||
| "Programming Language :: Python :: 3.9", | ||
| "Programming Language :: Python :: 3.10", | ||
| "Programming Language :: Python :: 3.11", | ||
| "Programming Language :: Python :: 3.12", | ||
| "Programming Language :: Python :: 3.13", | ||
| "Programming Language :: Python :: 3.14", | ||
| ] | ||
| dependencies = ["nox-uv"] | ||
|
|
||
| [tool.uv] | ||
| sources.nox-uv = { path = "../../", editable = true } | ||
|
|
||
| [tool.uv.workspace] | ||
| members = [ | ||
| "package-one", | ||
| "package-two", | ||
| ] |
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.