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

fix: add wheel command to not generate output #29

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
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
26 changes: 26 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from pathlib import Path
import gzip
import shutil

from typer.testing import CliRunner
from pyodide_lock.cli import main

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


runner = CliRunner()

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)

result = runner.invoke(main, ["--input="+str(target_path), "--output="+str(new_lock_path), str(test_wheel_list[0])])
assert result.exit_code == 0
assert target_path.read_text() != new_lock_path.read_text()


Loading