[ussuri][goal] Drop python2.7 support

As per the official python support timeline
set forth by the OpenStack TC [1][2], OpenStack
Train (in our case, manila 9.x) is the last
release that will support python2.7.

[1] https://governance.openstack.org/tc/resolutions/20180529-python2-deprecation-timeline.html
[2] https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html

Change-Id: I5b4dc1853d7e4f8f736dd2a22eb08bcfdeac3411
This commit is contained in:
Goutham Pacha Ravi 2019-10-24 17:21:34 -07:00
parent de89e12489
commit cb95b6f6f5
11 changed files with 15 additions and 156 deletions

View File

@ -3,8 +3,7 @@
- publish-openstack-docs-pti
- openstack-cover-jobs
- openstack-lower-constraints-jobs
- openstack-python-jobs
- openstack-python3-train-jobs
- openstack-python3-ussuri-jobs
- check-requirements
- release-notes-jobs-python3
- periodic-stable-jobs
@ -32,8 +31,6 @@
- manila-tempest-dsvm-glusterfs-native:
voting: false
- manila-tempest-minimal-dsvm-dummy
# Through the Train release we need to keep some python2 coverage.
- manila-tempest-minimal-dsvm-dummy-py2
- manila-tempest-minimal-dsvm-lvm
- manila-tempest-minimal-lvm-ipv6-only
- manila-grenade:
@ -330,18 +327,6 @@
- openstack/python-manilaclient
- openstack/tempest
- job:
name: manila-tempest-minimal-dsvm-dummy-py2
parent: manila-tempest-base
run: playbooks/legacy/manila-tempest-minimal-dsvm-dummy-py2/run.yaml
post-run: playbooks/legacy/manila-tempest-minimal-dsvm-dummy-py2/post.yaml
required-projects:
- openstack/devstack-gate
- openstack/manila
- openstack/manila-tempest-plugin
- openstack/python-manilaclient
- openstack/tempest
- job:
name: manila-tempest-minimal-dsvm-lvm
parent: manila-tempest-base

View File

@ -4,7 +4,6 @@
openstackdocstheme>=1.20.0 # Apache-2.0
reno>=2.5.0 # Apache-2.0
doc8>=0.6.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
mock>=2.0.0 # BSD
os-api-ref>=1.4.0 # Apache-2.0

View File

@ -70,7 +70,7 @@ of your manila's tox. Prior to running the above command, run:
.. code-block:: console
$ source .tox/py27/bin/activate
$ source .tox/py3/bin/activate
Or directly as a one-liner, with:

View File

@ -134,7 +134,6 @@ Run the unit tests with::
Example::
tox -epy27
tox -epy36
See :doc:`unit_tests` for more details.
@ -146,10 +145,6 @@ Manually installing and using the virtualenv
You can also manually install the virtual environment::
tox -epy27 --notest
or::
tox -epy36 --notest
This will install all of the Python packages listed in the
@ -157,10 +152,6 @@ This will install all of the Python packages listed in the
To activate the Manila virtualenv you can run::
$ source .tox/py27/bin/activate
or::
$ source .tox/py36/bin/activate
To exit your virtualenv, just type::

View File

@ -17,9 +17,9 @@ This will create a virtual environment, load all the packages from
test-requirements.txt and run all unit tests as well as run flake8 and hacking
checks against the code.
You may run individual test targets, for example only py27 tests, by running::
You may run individual test targets, for example only unit tests, by running::
tox -e py27
tox -e py3
Note that you can inspect the tox.ini file to get more details on the available
options and what the test run does by default.
@ -31,17 +31,17 @@ class, or method that contains test code.
To run the tests in the ``manila/tests/scheduler`` directory::
tox -epy27 -- manila.tests.scheduler
tox -epy3 -- manila.tests.scheduler
To run the tests in the `ShareManagerTestCase` class in
``manila/tests/share/test_manager.py``::
tox -epy27 -- manila.tests.share.test_manager.ShareManagerTestCase
tox -epy3 -- manila.tests.share.test_manager.ShareManagerTestCase
To run the `ShareManagerTestCase::test_share_manager_instance` test method in
``manila/tests/share/test_manager.py``::
tox -epy27 -- manila.tests.share.test_manager.ShareManagerTestCase.test_share_manager_instance
tox -epy3 -- manila.tests.share.test_manager.ShareManagerTestCase.test_share_manager_instance
For more information on these options and details about stestr, please see the
`stestr documentation <http://stestr.readthedocs.io/en/latest/MANUAL.html>`_.

