mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 10:58:28 +00:00
Add support for subdirectories in URL dependencies (#312)
Closes https://github.com/astral-sh/puffin/issues/307.
This commit is contained in:
parent
cbfd6af125
commit
edce4ccb24
9 changed files with 155 additions and 29 deletions
|
@ -21,7 +21,10 @@ pub(crate) struct BuildArgs {
|
|||
/// Directory to story the built wheel in
|
||||
#[clap(short, long)]
|
||||
wheels: Option<PathBuf>,
|
||||
/// The source distribution to build, either a directory or a source archive.
|
||||
sdist: PathBuf,
|
||||
/// The subdirectory to build within the source distribution.
|
||||
subdirectory: Option<PathBuf>,
|
||||
}
|
||||
|
||||
/// Build a source distribution to a wheel
|
||||
|
@ -49,9 +52,13 @@ pub(crate) async fn build(args: BuildArgs) -> Result<PathBuf> {
|
|||
venv.interpreter_info().clone(),
|
||||
fs::canonicalize(venv.python_executable())?,
|
||||
);
|
||||
let builder =
|
||||
SourceDistributionBuilder::setup(&args.sdist, venv.interpreter_info(), &build_dispatch)
|
||||
.await?;
|
||||
let builder = SourceDistributionBuilder::setup(
|
||||
&args.sdist,
|
||||
args.subdirectory.as_deref(),
|
||||
venv.interpreter_info(),
|
||||
&build_dispatch,
|
||||
)
|
||||
.await?;
|
||||
let wheel = builder.build(&wheel_dir)?;
|
||||
Ok(wheel_dir.join(wheel))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue