From 09e2dd64d501964578754b89c391f57d6ce55cca Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Sat, 1 Dec 2018 23:21:22 +0000 Subject: [PATCH 1/2] Generated from fdece31d93936dffb37985d3b40ba66879ab5d97 typo: iothub/Microsoft.Devices - Double word "the" - avrodeflate -> avroDeflate - Thehub -> The hub - Double word "state" - Trim trailing whitespace --- .../azure/mgmt/iothub/models/iot_hub_properties.py | 2 +- .../azure/mgmt/iothub/models/iot_hub_properties_py3.py | 2 +- .../mgmt/iothub/models/routing_storage_container_properties.py | 2 +- .../iothub/models/routing_storage_container_properties_py3.py | 2 +- .../azure/mgmt/iothub/models/storage_endpoint_properties.py | 2 +- .../azure/mgmt/iothub/models/storage_endpoint_properties_py3.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_properties.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_properties.py index 1185275efca7..1892e7d14d09 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_properties.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_properties.py @@ -26,7 +26,7 @@ class IotHubProperties(Model): :type ip_filter_rules: list[~azure.mgmt.iothub.models.IpFilterRule] :ivar provisioning_state: The provisioning state. :vartype provisioning_state: str - :ivar state: Thehub state state. + :ivar state: The hub state. :vartype state: str :ivar host_name: The name of the host. :vartype host_name: str diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_properties_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_properties_py3.py index bc89576ff01c..25a848002caf 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_properties_py3.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_properties_py3.py @@ -26,7 +26,7 @@ class IotHubProperties(Model): :type ip_filter_rules: list[~azure.mgmt.iothub.models.IpFilterRule] :ivar provisioning_state: The provisioning state. :vartype provisioning_state: str - :ivar state: Thehub state state. + :ivar state: The hub state. :vartype state: str :ivar host_name: The name of the host. :vartype host_name: str diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_storage_container_properties.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_storage_container_properties.py index b8a5e9cbede9..de849fc2b91f 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_storage_container_properties.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_storage_container_properties.py @@ -48,7 +48,7 @@ class RoutingStorageContainerProperties(Model): 524288000(500MB). Default value is 314572800(300MB). :type max_chunk_size_in_bytes: int :param encoding: Encoding that is used to serialize messages to blobs. - Supported values are 'avro' and 'avrodeflate'. Default value is 'avro'. + Supported values are 'avro' and 'avroDeflate'. Default value is 'avro'. :type encoding: str """ diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_storage_container_properties_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_storage_container_properties_py3.py index 50b99f1fb73b..810785ffb222 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_storage_container_properties_py3.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/routing_storage_container_properties_py3.py @@ -48,7 +48,7 @@ class RoutingStorageContainerProperties(Model): 524288000(500MB). Default value is 314572800(300MB). :type max_chunk_size_in_bytes: int :param encoding: Encoding that is used to serialize messages to blobs. - Supported values are 'avro' and 'avrodeflate'. Default value is 'avro'. + Supported values are 'avro' and 'avroDeflate'. Default value is 'avro'. :type encoding: str """ diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/storage_endpoint_properties.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/storage_endpoint_properties.py index e9664199efa8..c7d89dd13b2b 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/storage_endpoint_properties.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/storage_endpoint_properties.py @@ -17,7 +17,7 @@ class StorageEndpointProperties(Model): All required parameters must be populated in order to send to Azure. - :param sas_ttl_as_iso8601: The period of time for which the the SAS URI + :param sas_ttl_as_iso8601: The period of time for which the SAS URI generated by IoT Hub for file upload is valid. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload#file-upload-notification-configuration-options. :type sas_ttl_as_iso8601: timedelta diff --git a/azure-mgmt-iothub/azure/mgmt/iothub/models/storage_endpoint_properties_py3.py b/azure-mgmt-iothub/azure/mgmt/iothub/models/storage_endpoint_properties_py3.py index 54193d3eaab8..015e0488bd7b 100644 --- a/azure-mgmt-iothub/azure/mgmt/iothub/models/storage_endpoint_properties_py3.py +++ b/azure-mgmt-iothub/azure/mgmt/iothub/models/storage_endpoint_properties_py3.py @@ -17,7 +17,7 @@ class StorageEndpointProperties(Model): All required parameters must be populated in order to send to Azure. - :param sas_ttl_as_iso8601: The period of time for which the the SAS URI + :param sas_ttl_as_iso8601: The period of time for which the SAS URI generated by IoT Hub for file upload is valid. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload#file-upload-notification-configuration-options. :type sas_ttl_as_iso8601: timedelta From edd32facc5e8b0f3961d8df3e312f21ab0e4679d Mon Sep 17 00:00:00 2001 From: azuresdkci Date: Sat, 1 Dec 2018 23:26:10 +0000 Subject: [PATCH 2/2] Packaging update of azure-mgmt-iothub --- azure-mgmt-iothub/MANIFEST.in | 4 +- azure-mgmt-iothub/azure/__init__.py | 2 +- azure-mgmt-iothub/azure/mgmt/__init__.py | 2 +- azure-mgmt-iothub/azure_bdist_wheel.py | 54 ------------------------ azure-mgmt-iothub/setup.cfg | 1 - azure-mgmt-iothub/setup.py | 17 ++++---- 6 files changed, 14 insertions(+), 66 deletions(-) delete mode 100644 azure-mgmt-iothub/azure_bdist_wheel.py diff --git a/azure-mgmt-iothub/MANIFEST.in b/azure-mgmt-iothub/MANIFEST.in index 9ecaeb15de50..6ceb27f7a96e 100644 --- a/azure-mgmt-iothub/MANIFEST.in +++ b/azure-mgmt-iothub/MANIFEST.in @@ -1,2 +1,4 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/azure-mgmt-iothub/azure/__init__.py b/azure-mgmt-iothub/azure/__init__.py index 849489fca33c..0260537a02bb 100644 --- a/azure-mgmt-iothub/azure/__init__.py +++ b/azure-mgmt-iothub/azure/__init__.py @@ -1 +1 @@ -__import__('pkg_resources').declare_namespace(__name__) +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-iothub/azure/mgmt/__init__.py b/azure-mgmt-iothub/azure/mgmt/__init__.py index 849489fca33c..0260537a02bb 100644 --- a/azure-mgmt-iothub/azure/mgmt/__init__.py +++ b/azure-mgmt-iothub/azure/mgmt/__init__.py @@ -1 +1 @@ -__import__('pkg_resources').declare_namespace(__name__) +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-iothub/azure_bdist_wheel.py b/azure-mgmt-iothub/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b61775..000000000000 --- a/azure-mgmt-iothub/azure_bdist_wheel.py +++ /dev/null @@ -1,54 +0,0 @@ -#------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -#-------------------------------------------------------------------------- - -from distutils import log as logger -import os.path - -from wheel.bdist_wheel import bdist_wheel -class azure_bdist_wheel(bdist_wheel): - """The purpose of this class is to build wheel a little differently than the sdist, - without requiring to build the wheel from the sdist (i.e. you can build the wheel - directly from source). - """ - - description = "Create an Azure wheel distribution" - - user_options = bdist_wheel.user_options + \ - [('azure-namespace-package=', None, - "Name of the deepest nspkg used")] - - def initialize_options(self): - bdist_wheel.initialize_options(self) - self.azure_namespace_package = None - - def finalize_options(self): - bdist_wheel.finalize_options(self) - if self.azure_namespace_package and not self.azure_namespace_package.endswith("-nspkg"): - raise ValueError("azure_namespace_package must finish by -nspkg") - - def run(self): - if not self.distribution.install_requires: - self.distribution.install_requires = [] - self.distribution.install_requires.append( - "{}>=2.0.0".format(self.azure_namespace_package)) - bdist_wheel.run(self) - - def write_record(self, bdist_dir, distinfo_dir): - if self.azure_namespace_package: - # Split and remove last part, assuming it's "nspkg" - subparts = self.azure_namespace_package.split('-')[0:-1] - folder_with_init = [os.path.join(*subparts[0:i+1]) for i in range(len(subparts))] - for azure_sub_package in folder_with_init: - init_file = os.path.join(bdist_dir, azure_sub_package, '__init__.py') - if os.path.isfile(init_file): - logger.info("manually remove {} while building the wheel".format(init_file)) - os.remove(init_file) - else: - raise ValueError("Unable to find {}. Are you sure of your namespace package?".format(init_file)) - bdist_wheel.write_record(self, bdist_dir, distinfo_dir) -cmdclass = { - 'bdist_wheel': azure_bdist_wheel, -} diff --git a/azure-mgmt-iothub/setup.cfg b/azure-mgmt-iothub/setup.cfg index 856f4164982c..3c6e79cf31da 100644 --- a/azure-mgmt-iothub/setup.cfg +++ b/azure-mgmt-iothub/setup.cfg @@ -1,3 +1,2 @@ [bdist_wheel] universal=1 -azure-namespace-package=azure-mgmt-nspkg \ No newline at end of file diff --git a/azure-mgmt-iothub/setup.py b/azure-mgmt-iothub/setup.py index e37489b5355f..b74fae46b4b5 100644 --- a/azure-mgmt-iothub/setup.py +++ b/azure-mgmt-iothub/setup.py @@ -10,12 +10,6 @@ import os.path from io import open from setuptools import find_packages, setup -try: - from azure_bdist_wheel import cmdclass -except ImportError: - from distutils import log as logger - logger.warn("Wheel is not available, disabling bdist_wheel hook") - cmdclass = {} # Change the PACKAGE_NAME only to change folder and different name PACKAGE_NAME = "azure-mgmt-iothub" @@ -76,11 +70,18 @@ 'License :: OSI Approved :: MIT License', ], zip_safe=False, - packages=find_packages(exclude=["tests"]), + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + 'azure.mgmt', + ]), install_requires=[ 'msrest>=0.5.0', 'msrestazure>=0.4.32,<2.0.0', 'azure-common~=1.1', ], - cmdclass=cmdclass + extras_require={ + ":python_version<'3.0'": ['azure-mgmt-nspkg'], + } )