diff --git a/docs/config-file/v1.rst b/docs/config-file/v1.rst index 391791c63dc..7be9bb4d54c 100644 --- a/docs/config-file/v1.rst +++ b/docs/config-file/v1.rst @@ -112,8 +112,8 @@ The ``build`` block configures specific aspects of the documentation build. build.image ``````````` -* Default: :djangosetting:`DOCKER_IMAGE` -* Options: ``1.0``, ``2.0``, ``latest`` +* Default: :djangosetting:`DOCKER_DEFAULT_VERSION` +* Options: ``stable``, ``latest`` The build image to use for specific builds. This lets users specify a more experimental build image, @@ -122,9 +122,8 @@ 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 +* ``stable``: :buildpyversions:`stable` +* ``latest``: :buildpyversions:`latest` .. code-block:: yaml @@ -147,8 +146,8 @@ used for building documentation. python.version `````````````` -* Default: ``2.7`` -* 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 +157,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/0038_change-default-python-interpreter.py b/readthedocs/projects/migrations/0038_change-default-python-interpreter.py new file mode 100644 index 00000000000..ddf624b6659 --- /dev/null +++ b/readthedocs/projects/migrations/0038_change-default-python-interpreter.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.18 on 2019-02-04 16:49 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('projects', '0037_add_htmlfile'), + ] + + 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'), + ), + ] diff --git a/readthedocs/projects/models.py b/readthedocs/projects/models.py index 4e6c5ca4119..a8e80ed8e04 100644 --- a/readthedocs/projects/models.py +++ b/readthedocs/projects/models.py @@ -303,7 +303,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.', diff --git a/readthedocs/rtd_tests/tests/test_api.py b/readthedocs/rtd_tests/tests/test_api.py index f5dcb1cae06..a5671c0fb82 100644 --- a/readthedocs/rtd_tests/tests/test_api.py +++ b/readthedocs/rtd_tests/tests/test_api.py @@ -1468,7 +1468,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 917c0baade0..a595b891b89 100644 --- a/readthedocs/rtd_tests/tests/test_config_integration.py +++ b/readthedocs/rtd_tests/tests/test_config_integration.py @@ -97,7 +97,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, @@ -112,7 +112,7 @@ def test_python_supported_versions_default_image_1_0(self, load_config): path=mock.ANY, env_config=expected_env_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): @@ -151,8 +151,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.7') @mock.patch('readthedocs.doc_builder.config.load_config') def test_python_set_python_version_on_project(self, load_config):