diff --git a/azure-mgmt-databox/MANIFEST.in b/azure-mgmt-databox/MANIFEST.in index 9ecaeb15de50..6ceb27f7a96e 100644 --- a/azure-mgmt-databox/MANIFEST.in +++ b/azure-mgmt-databox/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-databox/azure/__init__.py b/azure-mgmt-databox/azure/__init__.py index de40ea7ca058..0260537a02bb 100644 --- a/azure-mgmt-databox/azure/__init__.py +++ b/azure-mgmt-databox/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-databox/azure/mgmt/__init__.py b/azure-mgmt-databox/azure/mgmt/__init__.py index de40ea7ca058..0260537a02bb 100644 --- a/azure-mgmt-databox/azure/mgmt/__init__.py +++ b/azure-mgmt-databox/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-databox/azure/mgmt/databox/models/__init__.py b/azure-mgmt-databox/azure/mgmt/databox/models/__init__.py index 98bf53e04107..32c4b5dadd8c 100644 --- a/azure-mgmt-databox/azure/mgmt/databox/models/__init__.py +++ b/azure-mgmt-databox/azure/mgmt/databox/models/__init__.py @@ -41,6 +41,8 @@ from .data_box_secret_py3 import DataBoxSecret from .databox_job_secrets_py3 import DataboxJobSecrets from .destination_account_details_py3 import DestinationAccountDetails + from .destination_managed_disk_details_py3 import DestinationManagedDiskDetails + from .destination_storage_account_details_py3 import DestinationStorageAccountDetails from .error_py3 import Error from .job_error_details_py3 import JobErrorDetails from .job_stages_py3 import JobStages @@ -90,6 +92,8 @@ from .data_box_secret import DataBoxSecret from .databox_job_secrets import DataboxJobSecrets from .destination_account_details import DestinationAccountDetails + from .destination_managed_disk_details import DestinationManagedDiskDetails + from .destination_storage_account_details import DestinationStorageAccountDetails from .error import Error from .job_error_details import JobErrorDetails from .job_stages import JobStages @@ -156,6 +160,8 @@ 'DataBoxSecret', 'DataboxJobSecrets', 'DestinationAccountDetails', + 'DestinationManagedDiskDetails', + 'DestinationStorageAccountDetails', 'Error', 'JobErrorDetails', 'JobStages', diff --git a/azure-mgmt-databox/azure/mgmt/databox/models/copy_progress.py b/azure-mgmt-databox/azure/mgmt/databox/models/copy_progress.py index a405c0bc3ba6..c427b6664642 100644 --- a/azure-mgmt-databox/azure/mgmt/databox/models/copy_progress.py +++ b/azure-mgmt-databox/azure/mgmt/databox/models/copy_progress.py @@ -28,6 +28,11 @@ class CopyProgress(Model): :ivar total_bytes_to_process: Total amount of data to be processed by the job. :vartype total_bytes_to_process: long + :ivar files_processed: Number of files processed by the job as of now. + :vartype files_processed: long + :ivar total_files_to_process: Total number of files to be processed by the + job. + :vartype total_files_to_process: long """ _validation = { @@ -35,6 +40,8 @@ class CopyProgress(Model): 'account_id': {'readonly': True}, 'bytes_sent_to_cloud': {'readonly': True}, 'total_bytes_to_process': {'readonly': True}, + 'files_processed': {'readonly': True}, + 'total_files_to_process': {'readonly': True}, } _attribute_map = { @@ -42,6 +49,8 @@ class CopyProgress(Model): 'account_id': {'key': 'accountId', 'type': 'str'}, 'bytes_sent_to_cloud': {'key': 'bytesSentToCloud', 'type': 'long'}, 'total_bytes_to_process': {'key': 'totalBytesToProcess', 'type': 'long'}, + 'files_processed': {'key': 'filesProcessed', 'type': 'long'}, + 'total_files_to_process': {'key': 'totalFilesToProcess', 'type': 'long'}, } def __init__(self, **kwargs): @@ -50,3 +59,5 @@ def __init__(self, **kwargs): self.account_id = None self.bytes_sent_to_cloud = None self.total_bytes_to_process = None + self.files_processed = None + self.total_files_to_process = None diff --git a/azure-mgmt-databox/azure/mgmt/databox/models/copy_progress_py3.py b/azure-mgmt-databox/azure/mgmt/databox/models/copy_progress_py3.py index 9ccf9606c976..da30b049de16 100644 --- a/azure-mgmt-databox/azure/mgmt/databox/models/copy_progress_py3.py +++ b/azure-mgmt-databox/azure/mgmt/databox/models/copy_progress_py3.py @@ -28,6 +28,11 @@ class CopyProgress(Model): :ivar total_bytes_to_process: Total amount of data to be processed by the job. :vartype total_bytes_to_process: long + :ivar files_processed: Number of files processed by the job as of now. + :vartype files_processed: long + :ivar total_files_to_process: Total number of files to be processed by the + job. + :vartype total_files_to_process: long """ _validation = { @@ -35,6 +40,8 @@ class CopyProgress(Model): 'account_id': {'readonly': True}, 'bytes_sent_to_cloud': {'readonly': True}, 'total_bytes_to_process': {'readonly': True}, + 'files_processed': {'readonly': True}, + 'total_files_to_process': {'readonly': True}, } _attribute_map = { @@ -42,6 +49,8 @@ class CopyProgress(Model): 'account_id': {'key': 'accountId', 'type': 'str'}, 'bytes_sent_to_cloud': {'key': 'bytesSentToCloud', 'type': 'long'}, 'total_bytes_to_process': {'key': 'totalBytesToProcess', 'type': 'long'}, + 'files_processed': {'key': 'filesProcessed', 'type': 'long'}, + 'total_files_to_process': {'key': 'totalFilesToProcess', 'type': 'long'}, } def __init__(self, **kwargs) -> None: @@ -50,3 +59,5 @@ def __init__(self, **kwargs) -> None: self.account_id = None self.bytes_sent_to_cloud = None self.total_bytes_to_process = None + self.files_processed = None + self.total_files_to_process = None diff --git a/azure-mgmt-databox/azure/mgmt/databox/models/data_box_management_client_enums.py b/azure-mgmt-databox/azure/mgmt/databox/models/data_box_management_client_enums.py index 3539f0cd45c1..3e17602820f0 100644 --- a/azure-mgmt-databox/azure/mgmt/databox/models/data_box_management_client_enums.py +++ b/azure-mgmt-databox/azure/mgmt/databox/models/data_box_management_client_enums.py @@ -19,6 +19,7 @@ class ShareDestinationFormatType(str, Enum): block_blob = "BlockBlob" #: Azure storage block blob format. page_blob = "PageBlob" #: Azure storage page blob format. azure_file = "AzureFile" #: Azure storage file format. + managed_disk = "ManagedDisk" #: Azure Compute Disk. class AccessProtocol(str, Enum): @@ -52,9 +53,10 @@ class SkuDisabledReason(str, Enum): none = "None" #: SKU is not disabled. country = "Country" #: SKU is not available in the requested country. - region = "Region" #: SKU is not available to push data to the requested storage account region. + region = "Region" #: SKU is not available to push data to the requested Azure region. feature = "Feature" #: Required features are not enabled for the SKU. offer_type = "OfferType" #: Subscription does not have required offer types for the SKU. + no_subscription_info = "NoSubscriptionInfo" #: Subscription has not registered to Microsoft.DataBox and Service does not have the subscription notification. class NotificationStageName(str, Enum): diff --git a/azure-mgmt-databox/azure/mgmt/databox/models/destination_account_details.py b/azure-mgmt-databox/azure/mgmt/databox/models/destination_account_details.py index e94706fa9a6e..a1241c5ecdb3 100644 --- a/azure-mgmt-databox/azure/mgmt/databox/models/destination_account_details.py +++ b/azure-mgmt-databox/azure/mgmt/databox/models/destination_account_details.py @@ -13,22 +13,35 @@ class DestinationAccountDetails(Model): - """Details for the destination account. + """Details of the destination of the data. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DestinationManagedDiskDetails, + DestinationStorageAccountDetails All required parameters must be populated in order to send to Azure. - :param account_id: Required. Destination storage account id. + :param account_id: Arm Id of the destination where the data has to be + moved. :type account_id: str + :param data_destination_type: Required. Constant filled by server. + :type data_destination_type: str """ _validation = { - 'account_id': {'required': True}, + 'data_destination_type': {'required': True}, } _attribute_map = { 'account_id': {'key': 'accountId', 'type': 'str'}, + 'data_destination_type': {'key': 'dataDestinationType', 'type': 'str'}, + } + + _subtype_map = { + 'data_destination_type': {'ManagedDisk': 'DestinationManagedDiskDetails', 'StorageAccount': 'DestinationStorageAccountDetails'} } def __init__(self, **kwargs): super(DestinationAccountDetails, self).__init__(**kwargs) self.account_id = kwargs.get('account_id', None) + self.data_destination_type = None diff --git a/azure-mgmt-databox/azure/mgmt/databox/models/destination_account_details_py3.py b/azure-mgmt-databox/azure/mgmt/databox/models/destination_account_details_py3.py index 48ef12839450..9262ee0de4bb 100644 --- a/azure-mgmt-databox/azure/mgmt/databox/models/destination_account_details_py3.py +++ b/azure-mgmt-databox/azure/mgmt/databox/models/destination_account_details_py3.py @@ -13,22 +13,35 @@ class DestinationAccountDetails(Model): - """Details for the destination account. + """Details of the destination of the data. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DestinationManagedDiskDetails, + DestinationStorageAccountDetails All required parameters must be populated in order to send to Azure. - :param account_id: Required. Destination storage account id. + :param account_id: Arm Id of the destination where the data has to be + moved. :type account_id: str + :param data_destination_type: Required. Constant filled by server. + :type data_destination_type: str """ _validation = { - 'account_id': {'required': True}, + 'data_destination_type': {'required': True}, } _attribute_map = { 'account_id': {'key': 'accountId', 'type': 'str'}, + 'data_destination_type': {'key': 'dataDestinationType', 'type': 'str'}, + } + + _subtype_map = { + 'data_destination_type': {'ManagedDisk': 'DestinationManagedDiskDetails', 'StorageAccount': 'DestinationStorageAccountDetails'} } - def __init__(self, *, account_id: str, **kwargs) -> None: + def __init__(self, *, account_id: str=None, **kwargs) -> None: super(DestinationAccountDetails, self).__init__(**kwargs) self.account_id = account_id + self.data_destination_type = None diff --git a/azure-mgmt-databox/azure/mgmt/databox/models/destination_managed_disk_details.py b/azure-mgmt-databox/azure/mgmt/databox/models/destination_managed_disk_details.py new file mode 100644 index 000000000000..38673f446a23 --- /dev/null +++ b/azure-mgmt-databox/azure/mgmt/databox/models/destination_managed_disk_details.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .destination_account_details import DestinationAccountDetails + + +class DestinationManagedDiskDetails(DestinationAccountDetails): + """Details for the destination compute disks. + + All required parameters must be populated in order to send to Azure. + + :param account_id: Arm Id of the destination where the data has to be + moved. + :type account_id: str + :param data_destination_type: Required. Constant filled by server. + :type data_destination_type: str + :param resource_group_id: Required. Destination Resource Group Id where + the Compute disks should be created. + :type resource_group_id: str + :param staging_storage_account_id: Required. Arm Id of the storage account + that can be used to copy the vhd for staging. + :type staging_storage_account_id: str + """ + + _validation = { + 'data_destination_type': {'required': True}, + 'resource_group_id': {'required': True}, + 'staging_storage_account_id': {'required': True}, + } + + _attribute_map = { + 'account_id': {'key': 'accountId', 'type': 'str'}, + 'data_destination_type': {'key': 'dataDestinationType', 'type': 'str'}, + 'resource_group_id': {'key': 'resourceGroupId', 'type': 'str'}, + 'staging_storage_account_id': {'key': 'stagingStorageAccountId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DestinationManagedDiskDetails, self).__init__(**kwargs) + self.resource_group_id = kwargs.get('resource_group_id', None) + self.staging_storage_account_id = kwargs.get('staging_storage_account_id', None) + self.data_destination_type = 'ManagedDisk' diff --git a/azure-mgmt-databox/azure/mgmt/databox/models/destination_managed_disk_details_py3.py b/azure-mgmt-databox/azure/mgmt/databox/models/destination_managed_disk_details_py3.py new file mode 100644 index 000000000000..25d381dfe984 --- /dev/null +++ b/azure-mgmt-databox/azure/mgmt/databox/models/destination_managed_disk_details_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .destination_account_details_py3 import DestinationAccountDetails + + +class DestinationManagedDiskDetails(DestinationAccountDetails): + """Details for the destination compute disks. + + All required parameters must be populated in order to send to Azure. + + :param account_id: Arm Id of the destination where the data has to be + moved. + :type account_id: str + :param data_destination_type: Required. Constant filled by server. + :type data_destination_type: str + :param resource_group_id: Required. Destination Resource Group Id where + the Compute disks should be created. + :type resource_group_id: str + :param staging_storage_account_id: Required. Arm Id of the storage account + that can be used to copy the vhd for staging. + :type staging_storage_account_id: str + """ + + _validation = { + 'data_destination_type': {'required': True}, + 'resource_group_id': {'required': True}, + 'staging_storage_account_id': {'required': True}, + } + + _attribute_map = { + 'account_id': {'key': 'accountId', 'type': 'str'}, + 'data_destination_type': {'key': 'dataDestinationType', 'type': 'str'}, + 'resource_group_id': {'key': 'resourceGroupId', 'type': 'str'}, + 'staging_storage_account_id': {'key': 'stagingStorageAccountId', 'type': 'str'}, + } + + def __init__(self, *, resource_group_id: str, staging_storage_account_id: str, account_id: str=None, **kwargs) -> None: + super(DestinationManagedDiskDetails, self).__init__(account_id=account_id, **kwargs) + self.resource_group_id = resource_group_id + self.staging_storage_account_id = staging_storage_account_id + self.data_destination_type = 'ManagedDisk' diff --git a/azure-mgmt-databox/azure/mgmt/databox/models/destination_storage_account_details.py b/azure-mgmt-databox/azure/mgmt/databox/models/destination_storage_account_details.py new file mode 100644 index 000000000000..81ebba5da13f --- /dev/null +++ b/azure-mgmt-databox/azure/mgmt/databox/models/destination_storage_account_details.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .destination_account_details import DestinationAccountDetails + + +class DestinationStorageAccountDetails(DestinationAccountDetails): + """Details for the destination storage account. + + All required parameters must be populated in order to send to Azure. + + :param account_id: Arm Id of the destination where the data has to be + moved. + :type account_id: str + :param data_destination_type: Required. Constant filled by server. + :type data_destination_type: str + :param storage_account_id: Required. Destination Storage Account Arm Id. + :type storage_account_id: str + """ + + _validation = { + 'data_destination_type': {'required': True}, + 'storage_account_id': {'required': True}, + } + + _attribute_map = { + 'account_id': {'key': 'accountId', 'type': 'str'}, + 'data_destination_type': {'key': 'dataDestinationType', 'type': 'str'}, + 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DestinationStorageAccountDetails, self).__init__(**kwargs) + self.storage_account_id = kwargs.get('storage_account_id', None) + self.data_destination_type = 'StorageAccount' diff --git a/azure-mgmt-databox/azure/mgmt/databox/models/destination_storage_account_details_py3.py b/azure-mgmt-databox/azure/mgmt/databox/models/destination_storage_account_details_py3.py new file mode 100644 index 000000000000..e9d998111ffc --- /dev/null +++ b/azure-mgmt-databox/azure/mgmt/databox/models/destination_storage_account_details_py3.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .destination_account_details_py3 import DestinationAccountDetails + + +class DestinationStorageAccountDetails(DestinationAccountDetails): + """Details for the destination storage account. + + All required parameters must be populated in order to send to Azure. + + :param account_id: Arm Id of the destination where the data has to be + moved. + :type account_id: str + :param data_destination_type: Required. Constant filled by server. + :type data_destination_type: str + :param storage_account_id: Required. Destination Storage Account Arm Id. + :type storage_account_id: str + """ + + _validation = { + 'data_destination_type': {'required': True}, + 'storage_account_id': {'required': True}, + } + + _attribute_map = { + 'account_id': {'key': 'accountId', 'type': 'str'}, + 'data_destination_type': {'key': 'dataDestinationType', 'type': 'str'}, + 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, + } + + def __init__(self, *, storage_account_id: str, account_id: str=None, **kwargs) -> None: + super(DestinationStorageAccountDetails, self).__init__(account_id=account_id, **kwargs) + self.storage_account_id = storage_account_id + self.data_destination_type = 'StorageAccount' diff --git a/azure-mgmt-databox/azure/mgmt/databox/models/share_credential_details.py b/azure-mgmt-databox/azure/mgmt/databox/models/share_credential_details.py index e13ee8ba70f1..716d92ed7b81 100644 --- a/azure-mgmt-databox/azure/mgmt/databox/models/share_credential_details.py +++ b/azure-mgmt-databox/azure/mgmt/databox/models/share_credential_details.py @@ -21,7 +21,7 @@ class ShareCredentialDetails(Model): :ivar share_name: Name of the share. :vartype share_name: str :ivar share_type: Type of the share. Possible values include: - 'UnknownType', 'HCS', 'BlockBlob', 'PageBlob', 'AzureFile' + 'UnknownType', 'HCS', 'BlockBlob', 'PageBlob', 'AzureFile', 'ManagedDisk' :vartype share_type: str or ~azure.mgmt.databox.models.ShareDestinationFormatType :ivar user_name: User name for the share. diff --git a/azure-mgmt-databox/azure/mgmt/databox/models/share_credential_details_py3.py b/azure-mgmt-databox/azure/mgmt/databox/models/share_credential_details_py3.py index 1013c8edbbdd..91854fe963f4 100644 --- a/azure-mgmt-databox/azure/mgmt/databox/models/share_credential_details_py3.py +++ b/azure-mgmt-databox/azure/mgmt/databox/models/share_credential_details_py3.py @@ -21,7 +21,7 @@ class ShareCredentialDetails(Model): :ivar share_name: Name of the share. :vartype share_name: str :ivar share_type: Type of the share. Possible values include: - 'UnknownType', 'HCS', 'BlockBlob', 'PageBlob', 'AzureFile' + 'UnknownType', 'HCS', 'BlockBlob', 'PageBlob', 'AzureFile', 'ManagedDisk' :vartype share_type: str or ~azure.mgmt.databox.models.ShareDestinationFormatType :ivar user_name: User name for the share. diff --git a/azure-mgmt-databox/azure/mgmt/databox/models/sku_information.py b/azure-mgmt-databox/azure/mgmt/databox/models/sku_information.py index 340805c3899e..5c658edb12eb 100644 --- a/azure-mgmt-databox/azure/mgmt/databox/models/sku_information.py +++ b/azure-mgmt-databox/azure/mgmt/databox/models/sku_information.py @@ -33,7 +33,8 @@ class SkuInformation(Model): :ivar api_versions: Api versions that support this Sku. :vartype api_versions: list[str] :ivar disabled_reason: Reason why the Sku is disabled. Possible values - include: 'None', 'Country', 'Region', 'Feature', 'OfferType' + include: 'None', 'Country', 'Region', 'Feature', 'OfferType', + 'NoSubscriptionInfo' :vartype disabled_reason: str or ~azure.mgmt.databox.models.SkuDisabledReason :ivar disabled_reason_message: Message for why the Sku is disabled. diff --git a/azure-mgmt-databox/azure/mgmt/databox/models/sku_information_py3.py b/azure-mgmt-databox/azure/mgmt/databox/models/sku_information_py3.py index c6d07418e74e..eb5f730a619e 100644 --- a/azure-mgmt-databox/azure/mgmt/databox/models/sku_information_py3.py +++ b/azure-mgmt-databox/azure/mgmt/databox/models/sku_information_py3.py @@ -33,7 +33,8 @@ class SkuInformation(Model): :ivar api_versions: Api versions that support this Sku. :vartype api_versions: list[str] :ivar disabled_reason: Reason why the Sku is disabled. Possible values - include: 'None', 'Country', 'Region', 'Feature', 'OfferType' + include: 'None', 'Country', 'Region', 'Feature', 'OfferType', + 'NoSubscriptionInfo' :vartype disabled_reason: str or ~azure.mgmt.databox.models.SkuDisabledReason :ivar disabled_reason_message: Message for why the Sku is disabled. diff --git a/azure-mgmt-databox/azure/mgmt/databox/version.py b/azure-mgmt-databox/azure/mgmt/databox/version.py index b8ffb04f789f..c3c04423a322 100644 --- a/azure-mgmt-databox/azure/mgmt/databox/version.py +++ b/azure-mgmt-databox/azure/mgmt/databox/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.0.1" +VERSION = "2018-01-01" diff --git a/azure-mgmt-databox/azure_bdist_wheel.py b/azure-mgmt-databox/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b61775..000000000000 --- a/azure-mgmt-databox/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-databox/setup.cfg b/azure-mgmt-databox/setup.cfg index 856f4164982c..3c6e79cf31da 100644 --- a/azure-mgmt-databox/setup.cfg +++ b/azure-mgmt-databox/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-databox/setup.py b/azure-mgmt-databox/setup.py index 505992723791..e72447fdd47d 100644 --- a/azure-mgmt-databox/setup.py +++ b/azure-mgmt-databox/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-databox" @@ -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'], + } )