Skip to content

Commit

Permalink
Merge pull request #152 from ijl/517-cargo
Browse files Browse the repository at this point in the history
Error messages for bad cargo/rust environment during PEP517 install
  • Loading branch information
konstin authored Jun 27, 2019
2 parents 098c2c1 + 970e0ba commit 248d2e5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pyo3_pack/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,16 @@ def get_requires_for_build_sdist(config_settings=None):

# noinspection PyUnusedLocal
def prepare_metadata_for_build_wheel(metadata_directory, config_settings=None):
print("Checking for Rust toolchain....")
output = subprocess.check_output(["cargo", "--version"]).decode("utf-8", "ignore")
if not "cargo" in output:
sys.stderr.write(
"cargo, the Rust language build tool, is not installed or is not on PATH.\n"
"This package requires Rust to compile extensions. Install it through\n"
"the system's package manager or via https://rustup.rs/\n"
)
sys.exit(1)

command = [
"pyo3-pack",
"pep517",
Expand Down

0 comments on commit 248d2e5

Please sign in to comment.