mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 10:58:28 +00:00
Fix bug where --no-binary :all:
prevented build of editable packages (#2393)
Closes https://github.com/astral-sh/uv/issues/2343
This commit is contained in:
parent
7220894ffb
commit
00ec99399a
2 changed files with 43 additions and 1 deletions
|
@ -280,7 +280,10 @@ impl<'a> BuildContext for BuildDispatch<'a> {
|
|||
build_kind: BuildKind,
|
||||
) -> Result<SourceBuild> {
|
||||
match self.no_build {
|
||||
NoBuild::All => bail!("Building source distributions is disabled"),
|
||||
NoBuild::All => debug_assert!(
|
||||
matches!(build_kind, BuildKind::Editable),
|
||||
"Only editable builds are exempt from 'no build' checks"
|
||||
),
|
||||
NoBuild::None => {}
|
||||
NoBuild::Packages(packages) => {
|
||||
if let Some(dist) = dist {
|
||||
|
|
|
@ -696,6 +696,45 @@ fn install_editable_and_registry() -> Result<()> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn install_editable_no_binary() -> Result<()> {
|
||||
let context = TestContext::new("3.12");
|
||||
|
||||
let current_dir = std::env::current_dir()?;
|
||||
let workspace_dir = regex::escape(
|
||||
Url::from_directory_path(current_dir.join("..").join("..").canonicalize()?)
|
||||
.unwrap()
|
||||
.as_str(),
|
||||
);
|
||||
|
||||
let filters = [(workspace_dir.as_str(), "file://[WORKSPACE_DIR]/")]
|
||||
.into_iter()
|
||||
.chain(INSTA_FILTERS.to_vec())
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
// Install the editable package with no-binary enabled
|
||||
uv_snapshot!(filters, command(&context)
|
||||
.arg("-e")
|
||||
.arg("../../scripts/editable-installs/black_editable")
|
||||
.arg("--no-binary")
|
||||
.arg(":all:")
|
||||
.current_dir(¤t_dir)
|
||||
.env("CARGO_TARGET_DIR", "../../../target/target_install_editable"), @r###"
|
||||
success: true
|
||||
exit_code: 0
|
||||
----- stdout -----
|
||||
|
||||
----- stderr -----
|
||||
Built 1 editable in [TIME]
|
||||
Resolved 1 package in [TIME]
|
||||
Installed 1 package in [TIME]
|
||||
+ black==0.1.0 (from file://[WORKSPACE_DIR]/scripts/editable-installs/black_editable)
|
||||
"###
|
||||
);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Install a source distribution that uses the `flit` build system, along with `flit`
|
||||
/// at the top-level, along with `--reinstall` to force a re-download after resolution, to ensure
|
||||
/// that the `flit` install and the source distribution build don't conflict.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue