Further Cleanup py27 support

This repo is now testing only with Python 3, so let's make
a few cleanups:
- Remove obsolete sections from setup.cfg
- Use newer openstackdocstheme,reno and Sphinx versions
- Remove install_command from tox.ini, the default is fine
- Use TOX_CONSTRAINTS_FILE, UPPER_CONSTRAINTS_FILE is obsolete
- Update hacking to 3.0.1, fix warnings found
- Remove babel.cfg, it's not needed anymore

Change-Id: I60edb7e44e4a8222f564f30157eb31288b85b422
This commit is contained in:
Andreas Jaeger 2020-05-13 14:00:34 +02:00
parent f7c3a86d48
commit d6b4ed4c7b
6 changed files with 18 additions and 31 deletions

View File

@ -1,2 +0,0 @@
[python: **.py]

View File

@ -292,10 +292,11 @@ class Swift(object):
@_log_and_ignore_error
def emit_event(self, env, bytes_received, bytes_sent, outcome='success'):
if ((env.get('HTTP_X_SERVICE_PROJECT_ID') or
env.get('HTTP_X_PROJECT_ID') or
env.get('HTTP_X_TENANT_ID')) in self.ignore_projects or
env.get('swift.source') is not None):
if (
(env.get('HTTP_X_SERVICE_PROJECT_ID')
or env.get('HTTP_X_PROJECT_ID')
or env.get('HTTP_X_TENANT_ID')) in self.ignore_projects
or env.get('swift.source') is not None):
return
path = urlparse.quote(env.get('swift.backend_path', env['PATH_INFO']))
@ -355,8 +356,8 @@ class Swift(object):
initiator = cadf_resource.Resource(
typeURI='service/security/account/user',
id=env.get('HTTP_X_USER_ID'))
initiator.project_id = (env.get('HTTP_X_PROJECT_ID') or
env.get('HTTP_X_TENANT_ID'))
initiator.project_id = (env.get('HTTP_X_PROJECT_ID')
or env.get('HTTP_X_TENANT_ID'))
# build notification body
event = cadf_event.Event(eventTime=now, outcome=outcome,

View File

@ -70,7 +70,7 @@ class TestSwift(tests_base.TestCase):
@staticmethod
def start_response(*args):
pass
pass
def get_request(self, path, environ=None, headers=None):
return FakeRequest(path, environ=environ, headers=headers)

View File

@ -28,17 +28,3 @@ packages =
[entry_points]
paste.filter_factory =
swift = ceilometermiddleware.swift:filter_factory
[compile_catalog]
directory = ceilometermiddleware/locale
domain = ceilometermiddleware
[update_catalog]
domain = ceilometermiddleware
output_dir = ceilometermiddleware/locale
input_file = ceilometermiddleware/locale/ceilometermiddleware.pot
[extract_messages]
keywords = _ gettext ngettext l_ lazy_gettext
mapping_file = babel.cfg
output_file = ceilometermiddleware/locale/ceilometermiddleware.pot

View File

@ -4,9 +4,9 @@
coverage>=3.6 # Apache-2.0
python-subunit>=0.0.18 # Apache-2.0/BSD
sphinx!=1.6.6,!=1.6.7,!=2.1.0 # BSD
openstackdocstheme>=1.17.0 # Apache-2.0
sphinx>=2.0.0,!=2.1.0 # BSD
openstackdocstheme>=2.0.0 # Apache-2.0
oslotest>=1.10.0 # Apache-2.0
stestr>=2.0.0 # Apache-2.0
reno>=0.1.1 # Apache-2.0
reno>=2.5.0 # Apache-2.0
betamax>=0.7.0 # Apache-2.0

12
tox.ini
View File

@ -1,5 +1,5 @@
[tox]
minversion = 1.8
minversion = 3.1.1
envlist = py38,pypy,pep8,releasenotes
skipsdist = True
ignore_basepython_conflict = True
@ -7,16 +7,16 @@ ignore_basepython_conflict = True
[testenv]
basepython = python3
usedevelop = True
install_command = pip install {opts} {packages}
setenv =
VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/requirements.txt
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt}
commands = stestr run --slowest {posargs}
[testenv:pep8]
deps = hacking>=0.12,<0.13
deps = hacking>=3.0.1,<3.1.0
commands = flake8
[testenv:venv]
@ -42,4 +42,6 @@ commands = sphinx-build -a -E -d releasenotes/build/doctrees -b html releasenote
[flake8]
show-source = True
# W503 line break before binary operator
ignore = W503
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build