View File

@ -44,7 +44,6 @@ so the only package you install is ``tox`` itself::
Run the unit tests by doing::
tox -e py3
tox -e py27
Tests and assertRaises
----------------------

View File

@ -1,15 +0,0 @@
- hosts: primary
tasks:
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node
synchronize:
src: '{{ ansible_user_dir }}/workspace/'
dest: '{{ zuul.executor.log_root }}'
mode: pull
copy_links: true
verify_host: true
rsync_opts:
- --include=/logs/**
- --include=*/
- --exclude=*
- --prune-empty-dirs

View File

@ -1,82 +0,0 @@
- hosts: all
name: Autoconverted job manila-tempest-minimal-dsvm-dummy-py2 from old job gate-manila-tempest-minimal-dsvm-dummy-ubuntu-xenial
tasks:
- name: Ensure legacy workspace directory
file:
path: '{{ ansible_user_dir }}/workspace'
state: directory
- shell:
cmd: |
set -e
set -x
cat > clonemap.yaml << EOF
clonemap:
- name: openstack/devstack-gate
dest: devstack-gate
EOF
/usr/zuul-env/bin/zuul-cloner -m clonemap.yaml --cache-dir /opt/git \
https://opendev.org \
openstack/devstack-gate
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'
- shell:
cmd: |
set -e
set -x
cat << 'EOF' >>"/tmp/dg-local.conf"
[[local|localrc]]
enable_plugin manila https://opendev.org/openstack/manila
enable_plugin manila-tempest-plugin https://opendev.org/openstack/manila-tempest-plugin
EOF
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'
- shell:
cmd: |
set -e
set -x
export PYTHONUNBUFFERED=true
export DEVSTACK_GATE_NEUTRON=1
export DEVSTACK_PROJECT_FROM_GIT="python-manilaclient"
# Basic services needed for minimal job
export OVERRIDE_ENABLED_SERVICES=key,mysql,rabbit,tempest,tls-proxy
# Keep localrc to be able to set some vars in pre_test_hook
export KEEP_LOCALRC=1
export PROJECTS="openstack/manila-tempest-plugin $PROJECTS"
export MANILA_INSTALL_TEMPEST_PLUGIN_SYSTEMWIDE=False
function pre_test_hook {
# 'dhss' - acronym for 'Driver Handles Share Servers',
# defines mode of a share driver. Boolean-like.
# 'driver' - codename of a share driver to configure.
# 'back_end_type' - defines which installation Manila should
# have - either 'singlebackend' or 'multibackend'.
source $BASE/new/manila/contrib/ci/pre_test_hook.sh False dummy multibackend
}
export -f pre_test_hook
function post_test_hook {
# 'back_end_type' - defines which installation Manila is
# configured to - either 'singlebackend' or 'multibackend'.
# 'driver' - codename of a share driver that is configured in
# Manila. It is used for enabling/disabling tests that are not
# supported by share driver that is used.
# 'test_type' - defines which set of test suites should be used,
# can have 'api' and 'scenario' values.
# 'postgres_enabled' - set of test suites depends on DB backend
# in some cases, so it is provided explicitely. Boolean-like.
source $BASE/new/manila/contrib/ci/post_test_hook.sh multibackend dummy api False
}
export -f post_test_hook
cp devstack-gate/devstack-vm-gate-wrap.sh ./safe-devstack-vm-gate-wrap.sh
./safe-devstack-vm-gate-wrap.sh
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'

