diff --git a/docs/builds.rst b/docs/builds.rst index 6fb03a27ea0..111a6b41db0 100644 --- a/docs/builds.rst +++ b/docs/builds.rst @@ -147,7 +147,7 @@ pip: Latest version by default. setuptools: - Latest version by default. + ``58.2.0`` or older. mock: ``1.0.1`` (could be removed in the future). diff --git a/docs/development/docs.rst b/docs/development/docs.rst index ff07372ddcf..530d2574bb0 100644 --- a/docs/development/docs.rst +++ b/docs/development/docs.rst @@ -33,14 +33,14 @@ you may want to verify those changes locally before pushing upstream. #. create a virtual environment with Python 3.8 (preferably the latest release, 3.8.12 at the time of writing), - activate it, and upgrade both pip and setuptools: + activate it, and upgrade pip: .. code-block:: console $ cd readthedocs.org $ python3.8 -m venv .venv $ source .venv/bin/activate - (.venv) $ python -m pip install -U pip setuptools + (.venv) $ python -m pip install -U pip #. install documentation requirements diff --git a/readthedocs/doc_builder/python_environments.py b/readthedocs/doc_builder/python_environments.py index 911ccb3e99c..893e0ddf01a 100644 --- a/readthedocs/doc_builder/python_environments.py +++ b/readthedocs/doc_builder/python_environments.py @@ -197,7 +197,10 @@ def install_build_tools(self): 'install', '-U', 'virtualenv', - 'setuptools', + # We cap setuptools to avoid breakage of projects + # relying on setup.py invokations, + # see https://github.com/readthedocs/readthedocs.org/issues/8659 + 'setuptools<58.3.0', ] self.build_env.run( *cmd, @@ -477,7 +480,7 @@ def install_core_requirements(self): positive='pip<20.3', negative='pip', ) - cmd = pip_install_cmd + [pip_version, 'setuptools'] + cmd = pip_install_cmd + [pip_version, 'setuptools<58.3.0'] self.build_env.run( *cmd, bin_path=self.venv_bin(), cwd=self.checkout_path ) diff --git a/readthedocs/rtd_tests/tests/test_celery.py b/readthedocs/rtd_tests/tests/test_celery.py index cb9e5ac1bb7..0d17d8399ba 100644 --- a/readthedocs/rtd_tests/tests/test_celery.py +++ b/readthedocs/rtd_tests/tests/test_celery.py @@ -593,7 +593,7 @@ def test_build_tools(self, load_config, build_run): mock.call('asdf', 'install', 'python', python_version), mock.call('asdf', 'global', 'python', python_version), mock.call('asdf', 'reshim', 'python', record=False), - mock.call('python', '-mpip', 'install', '-U', 'virtualenv', 'setuptools'), + mock.call('python', '-mpip', 'install', '-U', 'virtualenv', 'setuptools<58.3.0'), mock.call('asdf', 'install', 'nodejs', nodejs_version), mock.call('asdf', 'global', 'nodejs', nodejs_version), mock.call('asdf', 'reshim', 'nodejs', record=False), diff --git a/readthedocs/rtd_tests/tests/test_doc_building.py b/readthedocs/rtd_tests/tests/test_doc_building.py index f0b8599ad6c..c76244ab77d 100644 --- a/readthedocs/rtd_tests/tests/test_doc_building.py +++ b/readthedocs/rtd_tests/tests/test_doc_building.py @@ -1234,7 +1234,7 @@ def test_install_core_requirements_sphinx(self, checkout_path): self.assertEqual(self.build_env_mock.run.call_count, 2) calls = self.build_env_mock.run.call_args_list - core_args = self.pip_install_args + ['pip', 'setuptools'] + core_args = self.pip_install_args + ['pip', 'setuptools<58.3.0'] self.assertArgsStartsWith(core_args, calls[0]) requirements = self.base_requirements + requirements_sphinx @@ -1259,7 +1259,7 @@ def test_install_core_requirements_mkdocs(self, checkout_path): self.assertEqual(self.build_env_mock.run.call_count, 2) calls = self.build_env_mock.run.call_args_list - core_args = self.pip_install_args + ['pip', 'setuptools'] + core_args = self.pip_install_args + ['pip', 'setuptools<58.3.0'] self.assertArgsStartsWith(core_args, calls[0]) requirements = self.base_requirements + requirements_mkdocs