Drop Python 2 support
This has bit-rotted as libraries have updated to Python 3 only. Switch to hacking; some minor changes to regex-strings is all that is required. Drop py27 markers and move to Python 3 only. Update requirements. Depends-On: https://review.opendev.org/737666 Change-Id: Iabf201965129b3284166e1aedcb9f1c9d6109077
This commit is contained in:
parent
ad1e1e3537
commit
878b20898d
@ -15,12 +15,12 @@ classifier =
|
|||||||
License :: OSI Approved :: Apache Software License
|
License :: OSI Approved :: Apache Software License
|
||||||
Operating System :: OS Independent
|
Operating System :: OS Independent
|
||||||
Programming Language :: Python
|
Programming Language :: Python
|
||||||
Programming Language :: Python :: 2
|
|
||||||
Programming Language :: Python :: 2.7
|
|
||||||
Programming Language :: Python :: 2.6
|
|
||||||
Programming Language :: Python :: 3
|
Programming Language :: Python :: 3
|
||||||
Programming Language :: Python :: 3.3
|
Programming Language :: Python :: 3.3
|
||||||
Programming Language :: Python :: 3.5
|
Programming Language :: Python :: 3.5
|
||||||
|
Programming Language :: Python :: 3.6
|
||||||
|
Programming Language :: Python :: 3.7
|
||||||
|
Programming Language :: Python :: 3.8
|
||||||
Topic :: Utilities
|
Topic :: Utilities
|
||||||
|
|
||||||
[files]
|
[files]
|
||||||
|
8
setup.py
8
setup.py
@ -16,14 +16,6 @@
|
|||||||
|
|
||||||
import setuptools
|
import setuptools
|
||||||
|
|
||||||
# In python < 2.7.4, a lazy loading of package `pbr` will break
|
|
||||||
# setuptools if some other modules registered functions in `atexit`.
|
|
||||||
# solution from: http://bugs.python.org/issue15881#msg170215
|
|
||||||
try:
|
|
||||||
import multiprocessing # noqa
|
|
||||||
except ImportError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
setup_requires=['pbr>=1.3'],
|
setup_requires=['pbr>=1.3'],
|
||||||
pbr=True)
|
pbr=True)
|
||||||
|
@ -2,12 +2,12 @@
|
|||||||
# 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.0
|
flake8
|
||||||
|
|
||||||
coverage>=3.6
|
coverage>=3.6
|
||||||
python-subunit>=0.0.18
|
python-subunit>=0.0.18
|
||||||
requests-mock>=0.6.0
|
requests-mock>=0.6.0
|
||||||
sphinx>=1.6.2
|
sphinx!=1.6.6,!=1.6.7,!=2.1.0,>=1.6.2 # BSD
|
||||||
mock>=1.2
|
mock>=1.2
|
||||||
openstackdocstheme>=1.11.0 # Apache-2.0
|
openstackdocstheme>=1.11.0 # Apache-2.0
|
||||||
oslotest>=1.2.0 # Apache-2.0
|
oslotest>=1.2.0 # Apache-2.0
|
||||||
|
@ -23,9 +23,9 @@ class TestCaseDelete(TestCase):
|
|||||||
|
|
||||||
def test_delete_without_path(self):
|
def test_delete_without_path(self):
|
||||||
required = [
|
required = [
|
||||||
'.*?^usage: grafana-dashboards delete \[-h\] path',
|
r'.*?^usage: grafana-dashboards delete \[-h\] path',
|
||||||
'.*?^grafana-dashboards delete: error: (too few arguments|the '
|
r'.*?^grafana-dashboards delete: error: (too few arguments|the '
|
||||||
'following arguments are required: path)',
|
r'following arguments are required: path)',
|
||||||
]
|
]
|
||||||
stdout, stderr = self.shell('delete', exitcodes=[2])
|
stdout, stderr = self.shell('delete', exitcodes=[2])
|
||||||
for r in required:
|
for r in required:
|
||||||
|
@ -23,9 +23,9 @@ class TestCaseUpdate(TestCase):
|
|||||||
|
|
||||||
def test_update_without_path(self):
|
def test_update_without_path(self):
|
||||||
required = [
|
required = [
|
||||||
'.*?^usage: grafana-dashboards update \[-h\] path',
|
r'.*?^usage: grafana-dashboards update \[-h\] path',
|
||||||
'.*?^grafana-dashboards update: error: (too few arguments|the '
|
r'.*?^grafana-dashboards update: error: (too few arguments|the '
|
||||||
'following arguments are required: path)',
|
r'following arguments are required: path)',
|
||||||
]
|
]
|
||||||
stdout, stderr = self.shell('update', exitcodes=[2])
|
stdout, stderr = self.shell('update', exitcodes=[2])
|
||||||
for r in required:
|
for r in required:
|
||||||
|
@ -102,7 +102,7 @@ class TestCaseValidate(TestCase):
|
|||||||
|
|
||||||
def _validate_invalid_file_or_directory(self, path):
|
def _validate_invalid_file_or_directory(self, path):
|
||||||
required = [
|
required = [
|
||||||
'%s: ERROR: \[Errno 2\] No such file or directory:' % path,
|
r'%s: ERROR: \[Errno 2\] No such file or directory:' % path,
|
||||||
]
|
]
|
||||||
stdout, stderr = self.shell(
|
stdout, stderr = self.shell(
|
||||||
'validate %s' % path, exitcodes=[1])
|
'validate %s' % path, exitcodes=[1])
|
||||||
@ -113,9 +113,9 @@ class TestCaseValidate(TestCase):
|
|||||||
|
|
||||||
def test_validate_without_path(self):
|
def test_validate_without_path(self):
|
||||||
required = [
|
required = [
|
||||||
'.*?^usage: grafana-dashboards validate \[-h\] path',
|
r'.*?^usage: grafana-dashboards validate \[-h\] path',
|
||||||
'.*?^grafana-dashboards validate: error: (too few arguments|the '
|
r'.*?^grafana-dashboards validate: error: (too few arguments|the '
|
||||||
'following arguments are required: path)',
|
r'following arguments are required: path)',
|
||||||
]
|
]
|
||||||
stdout, stderr = self.shell('validate', exitcodes=[2])
|
stdout, stderr = self.shell('validate', exitcodes=[2])
|
||||||
for r in required:
|
for r in required:
|
||||||
|
@ -23,4 +23,4 @@ class TestCaseVersion(TestCase):
|
|||||||
stdout, stderr = self.shell('--version')
|
stdout, stderr = self.shell('--version')
|
||||||
self.assertThat(
|
self.assertThat(
|
||||||
(stdout + stderr),
|
(stdout + stderr),
|
||||||
matchers.MatchesRegex('.*?^(\d+)\.(\d+)\.(\d+)'))
|
matchers.MatchesRegex(r'.*?^(\d+)\.(\d+)\.(\d+)'))
|
||||||
|
11
tox.ini
11
tox.ini
@ -1,7 +1,8 @@
|
|||||||
[tox]
|
[tox]
|
||||||
minversion = 1.6
|
minversion = 3.1.1
|
||||||
envlist = docs,pep8,py27,py35
|
envlist = docs,pep8,py35,py36,py37,py38
|
||||||
skipsdist = True
|
skipsdist = True
|
||||||
|
ignore_basepython_conflict = True
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
usedevelop = True
|
usedevelop = True
|
||||||
@ -13,22 +14,18 @@ deps = -r{toxinidir}/requirements.txt
|
|||||||
commands = python setup.py test --slowest --testr-args='{posargs}'
|
commands = python setup.py test --slowest --testr-args='{posargs}'
|
||||||
|
|
||||||
[testenv:pep8]
|
[testenv:pep8]
|
||||||
basepython = python3
|
|
||||||
commands = flake8
|
commands = flake8
|
||||||
|
|
||||||
[testenv:venv]
|
[testenv:venv]
|
||||||
basepython = python3
|
|
||||||
commands = {posargs}
|
commands = {posargs}
|
||||||
|
|
||||||
[testenv:cover]
|
[testenv:cover]
|
||||||
basepython = python3
|
|
||||||
commands =
|
commands =
|
||||||
coverage erase
|
coverage erase
|
||||||
python setup.py test --coverage --coverage-package-name=grafana_dashboards --testr-args='{posargs}'
|
python setup.py test --coverage --coverage-package-name=grafana_dashboards --testr-args='{posargs}'
|
||||||
coverage report
|
coverage report
|
||||||
|
|
||||||
[testenv:docs]
|
[testenv:docs]
|
||||||
basepython = python3
|
|
||||||
commands = python setup.py build_sphinx
|
commands = python setup.py build_sphinx
|
||||||
|
|
||||||
[flake8]
|
[flake8]
|
||||||
@ -36,6 +33,6 @@ commands = python setup.py build_sphinx
|
|||||||
# H202 skip until we actually write our own exceptions
|
# H202 skip until we actually write our own exceptions
|
||||||
|
|
||||||
show-source = True
|
show-source = True
|
||||||
ignore = E123,E125,H202
|
ignore = E123,E125,H202,W503
|
||||||
builtins = _
|
builtins = _
|
||||||
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build
|
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build
|
||||||
|
Loading…
x
Reference in New Issue
Block a user