Merge pull request #86 from mjpieters/pyupgrade · 1Password/connect-sdk-python@bf1c6fa · GitHub
Skip to content

Commit bf1c6fa

Browse files
Merge pull request #86 from mjpieters/pyupgrade
Remove Python 2.7 syntax and undeclared dependency
2 parents 7ee0bb3 + 6c3faa0 commit bf1c6fa

16 files changed

Lines changed: 47 additions & 69 deletions

File tree

‎example/main.py‎

Lines changed: 2 additions & 2 deletions
Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1-
# coding: utf-8
2-
3-
# flake8: noqa
4-
1+
from onepasswordconnectsdk import client
2+
from onepasswordconnectsdk import models
53
from onepasswordconnectsdk.config import load
64
from onepasswordconnectsdk.config import load_dict
75
from onepasswordconnectsdk.client import new_client
86
from onepasswordconnectsdk.client import new_client_from_environment
7+
8+
__all__ = [
9+
"client",
10+
"load",
11+
"load_dict",
12+
"models",
13+
"new_client",
14+
"new_client_from_environment"
15+
]

‎src/onepasswordconnectsdk/config.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from typing import List, Dict
44
from onepasswordconnectsdk.client import Client
55
from onepasswordconnectsdk.models import (
6-
SummaryItem,
76
Item,
87
ParsedField,
98
ParsedItem,

‎src/onepasswordconnectsdk/models/__init__.py‎

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
# coding: utf-8
2-
3-
# flake8: noqa
4-
5-
6-
from __future__ import absolute_import
7-
81
# import models into model package
92
from onepasswordconnectsdk.models.error import Error
103
from onepasswordconnectsdk.models.item import Item
@@ -20,3 +13,20 @@
2013
from onepasswordconnectsdk.models.parsed_field import ParsedField
2114
from onepasswordconnectsdk.models.parsed_item import ParsedItem
2215
from onepasswordconnectsdk.models.vault import Vault
16+
17+
__all__ = [
18+
"Error",
19+
"Field",
20+
"FieldSection",
21+
"File",
22+
"GeneratorRecipe",
23+
"Item",
24+
"ItemDetails",
25+
"ItemUrls",
26+
"ItemVault",
27+
"ParsedField",
28+
"ParsedItem",
29+
"Section",
30+
"SummaryItem",
31+
"Vault",
32+
]

‎src/onepasswordconnectsdk/models/error.py‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# coding: utf-8
2-
31
"""
42
1Password Connect
53
@@ -11,10 +9,9 @@
119

1210

1311
import pprint
14-
import re # noqa: F401
1512

1613

17-
class Error(object):
14+
class Error:
1815
"""NOTE: This class is auto generated by OpenAPI Generator.
1916
Ref: https://openapi-generator.tech
2017

‎src/onepasswordconnectsdk/models/field.py‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# coding: utf-8
2-
31
"""
42
1Password Connect
53
@@ -11,10 +9,9 @@
119

1210

1311
import pprint
14-
import re # noqa: F401
1512

1613

17-
class Field(object):
14+
class Field:
1815
"""NOTE: This class is auto generated by OpenAPI Generator.
1916
Ref: https://openapi-generator.tech
2017
@@ -172,7 +169,7 @@ def purpose(self, purpose):
172169
allowed_values = ["", "USERNAME", "PASSWORD", "NOTES"] # noqa: E501
173170
if purpose not in allowed_values: # noqa: E501
174171
raise ValueError(
175-
"Invalid value for `purpose` ({0}), must be one of {1}" # noqa: E501
172+
"Invalid value for `purpose` ({}), must be one of {}" # noqa: E501
176173
.format(purpose, allowed_values)
177174
)
178175

‎src/onepasswordconnectsdk/models/field_section.py‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# coding: utf-8
2-
31
"""
42
1Password Connect
53
@@ -11,10 +9,9 @@
119

1210

1311
import pprint
14-
import re # noqa: F401
1512

1613

17-
class FieldSection(object):
14+
class FieldSection:
1815
"""NOTE: This class is auto generated by OpenAPI Generator.
1916
Ref: https://openapi-generator.tech
2017

‎src/onepasswordconnectsdk/models/file.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import pprint
2-
import re # noqa: F401
32

43

5-
class File(object):
4+
class File:
65
openapi_types = {
76
'id': 'str',
87
'name': 'str',

‎src/onepasswordconnectsdk/models/generator_recipe.py‎

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# coding: utf-8
2-
31
"""
42
1Password Connect
53
@@ -11,15 +9,10 @@
119
"""
1210

1311

14-
try:
15-
from inspect import getfullargspec
16-
except ImportError:
17-
from inspect import getargspec as getfullargspec
12+
from inspect import getfullargspec
1813
import pprint
19-
import re # noqa: F401
20-
import six
2114

22-
class GeneratorRecipe(object):
15+
class GeneratorRecipe:
2316
"""NOTE: This class is auto generated by OpenAPI Generator.
2417
Ref: https://openapi-generator.tech
2518
@@ -103,7 +96,7 @@ def character_sets(self, character_sets):
10396
allowed_values = ["LETTERS", "DIGITS", "SYMBOLS"] # noqa: E501
10497
if (not set(character_sets).issubset(set(allowed_values))): # noqa: E501
10598
raise ValueError(
106-
"Invalid values for `character_sets` [{0}], must be a subset of [{1}]" # noqa: E501
99+
"Invalid values for `character_sets` [{}], must be a subset of [{}]" # noqa: E501
107100
.format(", ".join(map(str, set(character_sets) - set(allowed_values))), # noqa: E501
108101
", ".join(map(str, allowed_values)))
109102
)
@@ -124,7 +117,7 @@ def convert(x):
124117
else:
125118
return x
126119

127-
for attr, _ in six.iteritems(self.openapi_types):
120+
for attr in self.openapi_types:
128121
value = getattr(self, attr)
129122
attr = self.attribute_map.get(attr, attr) if serialize else attr
130123
if isinstance(value, list):

‎src/onepasswordconnectsdk/models/item.py‎

Lines changed: 1 addition & 4 deletions

0 commit comments

Comments
 (0)