Skip to content

Commit e5e9534

Browse files
committed
run pyupgrade --py38-plus
1 parent 803d36d commit e5e9534

File tree

8 files changed

+39
-51
lines changed

8 files changed

+39
-51
lines changed

Pipfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@ url = "https://pypi.org/simple"
44
verify_ssl = true
55

66
[dev-packages]
7+
black = "*"
8+
flake8 = "*"
9+
mypy = "*"
710
pylint = "*"
811
pytest = "*"
9-
responses = "*"
1012
python-dotenv = "*"
11-
flake8 = "*"
13+
responses = "*"
14+
types-requests = "*"
1215

1316
[packages]
1417
requests = "*"

setup.py

Lines changed: 31 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from setuptools import find_packages, setup
55

6-
with open("README.md", "r") as fh:
6+
with open("README.md") as fh:
77
long_description = fh.read()
88

99
VERSION = "devel"
@@ -12,45 +12,36 @@
1212
VERSION = sys.argv.pop(1)
1313
assert re.match(r"[0-9]+\.[0-9]+\.[0-9]+", VERSION), "Version definition required as first arg"
1414

15-
requirements = ['requests', 'backoff']
15+
requirements = ["requests", "backoff"]
1616

17-
extra_requirements = {
18-
'dev': [
19-
'pytest',
20-
'coverage',
21-
'python-dotenv',
22-
'responses'
17+
extra_requirements = {"dev": ["pytest", "coverage", "python-dotenv", "responses"], "docs": ["sphinx"]}
2318

19+
setup(
20+
name="3scale-api",
21+
version=VERSION,
22+
description="3scale API python client",
23+
author="Peter Stanko",
24+
author_email="stanko@mail.muni.cz",
25+
maintainer="Peter Stanko",
26+
url="https://github.com/3scale-qe/3scale-api-python",
27+
packages=find_packages(exclude=("tests",)),
28+
long_description=long_description,
29+
long_description_content_type="text/markdown",
30+
include_package_data=True,
31+
install_requires=requirements,
32+
extras_require=extra_requirements,
33+
entry_points={},
34+
classifiers=[
35+
"Operating System :: OS Independent",
36+
"License :: OSI Approved :: Apache Software License",
37+
"Intended Audience :: Developers",
38+
"Topic :: Utilities",
39+
"Programming Language :: Python :: 3",
40+
"Programming Language :: Python :: 3.8",
41+
"Programming Language :: Python :: 3.9",
42+
"Programming Language :: Python :: 3.10",
43+
"Programming Language :: Python :: 3.11",
44+
"Programming Language :: Python :: 3.12",
45+
"Programming Language :: Python :: 3.13",
2446
],
25-
'docs': ['sphinx']
26-
}
27-
28-
setup(name='3scale-api',
29-
version=VERSION,
30-
description='3scale API python client',
31-
author='Peter Stanko',
32-
author_email='stanko@mail.muni.cz',
33-
maintainer='Peter Stanko',
34-
url='https://github.com/3scale-qe/3scale-api-python',
35-
packages=find_packages(exclude=("tests",)),
36-
long_description=long_description,
37-
long_description_content_type='text/markdown',
38-
include_package_data=True,
39-
install_requires=requirements,
40-
extras_require=extra_requirements,
41-
entry_points={},
42-
classifiers=[
43-
"Operating System :: OS Independent",
44-
"License :: OSI Approved :: Apache Software License",
45-
'Intended Audience :: Developers',
46-
'Topic :: Utilities',
47-
"Programming Language :: Python :: 3",
48-
'Programming Language :: Python :: 3.7',
49-
'Programming Language :: Python :: 3.8',
50-
'Programming Language :: Python :: 3.9',
51-
'Programming Language :: Python :: 3.10',
52-
'Programming Language :: Python :: 3.11',
53-
'Programming Language :: Python :: 3.12',
54-
'Programming Language :: Python :: 3.13',
55-
],
56-
)
47+
)

tests/integration/auth/test_app_key_authorization.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def proxy(service, proxy):
1919
def test_app_key_authorization(proxy, application, ssl_verify):
2020
creds = application.authobj().credentials
2121
encoded = base64.b64encode(
22-
f"{creds['app_id']}:{creds['app_key']}".encode("utf-8")).decode("utf-8")
22+
f"{creds['app_id']}:{creds['app_key']}".encode()).decode("utf-8")
2323

2424
response = application.test_request(verify=ssl_verify)
2525

tests/integration/test_integration_response_headers.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
def test_x_served_by(api):
32
response = api._rest.get(url=api.admin_api_url + '/accounts')
43
assert response.status_code == 200

tests/integration/test_integration_service_plans.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
31
from tests.integration import asserts
42

53
def test_list_service_plans(service):

tests/integration/test_integration_service_subscriptions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
from tests.integration import asserts
32

43
def test_list_service_subscriptions(account):

threescale_api/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def __init__(self, url: str, token: str,
6969
time.sleep(wait)
7070

7171
@backoff.on_predicate(
72-
backoff.constant, lambda ready: not ready, interval=6, max_tries=90, jitter=None)
72+
backoff.constant, lambda ready: not ready, interval=6, max_tries=90, jitter=None)
7373
def wait_for_tenant(self) -> bool:
7474
"""
7575
When True is returned, there is some chance the tenant is actually ready.

threescale_api/defaults.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,7 @@ def __repr__(self) -> str:
334334

335335
def __eq__(self, other) -> bool:
336336
return (
337-
self.__class__ == other.__class__ and
338-
self.entity_name == other.entity_name and
339-
self.entity_id == other.entity_id
337+
self.__class__ == other.__class__ and self.entity_name == other.entity_name and self.entity_id == other.entity_id
340338
)
341339

342340
def get(self, item):

0 commit comments

Comments
 (0)