Skip to content

Build: unpin Pillow for unsupported Python versions #9473

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

Merged
merged 6 commits into from
Aug 9, 2022
Merged
Show file tree
Hide file tree
Changes from 4 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
24 changes: 17 additions & 7 deletions readthedocs/doc_builder/python_environments.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,23 @@ def install_core_requirements(self):
*cmd, bin_path=self.venv_bin(), cwd=self.checkout_path
)

requirements = [
'mock==1.0.1',
'pillow==5.4.1',
'alabaster>=0.7,<0.8,!=0.7.5',
'commonmark==0.8.1',
'recommonmark==0.5.0',
]
requirements = []
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure where that link points exactly because it doesn't show me a specific line or similar.

However, I've done it in this way to avoid changing all the tests that require a specific order of requirements to check them.

I want to merge and deploy this today, but if you feel strongly about this, we can continue talking and change it later.


# Avoid re-compiling Pillow on newer Python versions
# https://pillow.readthedocs.io/en/stable/installation.html#python-support
if self.config.python.version in ("2.7", "3.4", "3.5", "3.6", "3.7"):
requirements.append("pillow==5.4.1")
else:
requirements.append("pillow")

requirements.extend(
[
"mock==1.0.1",
"alabaster>=0.7,<0.8,!=0.7.5",
"commonmark==0.8.1",
"recommonmark==0.5.0",
]
)

if self.config.doctype == 'mkdocs':
requirements.append(
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/projects/tests/test_build_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,8 +579,8 @@ def test_build_commands_executed(self, load_yaml_config):
"install",
"--upgrade",
"--no-cache-dir",
"pillow",
"mock==1.0.1",
"pillow==5.4.1",
"alabaster>=0.7,<0.8,!=0.7.5",
"commonmark==0.8.1",
"recommonmark==0.5.0",
Expand Down
8 changes: 4 additions & 4 deletions readthedocs/rtd_tests/tests/test_doc_building.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,9 +368,9 @@ def setUp(self):
self.build_env_mock = Mock()

self.base_requirements = [
'mock',
'pillow',
'alabaster',
"pillow",
"mock",
"alabaster",
]
self.base_conda_requirements = [
'mock',
Expand All @@ -395,7 +395,7 @@ def assertArgsStartsWith(self, args, call):
for arg, arg_mock in zip_longest(args, args_mock):
if arg is not mock.ANY:
self.assertIsNotNone(arg_mock)
self.assertTrue(arg_mock.startswith(arg))
self.assertTrue(arg_mock.startswith(arg), arg)

@patch('readthedocs.projects.models.Project.checkout_path')
def test_install_core_requirements_sphinx(self, checkout_path):
Expand Down