-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Remove build backend parking breaks #11576
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
Closed
Closed
Changes from all commits
Commits
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 |
|---|---|---|
| @@ -1,48 +1,24 @@ | ||
| from __future__ import annotations | ||
|
|
||
| import os | ||
|
|
||
| if os.environ.get("UV_PREVIEW"): | ||
| from ._build_backend import * | ||
| from ._build_backend import * | ||
| from ._find_uv import find_uv_bin | ||
|
|
||
| if os.environ.get("UV_PREVIEW"): | ||
| __all__ = [ | ||
| "find_uv_bin", | ||
| # PEP 517 hook `build_sdist`. | ||
| "build_sdist", | ||
| # PEP 517 hook `build_wheel`. | ||
| "build_wheel", | ||
| # PEP 660 hook `build_editable`. | ||
| "build_editable", | ||
| # PEP 517 hook `get_requires_for_build_sdist`. | ||
| "get_requires_for_build_sdist", | ||
| # PEP 517 hook `get_requires_for_build_wheel`. | ||
| "get_requires_for_build_wheel", | ||
| # PEP 517 hook `prepare_metadata_for_build_wheel`. | ||
| "prepare_metadata_for_build_wheel", | ||
| # PEP 660 hook `get_requires_for_build_editable`. | ||
| "get_requires_for_build_editable", | ||
| # PEP 660 hook `prepare_metadata_for_build_editable`. | ||
| "prepare_metadata_for_build_editable", | ||
| ] | ||
| else: | ||
| __all__ = ["find_uv_bin"] | ||
|
|
||
|
|
||
| def __getattr__(attr_name: str) -> object: | ||
| if attr_name in { | ||
| "build_sdist", | ||
| "build_wheel", | ||
| "build_editable", | ||
| "get_requires_for_build_sdist", | ||
| "get_requires_for_build_wheel", | ||
| "prepare_metadata_for_build_wheel", | ||
| "get_requires_for_build_editable", | ||
| "prepare_metadata_for_build_editable", | ||
| }: | ||
| err = f"Using `uv.{attr_name}` is not allowed. The uv build backend requires preview mode to be enabled, e.g., via the `UV_PREVIEW=1` environment variable." | ||
| raise AttributeError(err) | ||
|
|
||
| err = f"module 'uv' has no attribute '{attr_name}'" | ||
| raise AttributeError(err) | ||
| __all__ = [ | ||
| "find_uv_bin", | ||
| # PEP 517 hook `build_sdist`. | ||
| "build_sdist", | ||
| # PEP 517 hook `build_wheel`. | ||
| "build_wheel", | ||
| # PEP 660 hook `build_editable`. | ||
| "build_editable", | ||
| # PEP 517 hook `get_requires_for_build_sdist`. | ||
| "get_requires_for_build_sdist", | ||
| # PEP 517 hook `get_requires_for_build_wheel`. | ||
| "get_requires_for_build_wheel", | ||
| # PEP 517 hook `prepare_metadata_for_build_wheel`. | ||
| "prepare_metadata_for_build_wheel", | ||
| # PEP 660 hook `get_requires_for_build_editable`. | ||
| "get_requires_for_build_editable", | ||
| # PEP 660 hook `prepare_metadata_for_build_editable`. | ||
| "prepare_metadata_for_build_editable", | ||
| ] | ||
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 |
|---|---|---|
|
|
@@ -23,8 +23,16 @@ | |
|
|
||
|
|
||
| def warn_config_settings(config_settings: "Mapping[Any, Any] | None" = None) -> None: | ||
| import os | ||
| import sys | ||
|
|
||
| if not os.environ.get("UV_PREVIEW"): | ||
| print( | ||
| "Warning: The uv build backend is in preview. " | ||
| "Set the `UV_PREVIEW` environment variable to `1` to acknowledge.", | ||
| file=sys.stderr, | ||
| ) | ||
|
Comment on lines
25
to
+34
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's kind of weird to have this in |
||
|
|
||
| if config_settings: | ||
| print("Warning: Config settings are not supported", file=sys.stderr) | ||
|
|
||
|
|
||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this preclude us from moving these into a separate namespace later? (as discussed elsewhere)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imo they are still preview and as such subject to change at any time, but we can also merge the PR #11478 -> #11446 first and start with
uv_builddirectly.