[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
This commit is contained in:
Andreas Jaeger 2020-02-05 16:57:14 +01:00 committed by Akihiro Motoki
parent c81ea709fb
commit fb8bc0b09b
6 changed files with 9 additions and 34 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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:

View File

@ -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)

View File

@ -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