8000 Python 3.11 Compatibility (#2022) · andreikop/botbuilder-python@d475640 · GitHub
[go: up one dir, main page]

Skip to content

Commit d475640

Browse files
authored
Python 3.11 Compatibility (microsoft#2022)
* make updates to run tests with 3.11 * run black * Update botbuilder-python-ci.yml * update azure devtools * remove `azure-devtools` due to it being archived * remove deprecation warning * lint ignore test files * ignore tests folder entirely * Update .pylintrc * Update .pylintrc * Update .pylintrc * only fail on errors * Update botbuilder-python-ci.yml * fixes for lint * test update pylint version * remove python 3.11 matrix (to be added in separate PR)
1 parent 40a4f60 commit d475640

File tree

76 files changed

+38
-122
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+38
-122
lines changed

.pylintrc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ extension-pkg-whitelist=
77

88
# Add files or directories to the blacklist. They should be base names, not
99
# paths.
10-
ignore=CVS,build,botbuilder-schema,samples,django_tests,Generator,operations,operations_async,schema
10+
ignore=CVS,build,botbuilder-schema,samples,django_tests,Generator,operations,operations_async,schema,tests
1111

1212
# Add files or directories matching the regex patterns to the blacklist. The
1313
# regex matches against base names, not paths.
@@ -160,7 +160,8 @@ disable=print-statement,
160160
no-name-in-module,
161161
too-many-branches,
1 1241 62162
too-many-ancestors,
163-
too-many-nested-blocks
163+
too-many-nested-blocks,
164+
attribute-defined-outside-init
164165

165166
# Enable the message, report, category or checker with the given id(s). You can
166167
# either give multiple identifier separated by comma (,) or put this option

libraries/botbuilder-ai/botbuilder/ai/luis/luis_recognizer.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ async def _recognize_internal(
256256
LuisPredictionOptions, LuisRecognizerOptionsV2, LuisRecognizerOptionsV3
257257
] = None,
258258
) -> RecognizerResult:
259-
260259
BotAssert.context_not_none(turn_context)
261260

262261
if turn_context.activity.type != ActivityTypes.message:
@@ -277,7 +276,6 @@ async def _recognize_internal(
277276
text=utterance, intents={"": IntentScore(score=1.0)}, entities={}
278277
)
279278
else:
280-
281279
luis_recognizer = self._build_recognizer(options)
282280
recognizer_result = await luis_recognizer.recognizer_internal(turn_context)
283281

libraries/botbuilder-ai/botbuilder/ai/luis/luis_recognizer_v2.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919

2020
class LuisRecognizerV2(LuisRecognizerInternal):
21-
2221
# The value type for a LUIS trace activity.
2322
luis_trace_type: str = "https://www.luis.ai/schemas/trace"
2423

@@ -43,7 +42,6 @@ def __init__(
4342
self._application = luis_application
4443

4544
async def recognizer_internal(self, turn_context: TurnContext):
46-
4745
utterance: str = (
4846
turn_context.activity.text if turn_context.activity is not None else None
4947
)

libraries/botbuilder-ai/botbuilder/ai/luis/luis_recognizer_v3.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ async def recognizer_internal(self, turn_context: TurnContext):
102102
return recognizer_result
103103

104104
def _build_url(self):
105-
106105
base_uri = (
107106
self._application.endpoint or "https://westus.api.cognitive.microsoft.com"
108107
)
@@ -172,7 +171,6 @@ def _extract_entities_and_metadata(self, luis_result):
172171
return self._map_properties(entities, False)
173172

174173
def _map_properties(self, source, in_instance):
175-
176174
if isinstance(source, (int, float, bool, str)):
177175
return source
178176

libraries/botbuilder-ai/botbuilder/ai/qna/qnamaker.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@ def _validate_options(self, options: QnAMakerOptions):
254254
def _has_matched_answer_in_kb(self, query_results: [QueryResult]) -> bool:
255255
if query_results:
256256
if query_results[0].id != -1:
257-
258257
return True
259258

260259
return False

libraries/botbuilder-applicationinsights/tests/test_telemetry_waterfall.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ async def step2(step) -> DialogTurnResult:
6565

6666
# Initialize TestAdapter
6767
async def exec_test(turn_context: TurnContext) -> None:
68-
6968
dialog_context = await dialogs.create_context(turn_context)
7069
results = await dialog_context.continue_dialog()
7170
if results.status == DialogTurnStatus.Empty:
@@ -119,7 +118,6 @@ async def step2(step) -> DialogTurnResult:
119118

120119
# Initialize TestAdapter
121120
async def exec_test(turn_context: TurnContext) -> None:
122-
123121
dialog_context = await dialogs.create_context(turn_context)
124122
await dialog_context.continue_dialog()
125123
if not turn_context.responded:

libraries/botbuilder-azure/botbuilder/azure/blob_storage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ async def write(self, changes: Dict[str, object]):
143143

144144
await self._initialize()
145145

146-
for (name, item) in changes.items():
146+
for name, item in changes.items():
147147
blob_reference = self.__container_client.get_blob_client(name)
148148

149149
e_tag = None

libraries/botbuilder-azure/botbuilder/azure/cosmosdb_partitioned_storage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ async def write(self, changes: Dict[str, object]):
146146

147147
await self.initialize()
148148

149-
for (key, change) in changes.items():
149+
for key, change in changes.items():
150150
e_tag = None
151151
if isinstance(change, dict):
152152
e_tag = change.get("e_tag", None)

libraries/botbuilder-azure/botbuilder/azure/cosmosdb_storage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ async def write(self, changes: Dict[str, object]):
178178
if not self.__container_exists:
179179
self.__create_db_and_container()
180180
# iterate over the changes
181-
for (key, change) in changes.items():
181+
for key, change in changes.items():
182182
# store the e_tag
183183
e_tag = None
184184
if isinstance(change, dict):

libraries/botbuilder-core/botbuilder/core/bot_framework_adapter.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,6 @@ async def get_user_token(
910910
magic_code: str = None,
911911
oauth_app_credentials: AppCredentials = None, # pylint: disable=unused-argument
912912
) -> TokenResponse:
913-
914913
"""
915914
Attempts to retrieve the token for a user that's in a login flow.
916915

0 commit comments

Comments
 (0)
0