Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Pinned CI Packages #11586

Merged
merged 23 commits into from
Jul 14, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
853149a
update deps appropriately
scbedd May 21, 2020
ca1d3d7
fix custom checkers - rename msg_id -> msgid
kristapratico May 26, 2020
1e57ff8
pylint updates for text analytics and form recognizer
kristapratico May 26, 2020
29dc610
pylint updates for azure-identity and azure-keyvault-keys
chlowell May 26, 2020
2e8b865
disable import-outside-toplevel
chlowell May 26, 2020
2870fd0
Pylint for azure-core
lmazuel May 27, 2020
ef19556
Mypy + pylint are friends
lmazuel May 27, 2020
ed68752
Fix errors for pylint 2.5.2
May 27, 2020
7a28a35
Merge branch 'may-dep-update' of github.com:Azure/azure-sdk-for-pytho…
May 27, 2020
b66fd1b
Merge branch 'master' into may-dep-update
scbedd May 28, 2020
aee0753
resolve conflicts
scbedd Jul 8, 2020
f4e52e6
disable azure-identity warnings
chlowell Jul 8, 2020
ad5ccf4
repin doc-warden while I investigate new error
scbedd Jul 8, 2020
0488d76
Merge branch 'may-dep-update' of https://github.com/Azure/azure-sdk-f…
scbedd Jul 8, 2020
a51a22b
Merge branch 'master' into may-dep-update
scbedd Jul 10, 2020
53bb229
Refactor ReceivedMessageBase off such that the AIO version of Receive…
KieranBrantnerMagee Jul 10, 2020
795bd20
Merge branch 'may-dep-update' of https://github.com/Azure/azure-sdk-f…
KieranBrantnerMagee Jul 13, 2020
5d744cd
Temporarily disable pylint checks for AsyncServiceBusSharedKeyCredent…
KieranBrantnerMagee Jul 14, 2020
ccdfacb
Fix deferred settlement tests by reverting the mgmt link settlement a…
KieranBrantnerMagee Jul 14, 2020
03466a7
[Storage][Pylint]Fix Pylint
xiafu-msft Jul 14, 2020
e4f9736
resolve conflicts
scbedd Jul 14, 2020
55ecbe1
Merge branch 'may-dep-update' of https://github.com/Azure/azure-sdk-f…
scbedd Jul 14, 2020
f8b7a2b
Merge branch 'master' into may-dep-update
scbedd Jul 14, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -384,11 +384,13 @@ def __iter__(self):
def seekable():
return True

def next(self):
def __next__(self):
next_chunk = next(self._iterator)
self._download_offset += len(next_chunk)
return next_chunk

next = __next__ # Python 2 compatibility.

def tell(self):
return self._point

Expand All @@ -406,7 +408,7 @@ def read(self, size):
try:
# keep downloading file content until the buffer has enough bytes to read
while self._point + size > self._download_offset:
next_data_chunk = self.next()
next_data_chunk = self.__next__()
self._buf += next_data_chunk
except StopIteration:
pass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,13 @@ def __iter__(self):
def seekable():
return True

def next(self):
def __next__(self):
next_part = next(self.iterator)
self._download_offset += len(next_part)
return next_part

next = __next__ # Python 2 compatibility.

def tell(self):
return self._point

Expand All @@ -170,7 +172,7 @@ def read(self, size):
try:
# keep reading from the generator until the buffer of this stream has enough data to read
while self._point + size > self._download_offset:
self._buf += self.next()
self._buf += self.__next__()
except StopIteration:
self.file_length = self._download_offset

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,27 +64,30 @@ def __init__(self, account_name, account_key):
self.account_key = account_key
super(SharedKeyCredentialPolicy, self).__init__()

def _get_headers(self, request, headers_to_sign):
@staticmethod
def _get_headers(request, headers_to_sign):
headers = dict((name.lower(), value) for name, value in request.http_request.headers.items() if value)
if 'content-length' in headers and headers['content-length'] == '0':
del headers['content-length']
return '\n'.join(headers.get(x, '') for x in headers_to_sign) + '\n'

def _get_verb(self, request):
@staticmethod
def _get_verb(request):
return request.http_request.method + '\n'

def _get_canonicalized_resource(self, request):
uri_path = urlparse(request.http_request.url).path
try:
if isinstance(request.context.transport, AioHttpTransport) or \
isinstance(getattr(request.context.transport, "_transport", None), AioHttpTransport):
isinstance(getattr(request.context.transport, "_transport", None), AioHttpTransport):
uri_path = URL(uri_path)
return '/' + self.account_name + str(uri_path)
except TypeError:
pass
return '/' + self.account_name + uri_path

