[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:
parent
c81ea709fb
commit
fb8bc0b09b
|
@ -5,5 +5,4 @@ beautifulsoup4>=4.6.0 # MIT
|
||||||
lxml!=3.7.0,>=4.1.1 # BSD
|
lxml!=3.7.0,>=4.1.1 # BSD
|
||||||
oslo.log>=3.37.0 # Apache-2.0
|
oslo.log>=3.37.0 # Apache-2.0
|
||||||
requests>=2.18.4 # Apache-2.0
|
requests>=2.18.4 # Apache-2.0
|
||||||
six>=1.11.0 # MIT
|
|
||||||
PyYAML>=3.12 # MIT
|
PyYAML>=3.12 # MIT
|
||||||
|
|
25
setup.cfg
25
setup.cfg
|
@ -5,6 +5,7 @@ description-file = README.rst
|
||||||
author = OpenStack
|
author = OpenStack
|
||||||
author-email = openstack-i18n@lists.openstack.org
|
author-email = openstack-i18n@lists.openstack.org
|
||||||
home-page = https://docs.openstack.org/i18n/latest/
|
home-page = https://docs.openstack.org/i18n/latest/
|
||||||
|
python-requires = >=3.6
|
||||||
classifier =
|
classifier =
|
||||||
Environment :: OpenStack
|
Environment :: OpenStack
|
||||||
Intended Audience :: I18n Contributors
|
Intended Audience :: I18n Contributors
|
||||||
|
@ -13,30 +14,12 @@ classifier =
|
||||||
License :: OSI Approved :: Apache Software License
|
License :: OSI Approved :: Apache Software License
|
||||||
Operating System :: POSIX :: Linux
|
Operating System :: POSIX :: Linux
|
||||||
Programming Language :: Python
|
Programming Language :: Python
|
||||||
Programming Language :: Python :: 2
|
|
||||||
Programming Language :: Python :: 2.7
|
|
||||||
Programming Language :: Python :: 3
|
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
|
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]
|
[update_catalog]
|
||||||
domain = i18n
|
domain = i18n
|
||||||
output_dir = i18n/locale
|
output_dir = i18n/locale
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# of appearance. Changing the order has an impact on the overall integration
|
# of appearance. Changing the order has an impact on the overall integration
|
||||||
# process, which may cause wedges in the gate later.
|
# 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
|
Babel!=2.4.0,>=2.5.3 # BSD
|
||||||
sphinx!=1.6.6,!=1.6.7,>=1.6.5 # BSD
|
sphinx!=1.6.6,!=1.6.7,>=1.6.5 # BSD
|
||||||
|
|
|
@ -27,7 +27,6 @@ import re
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
import six
|
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
ZANATA_URI = 'https://translate.openstack.org/rest/%s'
|
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):
|
def _write_stats_to_csvfile(users, output_file, detail):
|
||||||
mode = 'w' if six.PY3 else 'wb'
|
with open(output_file, 'w') as csvfile:
|
||||||
with open(output_file, mode) as csvfile:
|
|
||||||
writer = csv.writer(csvfile)
|
writer = csv.writer(csvfile)
|
||||||
writer.writerow(User.get_flattened_data_title())
|
writer.writerow(User.get_flattened_data_title())
|
||||||
for user in users:
|
for user in users:
|
||||||
|
|
|
@ -21,7 +21,6 @@ import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
import six
|
|
||||||
import yaml
|
import yaml
|
||||||
from ZanataUtils import IniConfig
|
from ZanataUtils import IniConfig
|
||||||
from ZanataUtils import ZanataRestService
|
from ZanataUtils import ZanataRestService
|
||||||
|
@ -145,17 +144,13 @@ def write_userdata_to_file(users, output_file):
|
||||||
|
|
||||||
|
|
||||||
def _write_userdata_to_csvfile(userdata, output_file):
|
def _write_userdata_to_csvfile(userdata, output_file):
|
||||||
mode = 'wb' if six.PY2 else 'w'
|
with open(output_file, 'w') as csvfile:
|
||||||
with open(output_file, mode) as csvfile:
|
|
||||||
writer = csv.writer(csvfile)
|
writer = csv.writer(csvfile)
|
||||||
writer.writerow(['user_id', 'lang_code', 'lang',
|
writer.writerow(['user_id', 'lang_code', 'lang',
|
||||||
'name', 'email'])
|
'name', 'email'])
|
||||||
for data in userdata:
|
for data in userdata:
|
||||||
d = [data['user_id'], data['lang_code'],
|
d = [data['user_id'], data['lang_code'],
|
||||||
data['lang'], data['name'], data['email']]
|
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)
|
writer.writerow(d)
|
||||||
|
|
||||||
|
|
||||||
|
|
4
tox.ini
4
tox.ini
|
@ -1,12 +1,12 @@
|
||||||
[tox]
|
[tox]
|
||||||
minversion = 1.6
|
minversion = 3.1.0
|
||||||
envlist = docs,pep8
|
envlist = docs,pep8
|
||||||
|
ignore_basepython_conflict = True
|
||||||
skipsdist = True
|
skipsdist = True
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
basepython=python3
|
basepython=python3
|
||||||
usedevelop = True
|
usedevelop = True
|
||||||
setenv = VIRTUAL_ENV={envdir}
|
|
||||||
deps = -r{toxinidir}/requirements.txt
|
deps = -r{toxinidir}/requirements.txt
|
||||||
-r{toxinidir}/test-requirements.txt
|
-r{toxinidir}/test-requirements.txt
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue