Skip to content

Commit 88c41f2

Browse files
committed
fix: add wheel command to not generate output
1 parent 5212b7f commit 88c41f2

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

pyodide_lock/cli.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def add_wheels(
4747
4848
"""
4949
sp = PyodideLockSpec.from_json(input)
50-
add_wheels_to_spec(
50+
sp = add_wheels_to_spec(
5151
sp,
5252
wheels,
5353
base_path=base_path,

tests/test_cli.py

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
DATA_DIR = Path(__file__).parent / "data"
2+
3+
from pyodide_lock.cli import add_wheels
4+
5+
def test_cli_modify_file(test_wheel_list, tmp_path):
6+
source_path = DATA_DIR / f"pyodide-lock-0.23.3.json.gz"
7+
target_path = tmp_path / "pyodide-lock.json"
8+
new_lock_path = tmp_path / "pyodide-lock.json"
9+
10+
with gzip.open(source_path) as fh_in:
11+
with target_path.open("wb") as fh_out:
12+
shutil.copyfileobj(fh_in, fh_out)
13+
14+
add_wheels(test_wheel_list, input=target_path, output=new_lock_path)
15+
assert target_path.read_text() != new_lock_path.read_text()
16+
17+

0 commit comments

Comments
 (0)