Skip to content

Commit 7756474

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

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-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

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

0 commit comments

Comments
 (0)