View File

@ -0,0 +1,6 @@
---
upgrade:
- |
Python 2.7 support has been dropped. Last release of openstack/manila to
support python 2.7 is OpenStack Train (9.x). The minimum version of
Python now supported by openstack/manila is Python 3.6.

View File

@ -13,8 +13,6 @@ classifier =
License :: OSI Approved :: Apache Software License
Operating System :: POSIX :: Linux
Programming Language :: Python
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7

26
tox.ini
View File

@ -1,9 +1,10 @@
[tox]
minversion = 2.0
skipsdist = True
envlist = py3,py27,pep8
envlist = py3,pep8
[testenv]
basepython = python3
setenv = VIRTUAL_ENV={envdir}
usedevelop = True
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
@ -16,7 +17,6 @@ commands =
stestr slowest
[testenv:releasenotes]
basepython = python3
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
-r{toxinidir}/requirements.txt
@ -28,20 +28,10 @@ commands =
whitelist_externals = rm
[testenv:debug]
basepython = python3
commands = oslo_debug_helper {posargs}
[testenv:debug-py27]
basepython = python2.7
commands = oslo_debug_helper {posargs}
[testenv:debug-py3]
basepython = python3
commands = oslo_debug_helper {posargs}
[testenv:pep8]
# Let's gate pep8 under py3 by default because the py3 checks are stricter.
basepython = python3
commands =
flake8 {posargs}
# Run bashate during pep8 runs to ensure violations are caught by
@ -62,21 +52,17 @@ commands =
{toxinidir}/tools/check_logging.sh {toxinidir}/manila
[testenv:genconfig]
basepython = python3
whitelist_externals = bash
commands =
oslo-config-generator --config-file etc/oslo-config-generator/manila.conf
[testenv:genpolicy]
basepython = python3
commands = oslopolicy-sample-generator --config-file=etc/manila/manila-policy-generator.conf
[testenv:venv]
basepython = python3
commands = {posargs}
[testenv:docs]
basepython = python3
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
-r{toxinidir}/requirements.txt
@ -89,7 +75,6 @@ commands =
whitelist_externals = rm
[testenv:pdf-docs]
basepython = python3
deps = {[testenv:docs]deps}
whitelist_externals =
make
@ -104,13 +89,11 @@ commands =
# separately, outside of the requirements files, and develop mode disabled
# explicitly to avoid unnecessarily installing the checked-out repo too (this
# further relies on "tox.skipsdist = True" above).
basepython = python3
deps = bindep
commands = bindep test
usedevelop = False
[testenv:cover]
basepython = python3
setenv =
{[testenv]setenv}
PYTHON=coverage run --source manila --parallel-mode
@ -119,12 +102,10 @@ commands =
[testenv:fast8]
# Let's run fast8 under py3 by default because the py3 checks are stricter.
basepython = python3
commands =
{toxinidir}/tools/fast8.sh
[testenv:pylint]
basepython = python3
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
pylint==2.3.1
@ -132,7 +113,6 @@ whitelist_externals = bash
commands = bash ./tools/coding-checks.sh --pylint {posargs}
[testenv:api-ref]
basepython = python3
# This environment is called from CI scripts to test and publish
# the API Ref to docs.openstack.org.
whitelist_externals = rm
@ -142,7 +122,6 @@ commands =
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
[testenv:dbrevision]
basepython = python3
deps = -r{toxinidir}/requirements.txt
commands = alembic -c manila/db/migrations/alembic.ini revision -m ""{posargs}
@ -163,7 +142,6 @@ import_exceptions =
local-check-factory = manila.hacking.checks.factory
[testenv:lower-constraints]
basepython = python3
deps =
-c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt