mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 10:58:28 +00:00

uv itself is a large package with many dependencies and lots of features. To build a package using the uv build backend, you shouldn't have to download and install the entirety of uv. For platform where we don't provide wheels, it should be possible and fast to compile the uv build backend. To that end, we're introducing a python package that contains a trimmed down version of uv that only contains the build backend, with a minimal dependency tree in rust. The `uv_build` package is publish from CI just like uv itself. It is part of the workspace, but has much less dependencies for its own binary. We're using cargo deny to enforce that the network stack is not part of the dependencies. A new build profile ensure we're getting the minimum possible binary size for a rust binary. --------- Co-authored-by: Zanie Blue <contact@zanie.dev>
24 lines
778 B
Python
24 lines
778 B
Python
from __future__ import annotations
|
|
|
|
from ._find_uv import find_uv_bin
|
|
|
|
__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; build backend functionality is in the `uv_build` package. "
|
|
f"Did you mean to use `uv_build` as your build system?"
|
|
)
|
|
raise AttributeError(err)
|
|
raise AttributeError(f"module `{__name__}` has no attribute `{attr_name}`")
|