Bug 1776642 - part 2: Stop installing 'carrot' in mach tests and use a more recent package instead r=jcristau

carrot has been unmaintained since 2010[1]. setuptools>=58 cannot install it (same error as previous commit)

[1] https://pypi.org/project/carrot/#history

Differential Revision: https://phabricator.services.mozilla.com/D150969
This commit is contained in:
Johan Lorenzo 2022-07-08 15:58:05 +00:00
parent ba74d141f7
commit 75e695f102

View file

@ -57,13 +57,15 @@ class ActivationContext:
def test_new_package_appears_in_pkg_resources():
try:
# "carrot" was chosen as the package to use because:
# "hyperframe" was chosen as the package to use because:
# * It has to be a package that doesn't exist in-scope at the start (so,
# all vendored modules included in the test virtualenv aren't usage).
# all vendored modules included in the test virtualenv aren't usable).
# * It must be on our internal PyPI mirror.
# Of the options, "carrot" is a small install that fits these requirements.
pkg_resources.get_distribution("carrot")
assert False, "Expected to not find 'carrot' as the initial state of the test"
# Of the options, "hyperframe" is a small install that fits these requirements.
pkg_resources.get_distribution("hyperframe")
assert (
False
), "Expected to not find 'hyperframe' as the initial state of the test"
except pkg_resources.DistributionNotFound:
pass
@ -84,7 +86,7 @@ def test_new_package_appears_in_pkg_resources():
)
venv = PythonVirtualenv(venv_dir)
venv.pip_install(["carrot==0.10.7"])
venv.pip_install(["hyperframe==5.2.0"])
initial_metadata = MozSiteMetadata.from_runtime()
try:
@ -92,7 +94,7 @@ def test_new_package_appears_in_pkg_resources():
with metadata.update_current_site(venv.python_path):
activate_virtualenv(venv)
assert pkg_resources.get_distribution("carrot").version == "0.10.7"
assert pkg_resources.get_distribution("hyperframe").version == "5.2.0"
finally:
MozSiteMetadata.current = initial_metadata