Skip to content

Commit

Permalink
remove base env protection (#43)
Browse files Browse the repository at this point in the history
* remove base env protection

CI should fail now

* remove from libmamba-draft too

* xfail the base env protection test
  • Loading branch information
jaimergp committed Jun 14, 2022
1 parent f41396e commit a0c2b47
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 25 deletions.
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,6 @@ If you don't want to use the experimental solver anymore, you can uninstall it w
$ conda remove conda-libmamba-solver
```

### Why can't I use the experimental solver on the `base` environment?

This decision has been made to protect your `base` installation from unexpected changes. This
package is still in a experimental phase and, as a result, you can only use it in non-base
environments for now.

### How do I configure conda to use the experimental solver permanently?

Use the following command:
Expand Down
8 changes: 0 additions & 8 deletions conda_libmamba_solver/_libmamba.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,6 @@ def solve_final_state(
if not context.json and not context.quiet:
print("------ USING EXPERIMENTAL LIBMAMBA INTEGRATIONS ------")

if "PYTEST_CURRENT_TEST" not in os.environ and paths_equal(
self.prefix, context.root_prefix
):
raise CondaEnvironmentError(
f"{self.__class__.__name__} is not allowed on the base environment during "
"the experimental release phase. Try using it on a non-base environment!"
)

# 0. Identify strategies
kwargs = self._merge_signature_flags_with_context(
update_modifier=update_modifier,
Expand Down
11 changes: 0 additions & 11 deletions conda_libmamba_solver/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ def solve_final_state(
global BLURB_COUNT
if not BLURB_COUNT:
self._print_info()
self._check_env_is_base()
BLURB_COUNT += 1

in_state = SolverInputState(
Expand Down Expand Up @@ -435,16 +434,6 @@ def _print_info(self):
log.info("Specs to add: %s", self.specs_to_add)
log.info("Specs to remove: %s", self.specs_to_remove)

def _check_env_is_base(self):
if "PYTEST_CURRENT_TEST" in os.environ:
return

if paths_equal(self.prefix, context.root_prefix):
raise CondaEnvironmentError(
f"{self.__class__.__name__} is not allowed on the base environment during "
"the experimental release phase. Try using it on a non-base environment!"
)

def _setup_solver(self, index: LibMambaIndexHelper):
self._solver_options = solver_options = [
(api.SOLVER_FLAG_ALLOW_DOWNGRADE, 1),
Expand Down
1 change: 1 addition & 0 deletions tests/test_experimental.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def print_and_check_output(*args, **kwargs):
return process


@pytest.mark.xfail(reason="base protections not enabled anymore")
@pytest.mark.parametrize("solver", ("libmamba", "libmamba-draft"))
def test_protection_for_base_env(solver):
with pytest.raises(CondaEnvironmentError), fresh_context(CONDA_EXPERIMENTAL_SOLVER=solver):
Expand Down

0 comments on commit a0c2b47

Please sign in to comment.