Skip to content

Commit

Permalink
Merge pull request #1045 from messense/sdist-missing-pyproject-toml
Browse files Browse the repository at this point in the history
Clarify sdist build error due to missing `pyproject.toml`
  • Loading branch information
messense authored Aug 7, 2022
2 parents 3cc99ae + b5d6a46 commit 88326ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/build_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ pub struct BuildContext {
pub bridge: BridgeModel,
/// Whether this project is pure rust or rust mixed with python
pub project_layout: ProjectLayout,
/// Parsed project.toml if any
/// Parsed pyproject.toml if any
pub pyproject_toml: Option<PyProjectToml>,
/// Python Package Metadata 2.1
pub metadata21: Metadata21,
Expand Down
8 changes: 5 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ fn pep517(subcommand: Pep517Command) -> Result<()> {
let build_context = build_options.into_build_context(false, false, false)?;
let (path, _) = build_context
.build_source_distribution()?
.context("Failed to build source distribution")?;
.context("Failed to build source distribution, pyproject.toml not found")?;
println!("{}", path.file_name().unwrap().to_str().unwrap());
}
};
Expand All @@ -325,7 +325,9 @@ fn run() -> Result<()> {
} => {
let build_context = build.into_build_context(release, strip, false)?;
if sdist {
build_context.build_source_distribution()?;
build_context
.build_source_distribution()?
.context("Failed to build source distribution, pyproject.toml not found")?;
}
let wheels = build_context.build_wheels()?;
assert!(!wheels.is_empty());
Expand Down Expand Up @@ -406,7 +408,7 @@ fn run() -> Result<()> {
let build_context = build_options.into_build_context(false, false, false)?;
build_context
.build_source_distribution()?
.context("Failed to build source distribution")?;
.context("Failed to build source distribution, pyproject.toml not found")?;
}
Opt::Pep517(subcommand) => pep517(subcommand)?,
Opt::InitProject { path, options } => init_project(path, options)?,
Expand Down

0 comments on commit 88326ac

Please sign in to comment.