def _get_canonicalized_headers(self, request):
@staticmethod
def _get_canonicalized_headers(request):
string_to_sign = ''
x_ms_headers = []
for name, value in request.http_request.headers.items():
Expand All @@ -96,8 +99,9 @@ def _get_canonicalized_headers(self, request):
string_to_sign += ''.join([name, ':', value, '\n'])
return string_to_sign

def _get_canonicalized_resource_query(self, request):
sorted_queries = [(name, value) for name, value in request.http_request.query.items()]
@staticmethod
def _get_canonicalized_resource_query(request):
sorted_queries = list(request.http_request.query.items())
sorted_queries.sort()

string_to_sign = ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ class NamedSchema(Schema):
def __init__(
self,
data_type,
name,
name=None,
namespace=None,
names=None,
other_props=None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
# pylint: disable=invalid-overridden-method

import asyncio
import random
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -520,9 +520,11 @@ def __iter__(self):
def seekable(self):
return False

def next(self):
def __next__(self):
return next(self.iterator)

next = __next__ # Python 2 compatibility.

def tell(self, *args, **kwargs):
raise UnsupportedOperation("Data generator does not support tell.")

Expand All @@ -534,7 +536,7 @@ def read(self, size):
count = len(self.leftover)
try:
while count < size:
chunk = self.next()
chunk = self.__next__()
if isinstance(chunk, six.text_type):
chunk = chunk.encode(self.encoding)
data += chunk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
# pylint: disable=too-many-lines
# pylint: disable=too-many-lines, invalid-overridden-method

from typing import ( # pylint: disable=unused-import
Union, Optional, Any, IO, Iterable, AnyStr, Dict, List, Tuple,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------

# pylint: disable=invalid-overridden-method
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not solve the purpose. We must create a common base class for sync and async and inherit both the clients from the base class.

class BlobServiceClientBase():

class BlobServiceClient(BlobServiceClientBase):

again in ./aio
class BlobServiceClient(BlobServiceClientBase):

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mypy pr is already doing this, I think we can reuse that one
Also this problem happened for upload, download, policies, I don't think we need to create a base and inherit for sync and async for all cases.

import functools
from typing import ( # pylint: disable=unused-import
Union, Optional, Any, Iterable, Dict, List,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------

# pylint: disable=invalid-overridden-method
import functools
from typing import ( # pylint: disable=unused-import
Union, Optional, Any, Iterable, AnyStr, Dict, List, IO, AsyncIterator,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
# pylint: disable=invalid-overridden-method

import asyncio
import sys
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
# pylint: disable=invalid-overridden-method

from typing import ( # pylint: disable=unused-import
Union, Optional, Any, IO, Iterable, AnyStr, Dict, List, Tuple,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,27 +64,30 @@ def __init__(self, account_name, account_key):
self.account_key = account_key
super(SharedKeyCredentialPolicy, self).__init__()

def _get_headers(self, request, headers_to_sign):
@staticmethod
def _get_headers(request, headers_to_sign):
headers = dict((name.lower(), value) for name, value in request.http_request.headers.items() if value)
if 'content-length' in headers and headers['content-length'] == '0':
del headers['content-length']
return '\n'.join(headers.get(x, '') for x in headers_to_sign) + '\n'

def _get_verb(self, request):
@staticmethod
def _get_verb(request):
return request.http_request.method + '\n'

def _get_canonicalized_resource(self, request):
uri_path = urlparse(request.http_request.url).path
try:
if isinstance(request.context.transport, AioHttpTransport) or \
isinstance(getattr(request.context.transport, "_transport", None), AioHttpTransport):
isinstance(getattr(request.context.transport, "_transport", None), AioHttpTransport):
uri_path = URL(uri_path)
return '/' + self.account_name + str(uri_path)
except TypeError:
pass
return '/' + self.account_name + uri_path

def _get_canonicalized_headers(self, request):
@staticmethod
def _get_canonicalized_headers(request):
string_to_sign = ''
x_ms_headers = []
for name, value in request.http_request.headers.items():
Expand All @@ -96,8 +99,9 @@ def _get_canonicalized_headers(self, request):
string_to_sign += ''.join([name, ':', value, '\n'])
return string_to_sign

def _get_canonicalized_resource_query(self, request):
sorted_queries = [(name, value) for name, value in request.http_request.query.items()]
@staticmethod
def _get_canonicalized_resource_query(request):
sorted_queries = list(request.http_request.query.items())
sorted_queries.sort()

string_to_sign = ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
# pylint: disable=invalid-overridden-method

import asyncio
import random
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -538,9 +538,11 @@ def __iter__(self):
def seekable(self):
return False

def next(self):
def __next__(self):
return next(self.iterator)

next = __next__ # Python 2 compatibility.

def tell(self, *args, **kwargs):
raise UnsupportedOperation("Data generator does not support tell.")

Expand All @@ -552,7 +554,7 @@ def read(self, size):
count = len(self.leftover)
try:
while count < size:
chunk = self.next()
chunk = self.__next__()
if isinstance(chunk, six.text_type):
chunk = chunk.encode(self.encoding)
data += chunk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
# pylint: disable=invalid-overridden-method

from ._data_lake_file_client_async import DataLakeFileClient
from .._data_lake_directory_client import DataLakeDirectoryClient as DataLakeDirectoryClientBase
from .._models import DirectoryProperties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
# pylint: disable=invalid-overridden-method

from ._download_async import StorageStreamDownloader
from ._path_client_async import PathClient
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
# pylint: disable=invalid-overridden-method

from typing import ( # pylint: disable=unused-import
Union, Optional, Any,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
# pylint: disable=invalid-overridden-method

from azure.core.paging import ItemPaged

from azure.storage.blob.aio import BlobServiceClient
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
# pylint: disable=invalid-overridden-method

import functools
from typing import ( # pylint: disable=unused-import
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
# pylint: disable=invalid-overridden-method
from azure.storage.blob.aio import BlobClient
from .._shared.base_client_async import AsyncStorageAccountHostsMixin
from .._path_client import PathClient as PathClientBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,27 +64,30 @@ def __init__(self, account_name, account_key):
self.account_key = account_key
super(SharedKeyCredentialPolicy, self).__init__()

def _get_headers(self, request, headers_to_sign):
@staticmethod
def _get_headers(request, headers_to_sign):
headers = dict((name.lower(), value) for name, value in request.http_request.headers.items() if value)
if 'content-length' in headers and headers['content-length'] == '0':
del headers['content-length']
return '\n'.join(headers.get(x, '') for x in headers_to_sign) + '\n'

def _get_verb(self, request):
@staticmethod
def _get_verb(request):
return request.http_request.method + '\n'

def _get_canonicalized_resource(self, request):
uri_path = urlparse(request.http_request.url).path
try:
if isinstance(request.context.transport, AioHttpTransport) or \
isinstance(getattr(request.context.transport, "_transport", None), AioHttpTransport):
isinstance(getattr(request.context.transport, "_transport", None), AioHttpTransport):
uri_path = URL(uri_path)
return '/' + self.account_name + str(uri_path)
except TypeError:
pass
return '/' + self.account_name + uri_path

def _get_canonicalized_headers(self, request):
@staticmethod
def _get_canonicalized_headers(request):
string_to_sign = ''
x_ms_headers = []
for name, value in request.http_request.headers.items():
Expand All @@ -96,8 +99,9 @@ def _get_canonicalized_headers(self, request):
string_to_sign += ''.join([name, ':', value, '\n'])
return string_to_sign

def _get_canonicalized_resource_query(self, request):
sorted_queries = [(name, value) for name, value in request.http_request.query.items()]
@staticmethod
def _get_canonicalized_resource_query(request):
sorted_queries = list(request.http_request.query.items())
sorted_queries.sort()

string_to_sign = ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
# pylint: disable=invalid-overridden-method

import asyncio
import random
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -520,9 +520,11 @@ def __iter__(self):
def seekable(self):
return False

def next(self):
def __next__(self):
return next(self.iterator)

next = __next__ # Python 2 compatibility.

def tell(self, *args, **kwargs):
raise UnsupportedOperation("Data generator does not support tell.")

Expand All @@ -534,7 +536,7 @@ def read(self, size):
count = len(self.leftover)
try:
while count < size:
chunk = self.next()
chunk = self.__next__()
if isinstance(chunk, six.text_type):
chunk = chunk.encode(self.encoding)
data += chunk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------

# pylint: disable=invalid-overridden-method
import functools
import time
from typing import ( # pylint: disable=unused-import
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------

# pylint: disable=invalid-overridden-method
import asyncio
import sys
from io import BytesIO
Expand Down
Loading