From 2cf1478ed464b1bd8ca2f1b4e6b63321c9cb115d Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Tue, 6 Feb 2018 17:05:54 -0500 Subject: [PATCH 1/9] Set python3 as default environment --- readthedocs/projects/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readthedocs/projects/models.py b/readthedocs/projects/models.py index 0bb641b8a9f..2fac79eccb8 100644 --- a/readthedocs/projects/models.py +++ b/readthedocs/projects/models.py @@ -206,7 +206,7 @@ class Project(models.Model): _('Python Interpreter'), max_length=20, choices=constants.PYTHON_CHOICES, - default='python', + default='python3', help_text=_('The Python interpreter used to create the virtual ' 'environment.')) From 95b63795ac3b274af874fa718e06c1fd3ac36f2f Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Tue, 6 Feb 2018 17:07:00 -0500 Subject: [PATCH 2/9] Update tests --- readthedocs/rtd_tests/tests/test_api.py | 2 +- readthedocs/rtd_tests/tests/test_config_integration.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/readthedocs/rtd_tests/tests/test_api.py b/readthedocs/rtd_tests/tests/test_api.py index 2ecce04df6e..44f03282f65 100644 --- a/readthedocs/rtd_tests/tests/test_api.py +++ b/readthedocs/rtd_tests/tests/test_api.py @@ -939,7 +939,7 @@ def test_get_version_by_id(self): 'language': 'en', 'name': 'Pip', 'programming_language': 'words', - 'python_interpreter': 'python', + 'python_interpreter': 'python3', 'repo': 'https://github.com/pypa/pip', 'repo_type': 'git', 'requirements_file': None, diff --git a/readthedocs/rtd_tests/tests/test_config_integration.py b/readthedocs/rtd_tests/tests/test_config_integration.py index cc49317dad8..1645684dbf3 100644 --- a/readthedocs/rtd_tests/tests/test_config_integration.py +++ b/readthedocs/rtd_tests/tests/test_config_integration.py @@ -112,7 +112,7 @@ def test_python_supported_versions_default_image_1_0(self, load_config): }, ), ]) - self.assertEqual(config.python.version, 2) + self.assertEqual(config.python.version, 3) @mock.patch('readthedocs.doc_builder.config.load_config') def test_python_supported_versions_image_1_0(self, load_config): @@ -145,8 +145,8 @@ def test_python_supported_versions_image_latest(self, load_config): def test_python_default_version(self, load_config): load_config.side_effect = create_load() config = load_yaml_config(self.version) - self.assertEqual(config.python.version, 2) - self.assertEqual(config.python_interpreter, 'python2.7') + self.assertEqual(config.python.version, 3) + self.assertEqual(config.python_interpreter, 'python3.5') @mock.patch('readthedocs.doc_builder.config.load_config') def test_python_set_python_version_on_project(self, load_config): From 385c83e9a74c98f52b91a8a73ab38079c7c68fbb Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Tue, 6 Feb 2018 17:24:42 -0500 Subject: [PATCH 3/9] Update docs --- docs/yaml-config.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/yaml-config.rst b/docs/yaml-config.rst index 721c85bb9c1..9feca7bc2f5 100644 --- a/docs/yaml-config.rst +++ b/docs/yaml-config.rst @@ -135,7 +135,7 @@ used for building documentation. python.version `````````````` -* Default: ``2.7`` +* Default: ``3.5`` * Options: ``2.7``, ``2``, ``3.5``, ``3`` This is the version of Python to use when building your documentation. From 4f4fd678cef4746aa91c9166dfe96afb29270776 Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Wed, 22 Aug 2018 13:39:39 -0500 Subject: [PATCH 4/9] Update test --- readthedocs/rtd_tests/tests/test_config_integration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readthedocs/rtd_tests/tests/test_config_integration.py b/readthedocs/rtd_tests/tests/test_config_integration.py index 1645684dbf3..0455844b2c5 100644 --- a/readthedocs/rtd_tests/tests/test_config_integration.py +++ b/readthedocs/rtd_tests/tests/test_config_integration.py @@ -104,7 +104,7 @@ def test_python_supported_versions_default_image_1_0(self, load_config): ], 'use_system_packages': self.project.use_system_packages, 'requirements_file': self.project.requirements_file, - 'python_version': 2, + 'python_version': 3, 'sphinx_configuration': mock.ANY, 'build_image': 'readthedocs/build:1.0', 'doctype': self.project.documentation_type, From 5c8852a8ca91dc2d716568ac961947fcafb7fb22 Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Mon, 17 Dec 2018 18:22:40 -0500 Subject: [PATCH 5/9] Add migration --- .../0036_change-default-python-interpreter.py | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 readthedocs/projects/migrations/0036_change-default-python-interpreter.py diff --git a/readthedocs/projects/migrations/0036_change-default-python-interpreter.py b/readthedocs/projects/migrations/0036_change-default-python-interpreter.py new file mode 100644 index 00000000000..6ef35e8f005 --- /dev/null +++ b/readthedocs/projects/migrations/0036_change-default-python-interpreter.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.16 on 2018-12-17 23:19 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('projects', '0035_container_time_limit_as_integer'), + ] + + operations = [ + migrations.AlterField( + model_name='project', + name='python_interpreter', + field=models.CharField(choices=[('python', 'CPython 2.x'), ('python3', 'CPython 3.x')], default='python3', help_text='The Python interpreter used to create the virtual environment.', max_length=20, verbose_name='Python Interpreter'), + ), + ] From 08f118be94d9b49ba99e5a2fbe9ad7c176c4b3ed Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Tue, 22 Jan 2019 18:51:01 -0500 Subject: [PATCH 6/9] Fix migration --- ...terpreter.py => 0037_change-default-python-interpreter.py} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename readthedocs/projects/migrations/{0036_change-default-python-interpreter.py => 0037_change-default-python-interpreter.py} (83%) diff --git a/readthedocs/projects/migrations/0036_change-default-python-interpreter.py b/readthedocs/projects/migrations/0037_change-default-python-interpreter.py similarity index 83% rename from readthedocs/projects/migrations/0036_change-default-python-interpreter.py rename to readthedocs/projects/migrations/0037_change-default-python-interpreter.py index 6ef35e8f005..6a4770371c3 100644 --- a/readthedocs/projects/migrations/0036_change-default-python-interpreter.py +++ b/readthedocs/projects/migrations/0037_change-default-python-interpreter.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Generated by Django 1.11.16 on 2018-12-17 23:19 +# Generated by Django 1.11.18 on 2019-01-22 23:50 from __future__ import unicode_literals from django.db import migrations, models @@ -8,7 +8,7 @@ class Migration(migrations.Migration): dependencies = [ - ('projects', '0035_container_time_limit_as_integer'), + ('projects', '0036_remove-auto-doctype'), ] operations = [ From b202b1e14a7a6e49b64ca7011afe8546e8fbd4e2 Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Mon, 4 Feb 2019 11:50:11 -0500 Subject: [PATCH 7/9] Update versions --- docs/config-file/v1.rst | 14 +++++++------- ...y => 0038_change-default-python-interpreter.py} | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) rename readthedocs/projects/migrations/{0037_change-default-python-interpreter.py => 0038_change-default-python-interpreter.py} (84%) diff --git a/docs/config-file/v1.rst b/docs/config-file/v1.rst index a933d57049c..4418ff32d46 100644 --- a/docs/config-file/v1.rst +++ b/docs/config-file/v1.rst @@ -112,7 +112,7 @@ The ``build`` block configures specific aspects of the documentation build. build.image ``````````` -* Default: :djangosetting:`DOCKER_IMAGE` +* Default: :djangosetting:`DOCKER_DEFAULT_VERSION` * Options: ``1.0``, ``2.0``, ``latest`` The build image to use for specific builds. @@ -122,9 +122,9 @@ if they want to be on the cutting edge. Certain Python versions require a certain build image, as defined here: -* ``1.0``: 2, 2.7, 3, 3.4 -* ``2.0``: 2, 2.7, 3, 3.5 -* ``latest``: 2, 2.7, 3, 3.3, 3.4, 3.5, 3.6 +* ``1.0``: :buildpyversions:`1.0` +* ``2.0``: :buildpyversions:`2.0` +* ``latest``: :buildpyversions:`latest` .. code-block:: yaml @@ -147,8 +147,8 @@ used for building documentation. python.version `````````````` -* Default: ``3.5`` -* Options: ``2.7``, ``2``, ``3.5``, ``3`` +* Default: ``3.7`` +* Options: :buildpyversions:`latest` This is the version of Python to use when building your documentation. If you specify only the major version of Python, @@ -158,7 +158,7 @@ the highest supported minor version will be selected. The supported Python versions depends on the version of the build image your project is using. The default build image that is used to build - documentation contains support for Python ``2.7`` and ``3.5``. See the + documentation contains support for Python ``2.7`` and ``3.7``. See the :ref:`yaml__build__image` for more information on supported Python versions. .. code-block:: yaml diff --git a/readthedocs/projects/migrations/0037_change-default-python-interpreter.py b/readthedocs/projects/migrations/0038_change-default-python-interpreter.py similarity index 84% rename from readthedocs/projects/migrations/0037_change-default-python-interpreter.py rename to readthedocs/projects/migrations/0038_change-default-python-interpreter.py index 6a4770371c3..ddf624b6659 100644 --- a/readthedocs/projects/migrations/0037_change-default-python-interpreter.py +++ b/readthedocs/projects/migrations/0038_change-default-python-interpreter.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Generated by Django 1.11.18 on 2019-01-22 23:50 +# Generated by Django 1.11.18 on 2019-02-04 16:49 from __future__ import unicode_literals from django.db import migrations, models @@ -8,7 +8,7 @@ class Migration(migrations.Migration): dependencies = [ - ('projects', '0036_remove-auto-doctype'), + ('projects', '0037_add_htmlfile'), ] operations = [ From 54068960429af67706f78503163a5b0a0ab1cc3d Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Mon, 4 Feb 2019 12:15:04 -0500 Subject: [PATCH 8/9] Fix test --- readthedocs/rtd_tests/tests/test_config_integration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readthedocs/rtd_tests/tests/test_config_integration.py b/readthedocs/rtd_tests/tests/test_config_integration.py index f52c876e385..a595b891b89 100644 --- a/readthedocs/rtd_tests/tests/test_config_integration.py +++ b/readthedocs/rtd_tests/tests/test_config_integration.py @@ -152,7 +152,7 @@ def test_python_default_version(self, load_config): load_config.side_effect = create_load() config = load_yaml_config(self.version) self.assertEqual(config.python.version, 3) - self.assertEqual(config.python_interpreter, 'python3.5') + self.assertEqual(config.python_interpreter, 'python3.7') @mock.patch('readthedocs.doc_builder.config.load_config') def test_python_set_python_version_on_project(self, load_config): From d4441c652eb779d18f96fd42cf07844ed2687937 Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Wed, 6 Feb 2019 10:48:43 -0500 Subject: [PATCH 9/9] Only list stable and latest for config v1 --- docs/config-file/v1.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/config-file/v1.rst b/docs/config-file/v1.rst index 4418ff32d46..7be9bb4d54c 100644 --- a/docs/config-file/v1.rst +++ b/docs/config-file/v1.rst @@ -113,7 +113,7 @@ build.image ``````````` * Default: :djangosetting:`DOCKER_DEFAULT_VERSION` -* Options: ``1.0``, ``2.0``, ``latest`` +* Options: ``stable``, ``latest`` The build image to use for specific builds. This lets users specify a more experimental build image, @@ -122,8 +122,7 @@ if they want to be on the cutting edge. Certain Python versions require a certain build image, as defined here: -* ``1.0``: :buildpyversions:`1.0` -* ``2.0``: :buildpyversions:`2.0` +* ``stable``: :buildpyversions:`stable` * ``latest``: :buildpyversions:`latest` .. code-block:: yaml