Skip to content

Commit

Permalink
more cache clearing?
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimergp committed Jan 2, 2024
1 parent 4188cac commit 2794288
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion conda_pip/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
keep_refs_alive = []


def analyze_dependencies(*packages: str, prefer_on_conda=True, channel="conda-forge"):
def analyze_dependencies(*packages: str, prefer_on_conda=True, channel="conda-forge", backend="grayskull"):
conda_deps = defaultdict(list)
pypi_deps = defaultdict(list)
for package in packages:
Expand Down
5 changes: 4 additions & 1 deletion tests/test_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,18 @@ def test_pip_required_in_target_env(tmp_env: TmpEnvFixture, conda_cli: CondaCLIF
out, err, rc = conda_cli("install", "-p", prefix, "--yes", "python=3.9")
PrefixData._cache_.clear() # clear cache to force re-read of prefix
assert package_is_installed(str(prefix), "python=3.9")
assert not package_is_installed(str(prefix), "pip")
PrefixData._cache_.clear()

with pytest.raises(CondaError, match="does not have pip installed"):
out, err, rc = conda_cli(*args)
out, err, rc = conda_cli("install", "-p", prefix, "--yes", "pip")
PrefixData._cache_.clear() # clear cache to force re-read of prefix
assert package_is_installed(str(prefix), "pip")
PrefixData._cache_.clear()

out, err, rc = conda_cli(*args)
PrefixData._cache_.clear() # clear cache to force re-read of prefix
PrefixData._cache_.clear()
assert rc == 0
assert package_is_installed(str(prefix), "requests")
monkeypatch.undo()
Expand Down

0 comments on commit 2794288

Please sign in to comment.