From a073856bf4681adebc7f6e9029f4dc128c5d5911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Gia=20Phong?= Date: Fri, 3 Jul 2020 22:33:21 +0700 Subject: [PATCH 1/5] Use lazy wheel to obtain dep info for new resolver --- .../resolution/resolvelib/candidates.py | 71 +++++++++++++------ 1 file changed, 50 insertions(+), 21 deletions(-) diff --git a/src/pip/_internal/resolution/resolvelib/candidates.py b/src/pip/_internal/resolution/resolvelib/candidates.py index 1ee46430292..9507a9e5585 100644 --- a/src/pip/_internal/resolution/resolvelib/candidates.py +++ b/src/pip/_internal/resolution/resolvelib/candidates.py @@ -1,16 +1,19 @@ import logging import sys +from pip._vendor.contextlib2 import suppress from pip._vendor.packaging.specifiers import InvalidSpecifier, SpecifierSet from pip._vendor.packaging.utils import canonicalize_name from pip._vendor.packaging.version import Version from pip._internal.exceptions import HashError, MetadataInconsistent +from pip._internal.network.lazy_wheel import dist_from_wheel_url from pip._internal.req.constructors import ( install_req_from_editable, install_req_from_line, ) from pip._internal.req.req_install import InstallRequirement +from pip._internal.utils.logging import indent_log from pip._internal.utils.misc import dist_is_editable, normalize_version_info from pip._internal.utils.packaging import get_requires_python from pip._internal.utils.typing import MYPY_CHECK_RUNNING @@ -197,6 +200,18 @@ def _prepare_abstract_distribution(self): # type: () -> AbstractDistribution raise NotImplementedError("Override in subclass") + def _check_metadata_consistency(self, dist): + # type: (Distribution) -> None + """Check for consistency of project name and version of dist.""" + # TODO: (Longer term) Rather than abort, reject this candidate + # and backtrack. This would need resolvelib support. + name = canonicalize_name(dist.project_name) + if self._name is not None and self._name != name: + raise MetadataInconsistent(self._ireq, "name", dist.project_name) + version = dist.parsed_version + if self._version is not None and self._version != version: + raise MetadataInconsistent(self._ireq, "version", dist.version) + def _prepare(self): # type: () -> None if self._dist is not None: @@ -210,19 +225,7 @@ def _prepare(self): self._dist = abstract_dist.get_pkg_resources_distribution() assert self._dist is not None, "Distribution already installed" - - # TODO: (Longer term) Rather than abort, reject this candidate - # and backtrack. This would need resolvelib support. - name = canonicalize_name(self._dist.project_name) - if self._name is not None and self._name != name: - raise MetadataInconsistent( - self._ireq, "name", self._dist.project_name, - ) - version = self._dist.parsed_version - if self._version is not None and self._version != version: - raise MetadataInconsistent( - self._ireq, "version", self._dist.version, - ) + self._check_metadata_consistency(self._dist) @property def dist(self): @@ -230,30 +233,35 @@ def dist(self): self._prepare() return self._dist - def _get_requires_python_specifier(self): - # type: () -> Optional[SpecifierSet] - requires_python = get_requires_python(self.dist) + def _get_requires_python_specifier(self, dist): + # type: (Distribution) -> Optional[SpecifierSet] + requires_python = get_requires_python(dist) if requires_python is None: return None try: spec = SpecifierSet(requires_python) except InvalidSpecifier as e: + name = canonicalize_name(dist.project_name) logger.warning( - "Package %r has an invalid Requires-Python: %s", self.name, e, + "Package %r has an invalid Requires-Python: %s", name, e, ) return None return spec - def iter_dependencies(self): - # type: () -> Iterable[Optional[Requirement]] - for r in self.dist.requires(): + def _iter_dependencies(self, dist): + # type: (Distribution) -> Iterable[Optional[Requirement]] + for r in dist.requires(): yield self._factory.make_requirement_from_spec(str(r), self._ireq) python_dep = self._factory.make_requires_python_requirement( - self._get_requires_python_specifier(), + self._get_requires_python_specifier(dist), ) if python_dep: yield python_dep + def iter_dependencies(self): + # type: () -> Iterable[Optional[Requirement]] + return self._iter_dependencies(self.dist) + def get_install_requirement(self): # type: () -> Optional[InstallRequirement] self._prepare() @@ -293,6 +301,27 @@ def __init__( version=version, ) + def iter_dependencies(self): + # type: () -> Iterable[Optional[Requirement]] + dist = None # type: Optional[Distribution] + preparer, req = self._factory.preparer, self._ireq + remote_wheel = self._link.is_wheel and not self._link.is_file + # TODO: Opt-in as unstable feature. + if remote_wheel and not preparer.require_hashes: + assert self._name is not None + logger.info('Collecting %s', req.req or req) + # If RuntimeError is raised, fallback to self.dist. + with indent_log(), suppress(RuntimeError): + logger.info( + 'Obtaining dependency information from %s %s', + self._name, self._version, + ) + url = self._link.url.split('#', 1)[0] + session = preparer.downloader._session + dist = dist_from_wheel_url(self._name, url, session) + self._check_metadata_consistency(dist) + return self._iter_dependencies(dist or self.dist) + def _prepare_abstract_distribution(self): # type: () -> AbstractDistribution return self._factory.preparer.prepare_linked_requirement( From d718192a8c4c08cd1ca26c22f9a9f96488745c79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Gia=20Phong?= Date: Sun, 5 Jul 2020 17:46:40 +0700 Subject: [PATCH 2/5] Opt-in lazy wheel as a --use-feature By invoking pip with --use-feature=lazy-wheel, the new resolver will try to obtain dependency information by lazily download wheels by HTTP range requests. --- news/8532.feature | 3 +++ src/pip/_internal/cli/cmdoptions.py | 2 +- src/pip/_internal/cli/req_command.py | 1 + src/pip/_internal/resolution/resolvelib/candidates.py | 7 +++---- src/pip/_internal/resolution/resolvelib/factory.py | 2 ++ src/pip/_internal/resolution/resolvelib/resolver.py | 2 ++ 6 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 news/8532.feature diff --git a/news/8532.feature b/news/8532.feature new file mode 100644 index 00000000000..9f2f9c2b7a6 --- /dev/null +++ b/news/8532.feature @@ -0,0 +1,3 @@ +Allow the new resolver to obtain dependency information through wheels +lazily downloaded using HTTP range requests. To enable this feature, +invoke ``pip`` with ``--use-feature=lazy-wheel``. diff --git a/src/pip/_internal/cli/cmdoptions.py b/src/pip/_internal/cli/cmdoptions.py index 2a4c230f6b5..a6609edd7d7 100644 --- a/src/pip/_internal/cli/cmdoptions.py +++ b/src/pip/_internal/cli/cmdoptions.py @@ -916,7 +916,7 @@ def check_list_path_option(options): metavar='feature', action='append', default=[], - choices=['2020-resolver'], + choices=['2020-resolver', 'lazy-wheel'], help='Enable new functionality, that may be backward incompatible.', ) # type: Callable[..., Option] diff --git a/src/pip/_internal/cli/req_command.py b/src/pip/_internal/cli/req_command.py index 50a60c8ed5a..507f87cfb27 100644 --- a/src/pip/_internal/cli/req_command.py +++ b/src/pip/_internal/cli/req_command.py @@ -271,6 +271,7 @@ def make_resolver( force_reinstall=force_reinstall, upgrade_strategy=upgrade_strategy, py_version_info=py_version_info, + lazy_wheel='lazy-wheel' in options.features_enabled, ) import pip._internal.resolution.legacy.resolver return pip._internal.resolution.legacy.resolver.Resolver( diff --git a/src/pip/_internal/resolution/resolvelib/candidates.py b/src/pip/_internal/resolution/resolvelib/candidates.py index 9507a9e5585..d3cb945eb75 100644 --- a/src/pip/_internal/resolution/resolvelib/candidates.py +++ b/src/pip/_internal/resolution/resolvelib/candidates.py @@ -304,12 +304,11 @@ def __init__( def iter_dependencies(self): # type: () -> Iterable[Optional[Requirement]] dist = None # type: Optional[Distribution] - preparer, req = self._factory.preparer, self._ireq + preparer, lazy_wheel = self._factory.preparer, self._factory.lazy_wheel remote_wheel = self._link.is_wheel and not self._link.is_file - # TODO: Opt-in as unstable feature. - if remote_wheel and not preparer.require_hashes: + if lazy_wheel and remote_wheel and not preparer.require_hashes: assert self._name is not None - logger.info('Collecting %s', req.req or req) + logger.info('Collecting %s', self._ireq.req or self._ireq) # If RuntimeError is raised, fallback to self.dist. with indent_log(), suppress(RuntimeError): logger.info( diff --git a/src/pip/_internal/resolution/resolvelib/factory.py b/src/pip/_internal/resolution/resolvelib/factory.py index 81f887c6b1e..c4b0f9f23e5 100644 --- a/src/pip/_internal/resolution/resolvelib/factory.py +++ b/src/pip/_internal/resolution/resolvelib/factory.py @@ -82,6 +82,7 @@ def __init__( ignore_installed, # type: bool ignore_requires_python, # type: bool py_version_info=None, # type: Optional[Tuple[int, ...]] + lazy_wheel=False, # type: bool ): # type: (...) -> None self._finder = finder @@ -92,6 +93,7 @@ def __init__( self._use_user_site = use_user_site self._force_reinstall = force_reinstall self._ignore_requires_python = ignore_requires_python + self.lazy_wheel = lazy_wheel self._link_candidate_cache = {} # type: Cache[LinkCandidate] self._editable_candidate_cache = {} # type: Cache[EditableCandidate] diff --git a/src/pip/_internal/resolution/resolvelib/resolver.py b/src/pip/_internal/resolution/resolvelib/resolver.py index d2ac9d0418a..2c4724b491c 100644 --- a/src/pip/_internal/resolution/resolvelib/resolver.py +++ b/src/pip/_internal/resolution/resolvelib/resolver.py @@ -49,6 +49,7 @@ def __init__( force_reinstall, # type: bool upgrade_strategy, # type: str py_version_info=None, # type: Optional[Tuple[int, ...]] + lazy_wheel=False, # type: bool ): super(Resolver, self).__init__() @@ -64,6 +65,7 @@ def __init__( ignore_installed=ignore_installed, ignore_requires_python=ignore_requires_python, py_version_info=py_version_info, + lazy_wheel=lazy_wheel, ) self.ignore_dependencies = ignore_dependencies self.upgrade_strategy = upgrade_strategy From c127459c13c6ca9e74ea5c6873a708ee3edf93a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Gia=20Phong?= Date: Mon, 6 Jul 2020 11:09:47 +0700 Subject: [PATCH 3/5] Use more descriptive exception when range requests are unsupported --- src/pip/_internal/network/lazy_wheel.py | 14 +++++++++---- .../resolution/resolvelib/candidates.py | 20 +++++++++++++------ tests/unit/test_network_lazy_wheel.py | 7 +++++-- 3 files changed, 29 insertions(+), 12 deletions(-) diff --git a/src/pip/_internal/network/lazy_wheel.py b/src/pip/_internal/network/lazy_wheel.py index d7b8bcc21ac..87eea3676c2 100644 --- a/src/pip/_internal/network/lazy_wheel.py +++ b/src/pip/_internal/network/lazy_wheel.py @@ -1,6 +1,6 @@ """Lazy ZIP over HTTP""" -__all__ = ['dist_from_wheel_url'] +__all__ = ['HTTPRangeRequestUnsupported', 'dist_from_wheel_url'] from bisect import bisect_left, bisect_right from contextlib import contextmanager @@ -23,13 +23,18 @@ from pip._internal.network.session import PipSession +class HTTPRangeRequestUnsupported(RuntimeError): + pass + + def dist_from_wheel_url(name, url, session): # type: (str, str, PipSession) -> Distribution """Return a pkg_resources.Distribution from the given wheel URL. This uses HTTP range requests to only fetch the potion of the wheel containing metadata, just enough for the object to be constructed. - If such requests are not supported, RuntimeError is raised. + If such requests are not supported, HTTPRangeRequestUnsupported + is raised. """ with LazyZipOverHTTP(url, session) as wheel: # For read-only ZIP files, ZipFile only needs methods read, @@ -45,7 +50,8 @@ class LazyZipOverHTTP(object): This uses HTTP range requests to lazily fetch the file's content, which is supposed to be fed to ZipFile. If such requests are not - supported by the server, raise RuntimeError during initialization. + supported by the server, raise HTTPRangeRequestUnsupported + during initialization. """ def __init__(self, url, session, chunk_size=CONTENT_CHUNK_SIZE): @@ -60,7 +66,7 @@ def __init__(self, url, session, chunk_size=CONTENT_CHUNK_SIZE): self._left = [] # type: List[int] self._right = [] # type: List[int] if 'bytes' not in head.headers.get('Accept-Ranges', 'none'): - raise RuntimeError('range request is not supported') + raise HTTPRangeRequestUnsupported('range request is not supported') self._check_zip() @property diff --git a/src/pip/_internal/resolution/resolvelib/candidates.py b/src/pip/_internal/resolution/resolvelib/candidates.py index d3cb945eb75..9b0e2900801 100644 --- a/src/pip/_internal/resolution/resolvelib/candidates.py +++ b/src/pip/_internal/resolution/resolvelib/candidates.py @@ -1,13 +1,15 @@ import logging import sys -from pip._vendor.contextlib2 import suppress from pip._vendor.packaging.specifiers import InvalidSpecifier, SpecifierSet from pip._vendor.packaging.utils import canonicalize_name from pip._vendor.packaging.version import Version from pip._internal.exceptions import HashError, MetadataInconsistent -from pip._internal.network.lazy_wheel import dist_from_wheel_url +from pip._internal.network.lazy_wheel import ( + HTTPRangeRequestUnsupported, + dist_from_wheel_url, +) from pip._internal.req.constructors import ( install_req_from_editable, install_req_from_line, @@ -309,16 +311,22 @@ def iter_dependencies(self): if lazy_wheel and remote_wheel and not preparer.require_hashes: assert self._name is not None logger.info('Collecting %s', self._ireq.req or self._ireq) - # If RuntimeError is raised, fallback to self.dist. - with indent_log(), suppress(RuntimeError): + with indent_log(): logger.info( 'Obtaining dependency information from %s %s', self._name, self._version, ) url = self._link.url.split('#', 1)[0] session = preparer.downloader._session - dist = dist_from_wheel_url(self._name, url, session) - self._check_metadata_consistency(dist) + try: + dist = dist_from_wheel_url(self._name, url, session) + except HTTPRangeRequestUnsupported: + logger.debug( + 'Failed to get dependency information ' + 'using HTTP range requests from %s', url, + ) + else: + self._check_metadata_consistency(dist) return self._iter_dependencies(dist or self.dist) def _prepare_abstract_distribution(self): diff --git a/tests/unit/test_network_lazy_wheel.py b/tests/unit/test_network_lazy_wheel.py index 694d126859f..331b87e7c88 100644 --- a/tests/unit/test_network_lazy_wheel.py +++ b/tests/unit/test_network_lazy_wheel.py @@ -3,7 +3,10 @@ from pip._vendor.pkg_resources import Requirement from pytest import fixture, mark, raises -from pip._internal.network.lazy_wheel import dist_from_wheel_url +from pip._internal.network.lazy_wheel import ( + HTTPRangeRequestUnsupported, + dist_from_wheel_url, +) from pip._internal.network.session import PipSession from tests.lib.requests_mocks import MockResponse @@ -39,7 +42,7 @@ def test_dist_from_wheel_url(session): def test_dist_from_wheel_url_no_range(session, monkeypatch): """Test handling when HTTP range requests are not supported.""" monkeypatch.setattr(session, 'head', lambda *a, **kw: MockResponse(b'')) - with raises(RuntimeError): + with raises(HTTPRangeRequestUnsupported): dist_from_wheel_url('mypy', MYPY_0_782_WHL, session) From 4db613ca87b02cf3ecbb0ca34f6357aef8b80a73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Gia=20Phong?= Date: Fri, 10 Jul 2020 22:58:36 +0700 Subject: [PATCH 4/5] Run tests for lazy wheel on Travis --- .travis.yml | 16 ++++++++++++++++ tests/conftest.py | 16 +++++++++++++--- tools/travis/run.sh | 12 +++++++++--- 3 files changed, 38 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7c41f5fbccb..a1c63694729 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,18 +38,34 @@ jobs: env: - GROUP=1 - NEW_RESOLVER=1 + - env: + - GROUP=1 + - NEW_RESOLVER=1 + - LAZY_WHEEL=1 + - env: + - GROUP=2 + - NEW_RESOLVER=1 - env: - GROUP=2 - NEW_RESOLVER=1 + - LAZY_WHEEL=1 - env: - GROUP=3 - NEW_RESOLVER=1 + - env: + - GROUP=3 + - NEW_RESOLVER=1 + - LAZY_WHEEL=1 fast_finish: true allow_failures: - env: - GROUP=3 - NEW_RESOLVER=1 + - env: + - GROUP=3 + - NEW_RESOLVER=1 + - LAZY_WHEEL=1 before_install: tools/travis/setup.sh install: travis_retry tools/travis/install.sh diff --git a/tests/conftest.py b/tests/conftest.py index 0db6d96725e..7ad2da2195b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -47,6 +47,12 @@ def pytest_addoption(parser): default=False, help="run the skipped tests for the new resolver", ) + parser.addoption( + "--lazy-wheel", + action="store_true", + default=False, + help="use lazy wheels in tests (only affect new resolver)", + ) parser.addoption( "--use-venv", action="store_true", @@ -102,12 +108,16 @@ def pytest_collection_modifyitems(config, items): @pytest.fixture(scope="session", autouse=True) def use_new_resolver(request): """Set environment variable to make pip default to the new resolver. + + Lazy wheel, an optimization, is also decided here. """ new_resolver = request.config.getoption("--new-resolver") - if new_resolver: - os.environ["PIP_USE_FEATURE"] = "2020-resolver" - else: + if not new_resolver: os.environ.pop("PIP_USE_FEATURE", None) + elif request.config.getoption("--lazy-wheel"): + os.environ["PIP_USE_FEATURE"] = "2020-resolver lazy-wheel" + else: + os.environ["PIP_USE_FEATURE"] = "2020-resolver" yield new_resolver diff --git a/tools/travis/run.sh b/tools/travis/run.sh index a531cbb56fd..2ff25924e39 100755 --- a/tools/travis/run.sh +++ b/tools/travis/run.sh @@ -43,6 +43,12 @@ else RESOLVER_SWITCH='--new-resolver' fi +if [[ -z "$LAZY_WHEEL" ]]; then + LAZY_WHEEL_SWITCH='' +else + LAZY_WHEEL_SWITCH='--lazy-wheel' +fi + # Print the commands run for this test. set -x if [[ "$GROUP" == "1" ]]; then @@ -50,15 +56,15 @@ if [[ "$GROUP" == "1" ]]; then tox -- --use-venv -m unit -n auto # Integration tests (not the ones for 'pip install') tox -- -m integration -n auto --duration=5 -k "not test_install" \ - --use-venv $RESOLVER_SWITCH + --use-venv $RESOLVER_SWITCH $LAZY_WHEEL_SWITCH elif [[ "$GROUP" == "2" ]]; then # Separate Job for running integration tests for 'pip install' tox -- -m integration -n auto --duration=5 -k "test_install" \ - --use-venv $RESOLVER_SWITCH + --use-venv $RESOLVER_SWITCH $LAZY_WHEEL_SWITCH elif [[ "$GROUP" == "3" ]]; then # Separate Job for tests that fail with the new resolver tox -- -m fails_on_new_resolver -n auto --duration=5 \ - --use-venv $RESOLVER_SWITCH --new-resolver-runtests + --use-venv $RESOLVER_SWITCH --new-resolver-runtests $LAZY_WHEEL_SWITCH else # Non-Testing Jobs should run once tox From c53aeac2973c46ce22caff5ce3cc8e88312b6ca8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Gia=20Phong?= Date: Mon, 13 Jul 2020 16:10:44 +0700 Subject: [PATCH 5/5] Rename experimental feature lazy-wheel to fast-deps --- .travis.yml | 8 ++++---- news/8532.feature | 2 +- src/pip/_internal/cli/cmdoptions.py | 2 +- src/pip/_internal/cli/req_command.py | 2 +- tests/conftest.py | 6 +++--- tools/travis/run.sh | 12 ++++++------ 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index a1c63694729..85aa29dee97 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,21 +41,21 @@ jobs: - env: - GROUP=1 - NEW_RESOLVER=1 - - LAZY_WHEEL=1 + - FAST_DEPS=1 - env: - GROUP=2 - NEW_RESOLVER=1 - env: - GROUP=2 - NEW_RESOLVER=1 - - LAZY_WHEEL=1 + - FAST_DEPS=1 - env: - GROUP=3 - NEW_RESOLVER=1 - env: - GROUP=3 - NEW_RESOLVER=1 - - LAZY_WHEEL=1 + - FAST_DEPS=1 fast_finish: true allow_failures: @@ -65,7 +65,7 @@ jobs: - env: - GROUP=3 - NEW_RESOLVER=1 - - LAZY_WHEEL=1 + - FAST_DEPS=1 before_install: tools/travis/setup.sh install: travis_retry tools/travis/install.sh diff --git a/news/8532.feature b/news/8532.feature index 9f2f9c2b7a6..273715bb009 100644 --- a/news/8532.feature +++ b/news/8532.feature @@ -1,3 +1,3 @@ Allow the new resolver to obtain dependency information through wheels lazily downloaded using HTTP range requests. To enable this feature, -invoke ``pip`` with ``--use-feature=lazy-wheel``. +invoke ``pip`` with ``--use-feature=fast-deps``. diff --git a/src/pip/_internal/cli/cmdoptions.py b/src/pip/_internal/cli/cmdoptions.py index a6609edd7d7..911914169ef 100644 --- a/src/pip/_internal/cli/cmdoptions.py +++ b/src/pip/_internal/cli/cmdoptions.py @@ -916,7 +916,7 @@ def check_list_path_option(options): metavar='feature', action='append', default=[], - choices=['2020-resolver', 'lazy-wheel'], + choices=['2020-resolver', 'fast-deps'], help='Enable new functionality, that may be backward incompatible.', ) # type: Callable[..., Option] diff --git a/src/pip/_internal/cli/req_command.py b/src/pip/_internal/cli/req_command.py index 507f87cfb27..78b5ce6a141 100644 --- a/src/pip/_internal/cli/req_command.py +++ b/src/pip/_internal/cli/req_command.py @@ -271,7 +271,7 @@ def make_resolver( force_reinstall=force_reinstall, upgrade_strategy=upgrade_strategy, py_version_info=py_version_info, - lazy_wheel='lazy-wheel' in options.features_enabled, + lazy_wheel='fast-deps' in options.features_enabled, ) import pip._internal.resolution.legacy.resolver return pip._internal.resolution.legacy.resolver.Resolver( diff --git a/tests/conftest.py b/tests/conftest.py index 7ad2da2195b..f5fd6151a39 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -48,7 +48,7 @@ def pytest_addoption(parser): help="run the skipped tests for the new resolver", ) parser.addoption( - "--lazy-wheel", + "--fast-deps", action="store_true", default=False, help="use lazy wheels in tests (only affect new resolver)", @@ -114,8 +114,8 @@ def use_new_resolver(request): new_resolver = request.config.getoption("--new-resolver") if not new_resolver: os.environ.pop("PIP_USE_FEATURE", None) - elif request.config.getoption("--lazy-wheel"): - os.environ["PIP_USE_FEATURE"] = "2020-resolver lazy-wheel" + elif request.config.getoption("--fast-deps"): + os.environ["PIP_USE_FEATURE"] = "2020-resolver fast-deps" else: os.environ["PIP_USE_FEATURE"] = "2020-resolver" yield new_resolver diff --git a/tools/travis/run.sh b/tools/travis/run.sh index 2ff25924e39..67574e9e891 100755 --- a/tools/travis/run.sh +++ b/tools/travis/run.sh @@ -43,10 +43,10 @@ else RESOLVER_SWITCH='--new-resolver' fi -if [[ -z "$LAZY_WHEEL" ]]; then - LAZY_WHEEL_SWITCH='' +if [[ -z "$FAST_DEPS" ]]; then + FAST_DEPS_SWITCH='' else - LAZY_WHEEL_SWITCH='--lazy-wheel' + FAST_DEPS_SWITCH='--fast-deps' fi # Print the commands run for this test. @@ -56,15 +56,15 @@ if [[ "$GROUP" == "1" ]]; then tox -- --use-venv -m unit -n auto # Integration tests (not the ones for 'pip install') tox -- -m integration -n auto --duration=5 -k "not test_install" \ - --use-venv $RESOLVER_SWITCH $LAZY_WHEEL_SWITCH + --use-venv $RESOLVER_SWITCH $FAST_DEPS_SWITCH elif [[ "$GROUP" == "2" ]]; then # Separate Job for running integration tests for 'pip install' tox -- -m integration -n auto --duration=5 -k "test_install" \ - --use-venv $RESOLVER_SWITCH $LAZY_WHEEL_SWITCH + --use-venv $RESOLVER_SWITCH $FAST_DEPS_SWITCH elif [[ "$GROUP" == "3" ]]; then # Separate Job for tests that fail with the new resolver tox -- -m fails_on_new_resolver -n auto --duration=5 \ - --use-venv $RESOLVER_SWITCH --new-resolver-runtests $LAZY_WHEEL_SWITCH + --use-venv $RESOLVER_SWITCH --new-resolver-runtests $FAST_DEPS_SWITCH else # Non-Testing Jobs should run once tox