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: Wrap conda_executable in _maybe_exe for Windows #186

Merged
merged 4 commits into from
Aug 20, 2024
Merged
Changes from 3 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
4 changes: 4 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -559,6 +559,10 @@ def test_find_conda_windows() -> None:
assert path in excinfo.value.args[0]


@pytest.mark.skipif(
os.name == "nt",
reason="On Windows it will search for Conda because of `_maybe_exe`.",
)
def test_maybe_conda_run() -> None:
result = _maybe_conda_run("conda", "my_env", None)
assert result == ["conda", "run", "--name", "my_env"]
2 changes: 1 addition & 1 deletion unidep/_cli.py
Original file line number Diff line number Diff line change
@@ -1058,7 +1058,7 @@ def _maybe_conda_run(
env_args = ["--name", conda_env_name]
elif conda_env_prefix:
env_args = ["--prefix", str(conda_env_prefix)]
return [conda_executable, "run", *env_args]
return [_maybe_exe(conda_executable), "run", *env_args]


def _create_env_from_lock( # noqa: PLR0912