From 3e54ba096f172ec8979d5146f287203d995148e0 Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Wed, 30 Oct 2019 15:54:16 +0900 Subject: [PATCH] Complete "Drop Python 2.7 Support" goal The goal definition in the TC repo [1] defines the completion criteria. We have already completed 1, 2, 3 and partially 4 in [1]. This commit completes 4 (requirements.txt etc) and 5 (release note). Python dependency in the installation guide is updated. Django support plan in Ussuri is updated as well. References to python 2.7 in the document are updated as well. [1] https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html Change-Id: I0383920e32e053e1611519be774fab8dec124ccc --- doc/requirements.txt | 3 +-- doc/source/contributor/quickstart.rst | 7 ------- doc/source/contributor/testing.rst | 17 ++++++----------- doc/source/contributor/topics/packaging.rst | 4 ++-- doc/source/install/system-requirements.rst | 16 ++++++---------- .../drop-python27-support-160366ba52a1205b.yaml | 6 ++++++ requirements.txt | 3 +-- test-requirements.txt | 4 ++-- 8 files changed, 24 insertions(+), 36 deletions(-) create mode 100644 releasenotes/notes/drop-python27-support-160366ba52a1205b.yaml diff --git a/doc/requirements.txt b/doc/requirements.txt index 91745ad945..9231ed5cdd 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -7,8 +7,7 @@ # be installed in a specific order. openstackdocstheme>=1.20.0 # Apache-2.0 reno>=2.5.0 # Apache-2.0 -sphinx!=1.6.6,!=1.6.7,>=1.6.2,<2.0.0;python_version=='2.7' # BSD -sphinx!=1.6.6,!=1.6.7,!=2.1.0,>=1.6.2;python_version>='3.4' # BSD +sphinx!=1.6.6,!=1.6.7,!=2.1.0,>=1.6.2 # BSD doc8>=0.6.0 # Apache-2.0 # The below is rewquired to build testing module reference diff --git a/doc/source/contributor/quickstart.rst b/doc/source/contributor/quickstart.rst index 15ea0d32a1..7ea13a83a4 100644 --- a/doc/source/contributor/quickstart.rst +++ b/doc/source/contributor/quickstart.rst @@ -21,13 +21,6 @@ On Ubuntu $ sudo apt-get install git python3-dev python3-pip -To get a full python2.7 development environment, you also need to install -the following packages: - -.. code-block:: console - - python-dev - On RPM-based distributions (e.g., Fedora/RHEL/CentOS) .. code-block:: console diff --git a/doc/source/contributor/testing.rst b/doc/source/contributor/testing.rst index a3200ea00d..3b12642393 100644 --- a/doc/source/contributor/testing.rst +++ b/doc/source/contributor/testing.rst @@ -76,11 +76,11 @@ pep8 Runs pep8, which is a tool that checks Python code style. You can read more about pep8 at https://www.python.org/dev/peps/pep-0008/ -py27 +py37 ---- Runs the Python unit tests against the current default version of Django -with Python 2.7 environment. Check ``requirements.txt`` in horizon +with Python 3.7 environment. Check ``requirements.txt`` in horizon repository to know which version of Django is actually used. All other dependencies are as defined by the upper-constraints file at @@ -89,20 +89,20 @@ https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.t You can run a subset of the tests by passing the test path as an argument to tox:: - $ tox -e py27 -- openstack_dashboard.dashboards.identity.users.tests + $ tox -e py37 -- openstack_dashboard.dashboards.identity.users.tests The following is more example to run a specific test class and a specific test: .. code-block:: console - $ tox -e py27 -- openstack_dashboard.dashboards.identity.users.tests:UsersViewTests - $ tox -e py27 -- openstack_dashboard.dashboards.identity.users.tests:UsersViewTests.test_index + $ tox -e py37 -- openstack_dashboard.dashboards.identity.users.tests:UsersViewTests + $ tox -e py37 -- openstack_dashboard.dashboards.identity.users.tests:UsersViewTests.test_index You can also pass other arguments. For example, to drop into a live debugger when a test fails you can use:: - $ tox -e py27 -- --pdb + $ tox -e py37 -- --pdb py3-dj111, py3-dj21, py3-dj22 ----------------------------- @@ -115,11 +115,6 @@ py36 Runs the Python unit tests with a Python 3.6 environment. -py37 ----- - -Runs the Python unit tests with a Python 3.7 environment. - releasenotes ------------ diff --git a/doc/source/contributor/topics/packaging.rst b/doc/source/contributor/topics/packaging.rst index abf324ceb6..00e22d3ebf 100644 --- a/doc/source/contributor/topics/packaging.rst +++ b/doc/source/contributor/topics/packaging.rst @@ -203,8 +203,8 @@ Packaging Horizon for distributions Horizon is a Python module. Preferably, it is installed at the default location for python. In Fedora and openSUSE, this is -``/usr/lib/python2.7/site-packages/horizon``, and in Debian/Ubuntu it is -``/usr/lib/python2.7/dist-packages/horizon``. +``/usr/lib/python3.7/site-packages/horizon``, and in Debian/Ubuntu it is +``/usr/lib/python3.7/dist-packages/horizon``. Configuration files should reside under ``/etc/openstack-dashboard``. Policy files should be created and modified there as well. diff --git a/doc/source/install/system-requirements.rst b/doc/source/install/system-requirements.rst index ebe91f3a17..418075b404 100644 --- a/doc/source/install/system-requirements.rst +++ b/doc/source/install/system-requirements.rst @@ -2,20 +2,16 @@ System Requirements =================== -The Train release of horizon has the following dependencies. +The Ussuri release of horizon has the following dependencies. -* Python 2.7, 3.6 or 3.7 +* Python 3.6 or 3.7 -* Django 1.11, 2.0 and 2.2 +* Django 2.2 - * Django 2.0 and 2.2 support are experimental in Train release. - - * Note that Ussuri release (the upcoming release after Train release) - will use Django 2.2 as the primary Django version. - Django 2.0 support will be dropped. - - * Django 1.8 to 1.10 are no longer supported since Rocky release. * Django support policy is documented at :doc:`/contributor/policy`. + * Ussuri release uses Django 2.2 (the latest LTS) as the primary Django + version. The prevouos LTS of Django 1.11 will be dropped during + Ussuri cycle. Django 2.0 support will be dropped as well. * An accessible `keystone `_ endpoint diff --git a/releasenotes/notes/drop-python27-support-160366ba52a1205b.yaml b/releasenotes/notes/drop-python27-support-160366ba52a1205b.yaml new file mode 100644 index 0000000000..5f07491dc2 --- /dev/null +++ b/releasenotes/notes/drop-python27-support-160366ba52a1205b.yaml @@ -0,0 +1,6 @@ +--- +upgrade: + - | + Python 2.7 support has been dropped. Last release of horizon + to support python 2.7 is OpenStack Train. The minimum version of Python now + supported by horizon is Python 3.6. diff --git a/requirements.txt b/requirements.txt index cdc8bd7ac8..c9481c8c30 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,8 +11,7 @@ pbr!=2.1.0,>=2.0.0 # Apache-2.0 # Horizon Core Requirements Babel!=2.4.0,>=2.3.4 # BSD debtcollector>=1.2.0 # Apache-2.0 -Django<2,>=1.11;python_version<'3.0' # BSD -Django>=1.11;python_version>='3.0' # BSD +Django>=1.11 # BSD django-babel>=0.6.2 # BSD django-compressor>=2.0 # MIT django-debreach>=1.4.2 # BSD License (2 clause) diff --git a/test-requirements.txt b/test-requirements.txt index 6c3d0f482b..7f0e2b57f3 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -9,7 +9,7 @@ # Hacking should appear first in case something else depends on pep8 hacking>=1.1.0,<2 # Apache-2.0 # -astroid==2.1.0;python_version>='3.0' # LGPLv2.1 +astroid==2.1.0 # LGPLv2.1 bandit!=1.6.0,>=1.4.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 flake8-import-order==0.12 # LGPLv3 @@ -17,7 +17,7 @@ mock>=2.0.0 # BSD mox3>=0.20.0 # Apache-2.0 nodeenv>=0.9.4 # BSD python-memcached>=1.59 # PSF -pylint==2.2.2;python_version>='3.0' # GPLv2 +pylint==2.2.2 # GPLv2 selenium>=2.50.1 # Apache-2.0 testscenarios>=0.4 # Apache-2.0/BSD testtools>=2.2.0 # MIT