Skip to content

Commit b565f52

Browse files
authored
Drop support for Python < 3.8 (#31)
1 parent 0177ed6 commit b565f52

File tree

15 files changed

+57
-45
lines changed

15 files changed

+57
-45
lines changed

.github/workflows/checks.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Checks
2+
on: push
3+
jobs:
4+
flake8:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v3
8+
- uses: actions/setup-python@v4
9+
with:
10+
python-version: '3.8'
11+
- run: pip install -r requirements.txt -r test-requirements.txt
12+
- run: flake8 .
13+
pytest:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
- uses: actions/setup-python@v4
18+
with:
19+
python-version: '3.8'
20+
- run: pip install -r requirements.txt -r test-requirements.txt
21+
- run: pytest tests/

.travis.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

requirements.txt

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
cliff==3.10.1
2-
pbr==5.11.0
3-
requests==2.28.1
4-
six==1.16.0
5-
PyYAML==6.0
6-
python-keystoneclient==4.5.0
7-
importlib-metadata==4.13.0
1+
cliff>=3.1.0
2+
pbr>=5.4.5
3+
requests>=2.22.0
4+
PyYAML>=5.3.1
5+
python-keystoneclient>=4.0.0

selvpcclient/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "2.1"
1+
__version__ = "2.2"

selvpcclient/base.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import abc
22
import logging
33

4-
import six
54
from cliff.command import Command
65
from cliff.lister import Lister
76
from cliff.show import ShowOne
@@ -176,7 +175,7 @@ def __repr__(self):
176175
return "<%s %s>" % (self.__class__.__name__, info)
177176

178177
def _add_details(self, info):
179-
for (k, v) in six.iteritems(info):
178+
for k, v in info.items():
180179
setattr(self, k, v)
181180

182181
def __getattr__(self, k):
@@ -201,8 +200,7 @@ def take_action(self, parsed_args):
201200
pass
202201

203202

204-
@six.add_metaclass(abc.ABCMeta)
205-
class DisplayCommand(CLICommand):
203+
class DisplayCommand(CLICommand, metaclass=abc.ABCMeta):
206204
columns = []
207205
_formatters = {}
208206

selvpcclient/exceptions/http.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import inspect
22
import sys
33

4-
import six
5-
64
from selvpcclient.exceptions import base
75

86

@@ -300,11 +298,13 @@ class HttpVersionNotSupported(HttpServerError):
300298
message = "HTTP Version Not Supported"
301299

302300

303-
# _code_map contains all the classes that have http_status attribute.
304-
_code_map = dict(
305-
(getattr(obj, 'http_status', None), obj)
306-
for name, obj in six.iteritems(vars(sys.modules[__name__]))
307-
if inspect.isclass(obj) and getattr(obj, 'http_status', False))
301+
_code_map = {}
302+
303+
for member in inspect.getmembers(sys.modules[__name__], inspect.isclass):
304+
name, obj = member
305+
306+
if hasattr(obj, 'http_status'):
307+
_code_map[getattr(obj, 'http_status')] = obj
308308

309309

310310
def get_http_exception(status_code, content=None):

selvpcclient/util.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from typing import Dict, Optional, Tuple
88

99
import requests
10-
import six
1110

1211
from selvpcclient.exceptions.base import ClientException
1312

@@ -207,7 +206,7 @@ def try_parse_json(json_):
207206
def make_curl(url, method, data):
208207
string_parts = ['curl -i', ' -X{} "{}"'.format(method, url)]
209208

210-
for (key, value) in six.iteritems(data.get('headers', {})):
209+
for key, value in data.get('headers', {}).items():
211210
if key in SENSITIVE_HEADERS:
212211
v = str()
213212
if value:

setup.cfg

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ classifier =
1515
Development Status :: 5 - Production/Stable
1616
Operating System :: OS Independent
1717
Programming Language :: Python
18-
Programming Language :: Python :: 2.7
19-
Programming Language :: Python :: 3.4
20-
Programming Language :: Python :: 3.5
18+
Programming Language :: Python :: 3.8
2119

2220
[entry_points]
2321
console_scripts =

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from setuptools import find_packages, setup
33

44
setup(
5-
setup_requires=['pbr>=1.8'],
5+
setup_requires=['pbr>=5.4.5'],
66
packages=find_packages(exclude=['tests']),
77
pbr=True
88
)

test-requirements.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pytest==2.9.1
2-
responses==0.5.1
3-
mock==4.0.3
4-
flake8==3.9.2
1+
pytest==7.2.1
2+
responses==0.22.0
3+
mock==5.0.1
4+
flake8==6.0.0

0 commit comments

Comments
 (0)