Skip to content

Commit 583bc67

Browse files
authored
Merge pull request #7412 from readthedocs/test-new-resolver
Pip: test new resolver
2 parents bdf7fc2 + c551c1e commit 583bc67

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

readthedocs/doc_builder/python_environments.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ def install_package(self, install):
106106
'--upgrade-strategy',
107107
'eager',
108108
*self._pip_cache_cmd_argument(),
109+
*self._pip_extra_args(),
109110
'{path}{extra_requirements}'.format(
110111
path=local_path,
111112
extra_requirements=extra_req_param,
@@ -123,6 +124,12 @@ def install_package(self, install):
123124
bin_path=self.venv_bin(),
124125
)
125126

127+
def _pip_extra_args(self):
128+
extra_args = []
129+
if self.project.has_feature(Feature.USE_NEW_PIP_RESOLVER):
130+
extra_args.extend(['--use-feature', '2020-resolver'])
131+
return extra_args
132+
126133
def _pip_cache_cmd_argument(self):
127134
"""
128135
Return the pip command ``--cache-dir`` or ``--no-cache-dir`` argument.
@@ -383,6 +390,7 @@ def install_core_requirements(self):
383390
])
384391

385392
cmd = copy.copy(pip_install_cmd)
393+
cmd.extend(self._pip_extra_args())
386394
if self.config.python.use_system_site_packages:
387395
# Other code expects sphinx-build to be installed inside the
388396
# virtualenv. Using the -I option makes sure it gets installed
@@ -431,6 +439,7 @@ def install_requirements_file(self, install):
431439
'-m',
432440
'pip',
433441
'install',
442+
*self._pip_extra_args(),
434443
]
435444
if self.project.has_feature(Feature.PIP_ALWAYS_UPGRADE):
436445
args += ['--upgrade']
@@ -647,6 +656,7 @@ def install_core_requirements(self):
647656
'install',
648657
'-U',
649658
*self._pip_cache_cmd_argument(),
659+
*self._pip_extra_args(),
650660
]
651661
pip_cmd.extend(pip_requirements)
652662
self.build_env.run(

readthedocs/projects/models.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1554,6 +1554,7 @@ def add_features(sender, **kwargs):
15541554
DEFAULT_TO_FUZZY_SEARCH = 'default_to_fuzzy_search'
15551555
INDEX_FROM_HTML_FILES = 'index_from_html_files'
15561556
DONT_CREATE_INDEX = 'dont_create_index'
1557+
USE_NEW_PIP_RESOLVER = 'use_new_pip_resolver'
15571558

15581559
FEATURES = (
15591560
(USE_SPHINX_LATEST, _('Use latest version of Sphinx')),
@@ -1693,6 +1694,10 @@ def add_features(sender, **kwargs):
16931694
DONT_CREATE_INDEX,
16941695
_('Do not create index.md or README.rst if the project does not have one.'),
16951696
),
1697+
(
1698+
USE_NEW_PIP_RESOLVER,
1699+
_('Use new pip resolver'),
1700+
),
16961701
)
16971702

16981703
projects = models.ManyToManyField(

0 commit comments

Comments
 (0)