Skip to content

Commit 6ccdcb0

Browse files
authored
Revert "Build: remove PyPy support" (#10522)
Revert "Build: remove PyPy support (#10514)" This reverts commit a1b606f.
1 parent a1b606f commit 6ccdcb0

File tree

7 files changed

+34
-12
lines changed

7 files changed

+34
-12
lines changed

docs/user/config-file/v1.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ Certain Python versions require a certain build image,
125125
as defined here:
126126

127127
* ``stable``:
128-
``2``, ``2.7``, ``3``, ``3.5``, ``3.6``, ``3.7``
128+
``2``, ``2.7``, ``3``, ``3.5``, ``3.6``, ``3.7``, ``pypy3.5``
129129
* ``latest``:
130-
``2``, ``2.7``, ``3``, ``3.5``, ``3.6``, ``3.7``, ``3.8``
130+
``2``, ``2.7``, ``3``, ``3.5``, ``3.6``, ``3.7``, ``3.8``, ``pypy3.5``
131131

132132
.. code-block:: yaml
133133
@@ -149,7 +149,7 @@ python.version
149149
``````````````
150150

151151
* Default: ``3.7``
152-
* Options: ``2``, ``2.7``, ``3``, ``3.5``, ``3.6``, ``3.7``, ``3.8``
152+
* Options: ``2``, ``2.7``, ``3``, ``3.5``, ``3.6``, ``3.7``, ``3.8``, ``pypy3.5``
153153

154154
This is the version of Python to use when building your documentation.
155155
If you specify only the major version of Python,

docs/user/config-file/v2.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ build.tools.python
310310
``````````````````
311311

312312
Python version to use.
313-
You can use several interpreters and versions, from CPython, Miniconda, and Mamba.
313+
You can use several interpreters and versions, from CPython, PyPy, Miniconda, and Mamba.
314314

315315
.. note::
316316

@@ -328,6 +328,9 @@ You can use several interpreters and versions, from CPython, Miniconda, and Mamb
328328
- ``3.9``
329329
- ``3.10``
330330
- ``3.11``
331+
- ``pypy3.7``
332+
- ``pypy3.8``
333+
- ``pypy3.9``
331334
- ``miniconda3-4.7``
332335
- ``mambaforge-4.10``
333336

@@ -824,9 +827,9 @@ Each image support different Python versions and has different packages installe
824827
as defined here:
825828

826829
* `stable <https://github.com/readthedocs/readthedocs-docker-images/tree/releases/5.x>`_:
827-
``2``, ``2.7``, ``3``, ``3.5``, ``3.6``, ``3.7``
830+
``2``, ``2.7``, ``3``, ``3.5``, ``3.6``, ``3.7``, ``pypy3.5``
828831
* `latest <https://github.com/readthedocs/readthedocs-docker-images/tree/releases/6.x>`_:
829-
``2``, ``2.7``, ``3``, ``3.5``, ``3.6``, ``3.7``, ``3.8``
832+
``2``, ``2.7``, ``3``, ``3.5``, ``3.6``, ``3.7``, ``3.8``, ``pypy3.5``
830833

831834
python.version (legacy)
832835
```````````````````````

readthedocs/config/config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,9 @@ def python_interpreter(self):
306306
return 'python'
307307
return None
308308
version = self.python_full_version
309+
if version.startswith('pypy'):
310+
# Allow to specify ``pypy3.5`` as Python interpreter
311+
return version
309312
return f'python{version}'
310313

311314
@property

readthedocs/config/tests/test_config.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,15 @@ def test_it_supports_other_versions(self):
430430
assert build.python_interpreter == 'python3.7'
431431
assert build.python_full_version == '3.7'
432432

433+
def test_it_supports_string_versions(self):
434+
build = get_build_config(
435+
{'python': {'version': 'pypy3.5'}},
436+
)
437+
build.validate()
438+
assert build.python.version == 'pypy3.5'
439+
assert build.python_interpreter == 'pypy3.5'
440+
assert build.python_full_version == 'pypy3.5'
441+
433442
def test_it_validates_versions_out_of_range(self):
434443
build = get_build_config(
435444
{'python': {'version': 1.0}},
@@ -1301,8 +1310,8 @@ def test_python_check_invalid_types(self, value):
13011310
@pytest.mark.parametrize(
13021311
'image,versions',
13031312
[
1304-
("latest", ["2", "2.7", "3", "3.5", "3.6", "3.7"]),
1305-
("stable", ["2", "2.7", "3", "3.5", "3.6", "3.7"]),
1313+
('latest', ['2', '2.7', '3', '3.5', '3.6', '3.7', 'pypy3.5']),
1314+
('stable', ['2', '2.7', '3', '3.5', '3.6', '3.7']),
13061315
],
13071316
)
13081317
def test_python_version(self, image, versions):

readthedocs/rtd_tests/fixtures/spec/v2/schema.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@
176176
"3.9",
177177
"3.10",
178178
"3.11",
179+
"pypy3.7",
180+
"pypy3.8",
181+
"pypy3.9",
179182
"miniconda3-4.7",
180183
"mambaforge-4.10"
181184
]
@@ -253,6 +256,7 @@
253256
"3.3",
254257
"3.4",
255258
"3.5",
259+
"pypy3.5",
256260
"3.6",
257261
"3.7",
258262
"3.8"

readthedocs/rtd_tests/tests/test_config_integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def test_python_supported_versions_image_latest(self, load_config):
122122
config = load_yaml_config(self.version)
123123
self.assertEqual(
124124
config.get_valid_python_versions(),
125-
["2", "2.7", "3", "3.5", "3.6", "3.7", "3.8"],
125+
['2', '2.7', '3', '3.5', '3.6', '3.7', '3.8', 'pypy3.5'],
126126
)
127127

128128
@mock.patch('readthedocs.doc_builder.config.load_config')

readthedocs/settings/base.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ def TEMPLATES(self):
585585
},
586586
'readthedocs/build:5.0': {
587587
'python': {
588-
'supported_versions': ['2', '2.7', '3', '3.5', '3.6', '3.7'],
588+
'supported_versions': ['2', '2.7', '3', '3.5', '3.6', '3.7', 'pypy3.5'],
589589
'default_version': {
590590
'2': '2.7',
591591
'3': '3.7',
@@ -594,7 +594,7 @@ def TEMPLATES(self):
594594
},
595595
'readthedocs/build:6.0': {
596596
'python': {
597-
'supported_versions': ['2', '2.7', '3', '3.5', '3.6', '3.7', '3.8'],
597+
'supported_versions': ['2', '2.7', '3', '3.5', '3.6', '3.7', '3.8', 'pypy3.5'],
598598
'default_version': {
599599
'2': '2.7',
600600
'3': '3.7',
@@ -603,7 +603,7 @@ def TEMPLATES(self):
603603
},
604604
'readthedocs/build:7.0': {
605605
'python': {
606-
'supported_versions': ['2', '2.7', '3', '3.5', '3.6', '3.7', '3.8', '3.9', '3.10'],
606+
'supported_versions': ['2', '2.7', '3', '3.5', '3.6', '3.7', '3.8', '3.9', '3.10', 'pypy3.5'],
607607
'default_version': {
608608
'2': '2.7',
609609
'3': '3.7',
@@ -648,6 +648,9 @@ def TEMPLATES(self):
648648
'3.9': '3.9.17',
649649
'3.10': '3.10.12',
650650
'3.11': '3.11.4',
651+
'pypy3.7': 'pypy3.7-7.3.9',
652+
'pypy3.8': 'pypy3.8-7.3.11',
653+
'pypy3.9': 'pypy3.9-7.3.12',
651654
'miniconda3-4.7': 'miniconda3-4.7.12',
652655
'mambaforge-4.10': 'mambaforge-4.10.3-10',
653656
},

0 commit comments

Comments
 (0)