From 1e3e46a6d0830995a6a6c00cd94834fe18ff88fc Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Mon, 31 Aug 2020 16:51:56 +0200 Subject: [PATCH 1/8] Upgrade server to Ubuntu 20.04 - upgrade local development Docker image - upgrade Docker image in TravisCI - upgrade orjson to be able to install in newer Ubuntu version --- .travis.yml | 2 +- dockerfiles/Dockerfile | 3 ++- requirements/pip.txt | 4 +--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index bc195f4656c..d62e14d4753 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: python python: - 3.6 -dist: xenial +dist: focal addons: hosts: diff --git a/dockerfiles/Dockerfile b/dockerfiles/Dockerfile index c81113b248d..54c4cf6fa2b 100644 --- a/dockerfiles/Dockerfile +++ b/dockerfiles/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 ARG GITHUB_TOKEN @@ -9,6 +9,7 @@ ENV LC_ALL en_US.UTF-8 RUN apt-get -y update RUN apt-get -y install \ + cargo \ curl \ g++ \ git-core \ diff --git a/requirements/pip.txt b/requirements/pip.txt index adeb6b45871..eeedb9e2090 100644 --- a/requirements/pip.txt +++ b/requirements/pip.txt @@ -50,9 +50,7 @@ elasticsearch==6.8.1 # pyup: <7.0.0 elasticsearch-dsl==6.4.0 # pyup: <7.0 django-elasticsearch-dsl==6.4.2 # pyup: <7.0 selectolax==0.2.7 - -# Ignoring orjson for now because it makes Travis to fail -orjson==2.0.7 # pyup: ignore +orjson==3.3.1 # Utils django-gravatar2==1.4.4 From 2b0e705fed475a5dd9f3ce4b758f8b10b86629d7 Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Mon, 31 Aug 2020 17:08:52 +0200 Subject: [PATCH 2/8] Use Python 3.8 to run tests via tox --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 8227f163ade..acefacff707 100644 --- a/tox.ini +++ b/tox.ini @@ -1,11 +1,11 @@ [tox] minversion=2.9.0 -envlist = py36,lint,docs +envlist = py38,lint,docs skipsdist = True [travis] python = - 3.6: py36, codecov + 3.8: py38, codecov [testenv] description = run test suite for the application with {basepython} From 5ad946e15ecd28ebade3be513bb9dde4d8df95d6 Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Mon, 31 Aug 2020 17:09:04 +0200 Subject: [PATCH 3/8] Upgrade Redis and Celery+Kombu redis has to be upgraded to avoid `async` keyword error --- requirements/pip.txt | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/requirements/pip.txt b/requirements/pip.txt index eeedb9e2090..267912b36a6 100644 --- a/requirements/pip.txt +++ b/requirements/pip.txt @@ -31,15 +31,12 @@ pyyaml==5.3.1 Pygments==2.6.1 # Basic tools -# Redis 3.x has an incompatible change and fails -# https://stackoverflow.com/questions/53331405/django-compress-error-invalid-input-of-type-cachekey -# https://github.com/sebleier/django-redis-cache/pull/162 -redis==2.10.6 # pyup: ignore -# Kombu >4.3 requires redis>=3.2 -kombu==4.3.0 # pyup: ignore -# Celery 4.2 is incompatible with our code -# when ALWAYS_EAGER = True -celery==4.1.1 # pyup: ignore +redis==3.5.3 + +# ModuleNotFoundError: No module named 'kombu.five' +kombu==4.6.11 # pyup: < 5.0 + +celery==4.4.7 django-allauth==0.42.0 From be64d7b80eef1ef2e89b7c14a8eb3a1f7474fb0d Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Mon, 31 Aug 2020 17:16:59 +0200 Subject: [PATCH 4/8] Upgrade mercurial to a versiont that supports Python 3.8 --- requirements/testing.txt | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/requirements/testing.txt b/requirements/testing.txt index 4cf02a46489..03de4128a36 100644 --- a/requirements/testing.txt +++ b/requirements/testing.txt @@ -11,13 +11,7 @@ pytest-cov==2.10.1 apipkg==1.5 execnet==1.7.1 -# Mercurial 4.3 and newer require Python 2.7 -# Mercurial is actively being ported to Python 3. As of Mercurial 4.3, -# some commands work on Python 3. However, Python 3 is not yet a -# supported platform. -# mercurial-scm.org/wiki/SupportedPythonVersions -# (Pinned to 4.4.2 since what we need for testing is still useful) -Mercurial==4.4.2 # pyup: ignore +Mercurial==5.5 yamale==2.2.0 # pyup: <3.0 pytest-mock==3.3.0 From f06546d351b9ce9e5242c9f1eed0d9fa20f9065e Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Mon, 31 Aug 2020 17:42:40 +0200 Subject: [PATCH 5/8] Remove `cargo` since it's not required for the newer version of orjson --- dockerfiles/Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/dockerfiles/Dockerfile b/dockerfiles/Dockerfile index 54c4cf6fa2b..46b87dc1623 100644 --- a/dockerfiles/Dockerfile +++ b/dockerfiles/Dockerfile @@ -9,7 +9,6 @@ ENV LC_ALL en_US.UTF-8 RUN apt-get -y update RUN apt-get -y install \ - cargo \ curl \ g++ \ git-core \ From ea03cb13ecd0c8dee3ed657374bf5330bb76b044 Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Thu, 30 Sep 2021 17:49:40 +0200 Subject: [PATCH 6/8] Use Python3.8 on Circle CI --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ea681b49c8d..14acddc0292 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ version: 2.1 jobs: tests: docker: - - image: 'cimg/python:3.6' + - image: 'cimg/python:3.8' environment: TOX_POSARGS: '' - image: 'docker.elastic.co/elasticsearch/elasticsearch:7.14.0' @@ -19,7 +19,7 @@ jobs: tests-embedapi: docker: - - image: 'cimg/python:3.6' + - image: 'cimg/python:3.8' steps: - checkout - run: git submodule sync @@ -29,7 +29,7 @@ jobs: checks: docker: - - image: 'cimg/python:3.6' + - image: 'cimg/python:3.8' environment: NODE_VERSION: 10.17.0 steps: From 27a58160860918b7f940ab19a48b507feb0a6480 Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Thu, 30 Sep 2021 18:11:43 +0200 Subject: [PATCH 7/8] Py3.8 on tox.ini --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 8cf8c2958df..e11d2976d23 100644 --- a/tox.ini +++ b/tox.ini @@ -15,7 +15,7 @@ passenv = CI TRAVIS TRAVIS_* HOME deps = -r{toxinidir}/requirements/testing.txt changedir = {toxinidir}/readthedocs basepython = - python3.6 + python3.8 commands = /bin/sh -c '\ export DJANGO_SETTINGS_MODULE=readthedocs.settings.test; \ From 312cb56fd6729defc4648ccfb5bb5a35ad4e6207 Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Mon, 4 Oct 2021 13:03:56 +0200 Subject: [PATCH 8/8] Update documentation --- docs/development/docs.rst | 6 +++--- docs/development/install.rst | 2 +- docs/development/tests.rst | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/development/docs.rst b/docs/development/docs.rst index bff32c2cd9a..ff07372ddcf 100644 --- a/docs/development/docs.rst +++ b/docs/development/docs.rst @@ -31,14 +31,14 @@ you may want to verify those changes locally before pushing upstream. $ git clone --recurse-submodules https://github.com/readthedocs/readthedocs.org/ -#. create a virtual environment with Python 3.6 - (preferably the latest release, 3.6.15 at the time of writing), +#. 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: .. code-block:: console $ cd readthedocs.org - $ python3.6 -m venv .venv + $ python3.8 -m venv .venv $ source .venv/bin/activate (.venv) $ python -m pip install -U pip setuptools diff --git a/docs/development/install.rst b/docs/development/install.rst index 31d3cc80ae4..6f2cf5bb63a 100644 --- a/docs/development/install.rst +++ b/docs/development/install.rst @@ -142,7 +142,7 @@ save some work while typing docker compose commands. This section explains these ``inv docker.test`` Runs all the test suites inside the container. - * ``--arguments`` will pass arguments to Tox command (e.g. ``--arguments "-e py36 -- -k test_api"``) + * ``--arguments`` will pass arguments to Tox command (e.g. ``--arguments "-e py38 -- -k test_api"``) ``inv docker.pull`` Downloads and tags all the Docker images required for builders. diff --git a/docs/development/tests.rst b/docs/development/tests.rst index f2dd1f2da0d..89ac36cbd94 100644 --- a/docs/development/tests.rst +++ b/docs/development/tests.rst @@ -46,13 +46,13 @@ To target a specific environment: .. prompt:: bash - tox -e py36 + tox -e py38 The ``tox`` configuration has the following environments configured. You can target a single environment to limit the test suite: -py36 - Run our test suite using Python 3.6 +py38 + Run our test suite using Python 3.8 lint Run code linting using `Prospector`_. This currently runs `pylint`_,