Skip to content

Commit

Permalink
Bug 1680802: Install pylint requirements with legacy resolver r=firef…
Browse files Browse the repository at this point in the history
…ox-build-system-reviewers,sheehan,glandium

pylint_requirements.txt fail to install with the new pip resolver due
to a conflict between astroid and lazy-object-proxy.
Rather than bumping those packages and handling the potential fallout,
the package-upgrade has been deferred and we will use the legacy
resolver in the interrim.

Differential Revision: https://phabricator.services.mozilla.com/D99940
  • Loading branch information
Mitchell Hentges committed Jan 4, 2021
1 parent e183f39 commit cdf668d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
6 changes: 5 additions & 1 deletion python/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,11 @@ def run_python_tests(
and test["requirements"] not in installed_requirements
):
self.virtualenv_manager.install_pip_requirements(
test["requirements"], quiet=True
test["requirements"],
quiet=True,
# pylint_requirements.txt must use the legacy resolver until bug 1682959
# is resolved.
legacy_resolver=True,
)
installed_requirements.add(test["requirements"])

Expand Down
10 changes: 9 additions & 1 deletion python/mozbuild/mozbuild/virtualenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,12 @@ def install_pip_package(self, package, vendored=False):
return self._run_pip(args)

def install_pip_requirements(
self, path, require_hashes=True, quiet=False, vendored=False
self,
path,
require_hashes=True,
quiet=False,
vendored=False,
legacy_resolver=False,
):
"""Install a pip requirements.txt file.
Expand Down Expand Up @@ -654,6 +659,9 @@ def install_pip_requirements(
]
)

if legacy_resolver:
args.append("--use-deprecated=legacy-resolver")

return self._run_pip(args)

def _run_pip(self, args):
Expand Down
6 changes: 5 additions & 1 deletion tools/lint/python/pylint.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ def setup(root, **lintargs):
virtualenv_manager = lintargs["virtualenv_manager"]
try:
virtualenv_manager.install_pip_requirements(
PYLINT_REQUIREMENTS_PATH, quiet=True
PYLINT_REQUIREMENTS_PATH,
quiet=True,
# The defined versions of astroid and lazy-object-proxy conflict and fail to
# install with the new 2020 pip resolver (bug 1682959)
legacy_resolver=True,
)
except subprocess.CalledProcessError:
print(PYLINT_INSTALL_ERROR)
Expand Down

0 comments on commit cdf668d

Please sign in to comment.