Skip to content

Commit

Permalink
fix: add wheel command to not generate output
Browse files Browse the repository at this point in the history
  • Loading branch information
Konkrad committed Jun 8, 2024
1 parent 5212b7f commit 7756474
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyodide_lock/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def add_wheels(
"""
sp = PyodideLockSpec.from_json(input)
add_wheels_to_spec(
sp = add_wheels_to_spec(
sp,
wheels,
base_path=base_path,
Expand Down
21 changes: 21 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from pathlib import Path
import gzip
import shutil

DATA_DIR = Path(__file__).parent / "data"

from pyodide_lock.cli import add_wheels

def test_cli_modify_file(test_wheel_list, tmp_path):
source_path = DATA_DIR / f"pyodide-lock-0.23.3.json.gz"
target_path = tmp_path / "pyodide-lock.json"
new_lock_path = tmp_path / "pyodide-lock.json"

with gzip.open(source_path) as fh_in:
with target_path.open("wb") as fh_out:
shutil.copyfileobj(fh_in, fh_out)

add_wheels(wheels=test_wheel_list, input=target_path, output=new_lock_path)
assert target_path.read_text() != new_lock_path.read_text()


0 comments on commit 7756474

Please sign in to comment.