diff --git a/README.rst b/README.rst index 74d20d6..caa565b 100644 --- a/README.rst +++ b/README.rst @@ -347,27 +347,26 @@ For specifics, see `pip_run.run() Environment Persistence ======================= -``pip-run`` honors the ``PIP_RUN_MODE`` variable. If unset or -set to ``ephemeral``, dependencies are installed to an ephemeral -temporary directory on each invocation (and deleted after). -Setting this variable to ``persist`` will instead create or re-use -a directory in the user's cache, only installing the dependencies if -the directory doesn't already exist. A separate cache is maintained -for each combination of requirements specified. - -``persist`` mode can greatly improve startup performance at the -expense of staleness and accumulated cruft. - -Without ``PIP_RUN_MODE=persist`` (or with ``=ephemeral``), ``pip-run`` will -re-install dependencies every time a script runs, silently adding to the -startup time while dependencies are installed into an ephemeral environment, -depending on how many dependencies there are and whether the dependencies have -been previously downloaded to the local pip cache. Use ``pip-run -v ...`` to -see the installation activity. +``pip-run`` honors the ``PIP_RUN_RETENTION_STRATEGY`` variable. If unset or +set to ``destroy``, dependencies are installed to a temporary directory on +each invocation (and deleted after). Setting this variable to ``persist`` will +instead create or re-use a directory in the user's cache, only installing the +dependencies if the directory doesn't already exist. A separate cache is +maintained for each combination of requirements specified. + +``persist`` strategy can greatly improve startup performance at the expense of +staleness and accumulated cruft. + +Without ``PIP_RUN_RETENTION_STRATEGY=persist`` (or with ``=destroy``), +``pip-run`` will re-install dependencies every time a script runs, silently +adding to the startup time while dependencies are installed into an ephemeral +environment, depending on how many dependencies there are and whether the +dependencies have been previously downloaded to the local pip cache. Use +``pip-run -v ...`` to see the installation activity. The location of the cache can be revealed with this command:: - py -c 'import importlib; print(importlib.import_module("pip_run.mode.persist").paths.user_cache_path)' + py -c 'import importlib; print(importlib.import_module("pip_run.retention.persist").paths.user_cache_path)' Limitations diff --git a/conftest.py b/conftest.py index ac9fcdc..817bcc8 100644 --- a/conftest.py +++ b/conftest.py @@ -51,7 +51,7 @@ class Paths: monkeypatch_session.setattr(pip_run.retention.persist, 'paths', Paths) -@pytest.fixture(params=['persist', 'ephemeral']) +@pytest.fixture(params=['persist', 'destroy']) def retention_strategy(monkeypatch, request): monkeypatch.setenv('PIP_RUN_RETENTION_STRATEGY', request.param) diff --git a/pip_run/deps.py b/pip_run/deps.py index 992d330..cb59310 100644 --- a/pip_run/deps.py +++ b/pip_run/deps.py @@ -60,12 +60,12 @@ def _mode_compat(): 'PIP_RUN_MODE is deprecated. Use PIP_RUN_RETENTION_STRATEGY instead.', DeprecationWarning, ) - return mode + return mode.replace('ephemeral', 'destroy') def retention_strategy(): strategy = ( - os.environ.get('PIP_RUN_RETENTION_STRATEGY') or _mode_compat() or 'ephemeral' + os.environ.get('PIP_RUN_RETENTION_STRATEGY') or _mode_compat() or 'destroy' ) return importlib.import_module(f'.retention.{strategy}', package=__package__) diff --git a/pip_run/retention/ephemeral.py b/pip_run/retention/destroy.py similarity index 100% rename from pip_run/retention/ephemeral.py rename to pip_run/retention/destroy.py