From fb8bc0b09b60c169326d2abea3c534fe104255cd Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Wed, 5 Feb 2020 16:57:14 +0100 Subject: [PATCH] [ussuri][goal] Drop python 2.7 support OpenStack is dropping the py2.7 support in ussuri cycle. Complete discussion & schedule can be found in - http://lists.openstack.org/pipermail/openstack-discuss/2019-October/010142.html - https://etherpad.openstack.org/p/drop-python2-support Ussuri Communtiy-wide goal: https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html Cleanup setup.cfg. Update hacking for python3. Remove six usage. Change-Id: I37da6ad3306af138aa16cf73a116f0391d06675f --- requirements.txt | 1 - setup.cfg | 25 ++++--------------------- test-requirements.txt | 2 +- tools/zanata/zanata_stats.py | 4 +--- tools/zanata/zanata_userinfo.py | 7 +------ tox.ini | 4 ++-- 6 files changed, 9 insertions(+), 34 deletions(-) diff --git a/requirements.txt b/requirements.txt index 00454af..9a0459a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,5 +5,4 @@ beautifulsoup4>=4.6.0 # MIT lxml!=3.7.0,>=4.1.1 # BSD oslo.log>=3.37.0 # Apache-2.0 requests>=2.18.4 # Apache-2.0 -six>=1.11.0 # MIT PyYAML>=3.12 # MIT diff --git a/setup.cfg b/setup.cfg index 203f62f..d93cd9b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -5,6 +5,7 @@ description-file = README.rst author = OpenStack author-email = openstack-i18n@lists.openstack.org home-page = https://docs.openstack.org/i18n/latest/ +python-requires = >=3.6 classifier = Environment :: OpenStack Intended Audience :: I18n Contributors @@ -13,30 +14,12 @@ 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.4 + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3 :: Only Topic :: I18n -[global] -setup-hooks = - pbr.hooks.setup_hook - -[files] - -[build_sphinx] -all-files = 1 -warning-is-error = 1 -build-dir = doc/build -source-dir = doc/source - -[wheel] -universal = 1 - -[pbr] -warnerrors = True - [update_catalog] domain = i18n output_dir = i18n/locale diff --git a/test-requirements.txt b/test-requirements.txt index 8e3d5fc..cf3ac11 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -2,7 +2,7 @@ # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -hacking<0.11,>=0.10.2 # Apache-2.0 +hacking<2.1,>=2.0 # Apache-2.0 Babel!=2.4.0,>=2.5.3 # BSD sphinx!=1.6.6,!=1.6.7,>=1.6.5 # BSD diff --git a/tools/zanata/zanata_stats.py b/tools/zanata/zanata_stats.py index 41b6858..c289c21 100755 --- a/tools/zanata/zanata_stats.py +++ b/tools/zanata/zanata_stats.py @@ -27,7 +27,6 @@ import re import sys import requests -import six import yaml ZANATA_URI = 'https://translate.openstack.org/rest/%s' @@ -306,8 +305,7 @@ def write_stats_to_file(users, output_file, file_format, def _write_stats_to_csvfile(users, output_file, detail): - mode = 'w' if six.PY3 else 'wb' - with open(output_file, mode) as csvfile: + with open(output_file, 'w') as csvfile: writer = csv.writer(csvfile) writer.writerow(User.get_flattened_data_title()) for user in users: diff --git a/tools/zanata/zanata_userinfo.py b/tools/zanata/zanata_userinfo.py index dd2167a..9c72631 100755 --- a/tools/zanata/zanata_userinfo.py +++ b/tools/zanata/zanata_userinfo.py @@ -21,7 +21,6 @@ import os import sys from oslo_log import log as logging -import six import yaml from ZanataUtils import IniConfig from ZanataUtils import ZanataRestService @@ -145,17 +144,13 @@ def write_userdata_to_file(users, output_file): def _write_userdata_to_csvfile(userdata, output_file): - mode = 'wb' if six.PY2 else 'w' - with open(output_file, mode) as csvfile: + with open(output_file, 'w') as csvfile: writer = csv.writer(csvfile) writer.writerow(['user_id', 'lang_code', 'lang', 'name', 'email']) for data in userdata: d = [data['user_id'], data['lang_code'], data['lang'], data['name'], data['email']] - if six.PY2: - # In Python2 we need to encode unicode strings into strings. - d = [s.encode('utf-8') for s in d] writer.writerow(d) diff --git a/tox.ini b/tox.ini index d8fb497..4c0c5f4 100644 --- a/tox.ini +++ b/tox.ini @@ -1,12 +1,12 @@ [tox] -minversion = 1.6 +minversion = 3.1.0 envlist = docs,pep8 +ignore_basepython_conflict = True skipsdist = True [testenv] basepython=python3 usedevelop = True -setenv = VIRTUAL_ENV={envdir} deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt