Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid future breakage of setup.py invokations #8711

Merged
merged 7 commits into from
Nov 29, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/builds.rst
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ pip:
Latest version by default.

setuptools:
Latest version by default.
``58.3.0`` or older.
astrojuanlu marked this conversation as resolved.
Show resolved Hide resolved

mock:
``1.0.1`` (could be removed in the future).
Expand Down
4 changes: 2 additions & 2 deletions docs/development/docs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 5 additions & 2 deletions readthedocs/doc_builder/python_environments.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
)
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/rtd_tests/tests/test_celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
4 changes: 2 additions & 2 deletions readthedocs/rtd_tests/tests/test_doc_building.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down