mirror of https://github.com/astral-sh/uv
Move `render-benchmarks` under a Cargo feature (#3815)
## Summary Avoid compiling these large dependencies when we typically don't need them.
This commit is contained in:
parent
ce38fccdc9
commit
a7d486bc71
|
|
@ -43,14 +43,14 @@ fs-err = { workspace = true, features = ["tokio"] }
|
||||||
futures = { workspace = true }
|
futures = { workspace = true }
|
||||||
itertools = { workspace = true }
|
itertools = { workspace = true }
|
||||||
owo-colors = { workspace = true }
|
owo-colors = { workspace = true }
|
||||||
poloto = { version = "19.1.2" }
|
poloto = { version = "19.1.2", optional = true }
|
||||||
pretty_assertions = { version = "1.4.0" }
|
pretty_assertions = { version = "1.4.0" }
|
||||||
resvg = { version = "0.29.0" }
|
resvg = { version = "0.29.0", optional = true }
|
||||||
rustc-hash = { workspace = true }
|
rustc-hash = { workspace = true }
|
||||||
schemars = { workspace = true }
|
schemars = { workspace = true }
|
||||||
serde = { workspace = true }
|
serde = { workspace = true }
|
||||||
serde_json = { workspace = true }
|
serde_json = { workspace = true }
|
||||||
tagu = { version = "0.1.6" }
|
tagu = { version = "0.1.6", optional = true }
|
||||||
tokio = { workspace = true }
|
tokio = { workspace = true }
|
||||||
tracing = { workspace = true }
|
tracing = { workspace = true }
|
||||||
tracing-durations-export = { workspace = true, features = ["plot"] }
|
tracing-durations-export = { workspace = true, features = ["plot"] }
|
||||||
|
|
@ -62,3 +62,7 @@ mimalloc = { version = "0.1.39" }
|
||||||
|
|
||||||
[target.'cfg(all(not(target_os = "windows"), not(target_os = "openbsd"), any(target_arch = "x86_64", target_arch = "aarch64", target_arch = "powerpc64")))'.dependencies]
|
[target.'cfg(all(not(target_os = "windows"), not(target_os = "openbsd"), any(target_arch = "x86_64", target_arch = "aarch64", target_arch = "powerpc64")))'.dependencies]
|
||||||
tikv-jemallocator = { version = "0.5.4" }
|
tikv-jemallocator = { version = "0.5.4" }
|
||||||
|
|
||||||
|
[features]
|
||||||
|
default = []
|
||||||
|
render = ["poloto", "resvg", "tagu"]
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ use crate::clear_compile::ClearCompileArgs;
|
||||||
use crate::compile::CompileArgs;
|
use crate::compile::CompileArgs;
|
||||||
use crate::fetch_python::FetchPythonArgs;
|
use crate::fetch_python::FetchPythonArgs;
|
||||||
use crate::generate_json_schema::GenerateJsonSchemaArgs;
|
use crate::generate_json_schema::GenerateJsonSchemaArgs;
|
||||||
|
#[cfg(feature = "render")]
|
||||||
use crate::render_benchmarks::RenderBenchmarksArgs;
|
use crate::render_benchmarks::RenderBenchmarksArgs;
|
||||||
use crate::wheel_metadata::WheelMetadataArgs;
|
use crate::wheel_metadata::WheelMetadataArgs;
|
||||||
|
|
||||||
|
|
@ -54,8 +55,6 @@ enum Cli {
|
||||||
Build(BuildArgs),
|
Build(BuildArgs),
|
||||||
/// Display the metadata for a `.whl` at a given URL.
|
/// Display the metadata for a `.whl` at a given URL.
|
||||||
WheelMetadata(WheelMetadataArgs),
|
WheelMetadata(WheelMetadataArgs),
|
||||||
/// Render the benchmarks.
|
|
||||||
RenderBenchmarks(RenderBenchmarksArgs),
|
|
||||||
/// Compile all `.py` to `.pyc` files in the tree.
|
/// Compile all `.py` to `.pyc` files in the tree.
|
||||||
Compile(CompileArgs),
|
Compile(CompileArgs),
|
||||||
/// Remove all `.pyc` in the tree.
|
/// Remove all `.pyc` in the tree.
|
||||||
|
|
@ -64,6 +63,9 @@ enum Cli {
|
||||||
FetchPython(FetchPythonArgs),
|
FetchPython(FetchPythonArgs),
|
||||||
/// Generate JSON schema for the TOML configuration file.
|
/// Generate JSON schema for the TOML configuration file.
|
||||||
GenerateJSONSchema(GenerateJsonSchemaArgs),
|
GenerateJSONSchema(GenerateJsonSchemaArgs),
|
||||||
|
#[cfg(feature = "render")]
|
||||||
|
/// Render the benchmarks.
|
||||||
|
RenderBenchmarks(RenderBenchmarksArgs),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[instrument] // Anchor span to check for overhead
|
#[instrument] // Anchor span to check for overhead
|
||||||
|
|
@ -75,11 +77,12 @@ async fn run() -> Result<()> {
|
||||||
println!("Wheel built to {}", target.display());
|
println!("Wheel built to {}", target.display());
|
||||||
}
|
}
|
||||||
Cli::WheelMetadata(args) => wheel_metadata::wheel_metadata(args).await?,
|
Cli::WheelMetadata(args) => wheel_metadata::wheel_metadata(args).await?,
|
||||||
Cli::RenderBenchmarks(args) => render_benchmarks::render_benchmarks(&args)?,
|
|
||||||
Cli::Compile(args) => compile::compile(args).await?,
|
Cli::Compile(args) => compile::compile(args).await?,
|
||||||
Cli::ClearCompile(args) => clear_compile::clear_compile(&args)?,
|
Cli::ClearCompile(args) => clear_compile::clear_compile(&args)?,
|
||||||
Cli::FetchPython(args) => fetch_python::fetch_python(args).await?,
|
Cli::FetchPython(args) => fetch_python::fetch_python(args).await?,
|
||||||
Cli::GenerateJSONSchema(args) => generate_json_schema::main(&args)?,
|
Cli::GenerateJSONSchema(args) => generate_json_schema::main(&args)?,
|
||||||
|
#[cfg(feature = "render")]
|
||||||
|
Cli::RenderBenchmarks(args) => render_benchmarks::render_benchmarks(&args)?,
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
#![cfg(feature = "render")]
|
||||||
|
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
use anyhow::{anyhow, Result};
|
use anyhow::{anyhow, Result};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue