Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add wheels cli #20

Merged
merged 24 commits into from
Nov 12, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
error handling for missing dependencies
joemarshall committed Sep 22, 2023
commit 55d7fdd346ea4ac14bfad0d51b50d7723c9d56a7
12 changes: 8 additions & 4 deletions pyodide_lock/spec.py
Original file line number Diff line number Diff line change
@@ -98,7 +98,7 @@ def check_wheel_filenames(self) -> None:
f"{name}:\n - " + "\n - ".join(errs)
for name, errs in errors.items()
)
raise ValueError(error_msg)
raise RuntimeError(error_msg)

def add_wheels(
self,
@@ -151,16 +151,16 @@ def add_wheels(

if platform_tag == "any":
if python_tag not in python_pure_tags:
raise ValueError(
raise RuntimeError(
f"Wheel {f} is built for incorrect python version {python_tag}, this lockfile expects {python_binary_tag} or one of {python_pure_tags}"
)
elif platform_tag != target_platform:
raise ValueError(
raise RuntimeError(
f"Wheel {f} is built for incorrect platform {platform_tag}, this lockfile expects {target_platform}"
)
else:
if python_tag != python_binary_tag:
raise ValueError(
raise RuntimeError(
f"Wheel {f} is built for incorrect python version {python_tag}, this lockfile expects {python_binary_tag}"
)

@@ -207,6 +207,8 @@ def add_wheels(
requirements_with_extras.append(r)
if req_name in new_packages or req_name in self.packages:
our_depends.append(req_name)
else:
raise RuntimeError(f"Requirement {req_name} is not in this distribution.")
package.depends = our_depends

while len(requirements_with_extras) != 0:
@@ -236,5 +238,7 @@ def add_wheels(
our_depends.append(req_name)
if r.extras:
requirements_with_extras.append(r)
else:
raise RuntimeError(f"Requirement {req_name} is not in this distribution.")
package.depends = our_depends
self.packages.update(new_packages)