Skip to content

Commit

Permalink
Update code_report.py (Azure#15806)
Browse files Browse the repository at this point in the history
* Update code_report.py

* Update code_report.py

* Update code_report.py

* Update code_report.py

* Update _aiohttp.py

* Update _base.py
  • Loading branch information
msyyc authored Dec 17, 2020
1 parent 325c36e commit b1ae36e
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 47 deletions.
4 changes: 2 additions & 2 deletions sdk/core/azure-core/azure/core/pipeline/transport/_aiohttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import logging
import asyncio
import aiohttp
from multidict import CIMultiDict

from requests.exceptions import (
ChunkedEncodingError,
Expand Down Expand Up @@ -264,7 +265,7 @@ def __init__(self, request: HttpRequest, aiohttp_response: aiohttp.ClientRespons
super(AioHttpTransportResponse, self).__init__(request, aiohttp_response, block_size=block_size)
# https://aiohttp.readthedocs.io/en/stable/client_reference.html#aiohttp.ClientResponse
self.status_code = aiohttp_response.status
self.headers = aiohttp_response.headers
self.headers = CIMultiDict(aiohttp_response.headers)
self.reason = aiohttp_response.reason
self.content_type = aiohttp_response.headers.get('content-type')
self._body = None
Expand Down Expand Up @@ -307,6 +308,5 @@ def __getstate__(self):
state = self.__dict__.copy()
# Remove the unpicklable entries.
state['internal_response'] = None # aiohttp response are not pickable (see headers comments)
from multidict import CIMultiDict # I know it's importable since aiohttp is loaded
state['headers'] = CIMultiDict(self.headers) # MultiDictProxy is not pickable
return state
3 changes: 2 additions & 1 deletion sdk/core/azure-core/azure/core/pipeline/transport/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@

if TYPE_CHECKING:
from ..policies import SansIOHTTPPolicy
from collections.abc import MutableMapping

HTTPResponseType = TypeVar("HTTPResponseType")
HTTPRequestType = TypeVar("HTTPRequestType")
Expand Down Expand Up @@ -478,7 +479,7 @@ def __init__(self, request, internal_response, block_size=None):
self.request = request
self.internal_response = internal_response
self.status_code = None # type: Optional[int]
self.headers = {} # type: Dict[str, str]
self.headers = {} # type: MutableMapping[str, str]
self.reason = None # type: Optional[str]
self.content_type = None # type: Optional[str]
self.block_size = block_size or 4096 # Default to same as Requests
Expand Down
124 changes: 80 additions & 44 deletions tools/azure-sdk-tools/packaging_tools/code_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,51 +153,87 @@ def filter_track2_versions(package_name, versions):
from packaging import version
track2_versions = {
'azure-mgmt-appconfiguration': '1.0.0b1',
'azure-mgmt-compute':'17.0.0b1',
'azure-mgmt-eventhub':'8.0.0b1',
'azure-mgmt-keyvault':'7.0.0b1',
'azure-mgmt-monitor':'1.0.0b1',
'azure-mgmt-network':'16.0.0b1',
'azure-mgmt-resource':'15.0.0b1',
'azure-mgmt-storage':'16.0.0b1',
'azure-mgmt-compute': '17.0.0b1',
'azure-mgmt-eventhub': '8.0.0b1',
'azure-mgmt-keyvault': '7.0.0b1',
'azure-mgmt-monitor': '1.0.0b1',
'azure-mgmt-network': '16.0.0b1',
'azure-mgmt-resource': '15.0.0b1',
'azure-mgmt-storage': '16.0.0b1',
'azure-mgmt-containerservice': '14.0.0b1',
'azure-mgmt-web':'1.0.0b1',
'azure-mgmt-authorization':'1.0.0b1',
'azure-mgmt-servicebus':'6.0.0b1',
'azure-mgmt-cosmosdb':'6.0.0b1',
'azure-mgmt-sql':'1.0.0b1',
'azure-mgmt-redis':'12.0.0b1',
'azure-mgmt-containerregistry':'8.0.0b1',
'azure-mgmt-containerinstance':'7.0.0b1',
'azure-mgmt-resourcegraph':'7.0.0b1',
'azure-mgmt-subscription':'1.0.0b1',
'azure-mgmt-operationsmanagement':'1.0.0b1',
'azure-mgmt-datafactory':'1.0.0b1',
'azure-mgmt-rdbms':'8.0.0b1',
'azure-mgmt-loganalytics':'7.0.0b1',
'azure-mgmt-automation':'1.0.0b1',
'azure-mgmt-recoveryservices':'1.0.0b1',
'azure-mgmt-iothub':'1.0.0b1',
'azure-mgmt-logic':'9.0.0b1',
'azure-mgmt-hdinsight':'7.0.0b1',
'azure-mgmt-machinelearningservices':'1.0.0b1',
'azure-mgmt-datalake-store':'1.0.0b1',
'azure-mgmt-cdn':'10.0.0b1',
'azure-mgmt-devtestlabs':'9.0.0b1',
'azure-mgmt-apimanagement':'1.0.0b1',
'azure-mgmt-eventgrid':'8.0.0b1',
'azure-mgmt-consumption':'8.0.0b1',
'azure-mgmt-marketplaceordering':'1.0.0b1',
'azure-mgmt-advisor':'9.0.0b1',
'azure-mgmt-cognitiveservices':'11.0.0b1',
'azure-mgmt-security':'1.0.0b1',
'azure-mgmt-relay':'1.0.0b1',
'azure-mgmt-notificationhubs':'7.0.0b1',
'azure-mgmt-search':'8.0.0b1',
'azure-mgmt-policyinsights':'1.0.0b1',
'azure-mgmt-batch':'14.0.0b1',
'azure-mgmt-scheduler':'7.0.0b1',
'azure-mgmt-commerce':'6.0.0b1'
'azure-mgmt-web': '1.0.0b1',
'azure-mgmt-authorization': '1.0.0b1',
'azure-mgmt-servicebus': '6.0.0b1',
'azure-mgmt-cosmosdb': '6.0.0b1',
'azure-mgmt-sql': '1.0.0b1',
'azure-mgmt-redis': '12.0.0b1',
'azure-mgmt-containerregistry': '8.0.0b1',
'azure-mgmt-containerinstance': '7.0.0b1',
'azure-mgmt-resourcegraph': '7.0.0b1',
'azure-mgmt-subscription': '1.0.0b1',
'azure-mgmt-operationsmanagement': '1.0.0b1',
'azure-mgmt-datafactory': '1.0.0b1',
'azure-mgmt-rdbms': '8.0.0b1',
'azure-mgmt-loganalytics': '7.0.0b1',
'azure-mgmt-automation': '1.0.0b1',
'azure-mgmt-recoveryservices': '1.0.0b1',
'azure-mgmt-iothub': '1.0.0b1',
'azure-mgmt-logic': '9.0.0b1',
'azure-mgmt-hdinsight': '7.0.0b1',
'azure-mgmt-machinelearningservices': '1.0.0b1',
'azure-mgmt-datalake-store': '1.0.0b1',
'azure-mgmt-cdn': '10.0.0b1',
'azure-mgmt-devtestlabs': '9.0.0b1',
'azure-mgmt-apimanagement': '1.0.0b1',
'azure-mgmt-eventgrid': '8.0.0b1',
'azure-mgmt-consumption': '8.0.0b1',
'azure-mgmt-marketplaceordering': '1.0.0b1',
'azure-mgmt-advisor': '9.0.0b1',
'azure-mgmt-cognitiveservices': '11.0.0b1',
'azure-mgmt-security': '1.0.0b1',
'azure-mgmt-relay': '1.0.0b1',
'azure-mgmt-notificationhubs': '7.0.0b1',
'azure-mgmt-search': '8.0.0b1',
'azure-mgmt-policyinsights': '1.0.0b1',
'azure-mgmt-batch': '14.0.0b1',
'azure-mgmt-scheduler': '7.0.0b1',
'azure-mgmt-commerce': '6.0.0b1',
'azure-mgmt-alertsmanagement': '1.0.0b1',
'azure-mgmt-billing': '6.0.0b1',
'azure-mgmt-botservice': '1.0.0b1',
'azure-mgmt-costmanagement': '1.0.0b1',
'azure-mgmt-databox': '1.0.0b1',
'azure-mgmt-databricks': '1.0.0b1',
'azure-mgmt-deploymentmanager': '1.0.0b1',
'azure-mgmt-kusto': '1.0.0b1',
'azure-mgmt-labservices': '1.0.0b1',
'azure-mgmt-maps': '1.0.0b1',
'azure-mgmt-media': '7.0.0b1',
'azure-mgmt-netapp': '1.0.0b1',
'azure-mgmt-powerbidedicated': '1.0.0b1',
'azure-mgmt-servicefabric': '1.0.0b1',
'azure-mgmt-signalr': '1.0.0b1',
'azure-mgmt-support': '6.0.0b1',
'azure-mgmt-storagesync': '1.0.0b1',
'azure-mgmt-appplatform': '6.0.0b1',
'azure-mgmt-attestation': '1.0.0b1',
'azure-mgmt-azurestack': '1.0.0b1',
'azure-mgmt-customproviders': '1.0.0b1',
'azure-mgmt-datashare': '1.0.0b1',
'azure-mgmt-hanaonazure': '1.0.0b1',
'azure-mgmt-healthcareapis': '1.0.0b1',
'azure-mgmt-hybridcompute': '7.0.0b1',
'azure-mgmt-maintenance': '1.0.0b1',
'azure-mgmt-managedservices': '6.0.0b1',
'azure-mgmt-peering': '1.0.0b1',
'azure-mgmt-automanage': '1.0.0b1',
'azure-mgmt-applicationinsights': '1.0.0b1',
'azure-mgmt-azurestackhci': '6.0.0b1',
'azure-mgmt-databoxedge': '1.0.0b1',
'azure-mgmt-hybridkubernetes': '1.0.0b1',
'azure-mgmt-managementgroups': '1.0.0b1',
'azure-mgmt-resourcemover': '1.0.1b1',
'azure-mgmt-synapse': '1.0.0b1'
}
upbound = track2_versions.get(package_name)
if not upbound:
Expand Down

0 comments on commit b1ae36e

Please sign in to comment.