From ef6aab181c83269e22df848aa72100861f3217d3 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Fri, 21 Sep 2018 16:29:13 -0700 Subject: [PATCH 01/23] Main azure nspkg 3.0 --- azure-mgmt-datalake-nspkg/README.rst | 3 +++ .../azure/mgmt/datalake/__init__.py | 1 + azure-mgmt-datalake-nspkg/setup.py | 12 ++++-------- azure-mgmt-nspkg/README.rst | 3 +++ azure-mgmt-nspkg/azure/mgmt/__init__.py | 1 + azure-mgmt-nspkg/setup.py | 12 ++++-------- azure-nspkg/MANIFEST.in | 1 + azure-nspkg/README.rst | 3 +++ azure-nspkg/azure/__init__.py | 2 +- azure-nspkg/setup.py | 10 +++------- 10 files changed, 24 insertions(+), 24 deletions(-) create mode 100644 azure-nspkg/MANIFEST.in diff --git a/azure-mgmt-datalake-nspkg/README.rst b/azure-mgmt-datalake-nspkg/README.rst index 49c7fe633b175..8cea9797ff9f3 100644 --- a/azure-mgmt-datalake-nspkg/README.rst +++ b/azure-mgmt-datalake-nspkg/README.rst @@ -5,6 +5,9 @@ This is the Microsoft Azure Data Lake Management namespace package. This package is not intended to be installed directly by the end user. +Since version 3.0, this is Python 2 package only, Python 3.x SDKs will use `PEP420 ` as namespace package strategy. +This package will use `python_requires` to enforce Python 2 installation. This implies that you might see this package on Python 3 environment if you have pip < 9.0 or setuptools < 24.2.0. + It provides the necessary files for other packages to extend the azure.mgmt.datalake namespace. If you are looking to install the Azure client libraries, see the diff --git a/azure-mgmt-datalake-nspkg/azure/mgmt/datalake/__init__.py b/azure-mgmt-datalake-nspkg/azure/mgmt/datalake/__init__.py index e69de29bb2d1d..0260537a02bb9 100644 --- a/azure-mgmt-datalake-nspkg/azure/mgmt/datalake/__init__.py +++ b/azure-mgmt-datalake-nspkg/azure/mgmt/datalake/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-datalake-nspkg/setup.py b/azure-mgmt-datalake-nspkg/setup.py index de929d8e734e4..c6a6e1b388836 100644 --- a/azure-mgmt-datalake-nspkg/setup.py +++ b/azure-mgmt-datalake-nspkg/setup.py @@ -25,25 +25,21 @@ setup( name='azure-mgmt-datalake-nspkg', - version='2.0.0', + version='3.0.0', description='Microsoft Azure Data Lake Management Namespace Package [Internal]', long_description=open('README.rst', 'r').read(), license='MIT License', author='Microsoft Corporation', - author_email='ptvshelp@microsoft.com', + author_email='azpysdkhelp@microsoft.com', url='https://github.com/Azure/azure-sdk-for-python', classifiers=[ 'Development Status :: 5 - Production/Stable', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', 'License :: OSI Approved :: MIT License', ], + python_requires='<3', zip_safe=False, packages=[ 'azure', @@ -51,6 +47,6 @@ 'azure.mgmt.datalake', ], install_requires=[ - 'azure-mgmt-nspkg>=2.0.0', + 'azure-mgmt-nspkg>=3.0.0', ], ) diff --git a/azure-mgmt-nspkg/README.rst b/azure-mgmt-nspkg/README.rst index 8a67977e40253..7af965daea5f9 100644 --- a/azure-mgmt-nspkg/README.rst +++ b/azure-mgmt-nspkg/README.rst @@ -5,6 +5,9 @@ This is the Microsoft Azure Management namespace package. This package is not intended to be installed directly by the end user. +Since version 3.0, this is Python 2 package only, Python 3.x SDKs will use `PEP420 ` as namespace package strategy. +This package will use `python_requires` to enforce Python 2 installation. This implies that you might see this package on Python 3 environment if you have pip < 9.0 or setuptools < 24.2.0. + It provides the necessary files for other packages to extend the azure.mgmt namespace. If you are looking to install the Azure client libraries, see the diff --git a/azure-mgmt-nspkg/azure/mgmt/__init__.py b/azure-mgmt-nspkg/azure/mgmt/__init__.py index e69de29bb2d1d..0260537a02bb9 100644 --- a/azure-mgmt-nspkg/azure/mgmt/__init__.py +++ b/azure-mgmt-nspkg/azure/mgmt/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-nspkg/setup.py b/azure-mgmt-nspkg/setup.py index f6a01ad91c0c6..7c91d90fb5955 100644 --- a/azure-mgmt-nspkg/setup.py +++ b/azure-mgmt-nspkg/setup.py @@ -25,23 +25,18 @@ setup( name='azure-mgmt-nspkg', - version='2.0.0', + version='3.0.0', description='Microsoft Azure Resource Management Namespace Package [Internal]', long_description=open('README.rst', 'r').read(), license='MIT License', author='Microsoft Corporation', - author_email='ptvshelp@microsoft.com', + author_email='azpysdkhelp@microsoft.com', url='https://github.com/Azure/azure-sdk-for-python', classifiers=[ 'Development Status :: 5 - Production/Stable', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', 'License :: OSI Approved :: MIT License', ], zip_safe=False, @@ -49,7 +44,8 @@ 'azure', 'azure.mgmt', ], + python_requires='<3', install_requires=[ - 'azure-nspkg>=2.0.0', + 'azure-nspkg>=3.0.0', ] ) diff --git a/azure-nspkg/MANIFEST.in b/azure-nspkg/MANIFEST.in new file mode 100644 index 0000000000000..bb37a2723dae0 --- /dev/null +++ b/azure-nspkg/MANIFEST.in @@ -0,0 +1 @@ +include *.rst diff --git a/azure-nspkg/README.rst b/azure-nspkg/README.rst index 0600e296bfdfd..7dfb7c304ce09 100644 --- a/azure-nspkg/README.rst +++ b/azure-nspkg/README.rst @@ -5,6 +5,9 @@ This is the Microsoft Azure namespace package. This package is not intended to be installed directly by the end user. +Since version 3.0, this is Python 2 package only, Python 3.x SDKs will use `PEP420 ` as namespace package strategy. +This package will use `python_requires` to enforce Python 2 installation. This implies that you might see this package on Python 3 environment if you have pip < 9.0 or setuptools < 24.2.0. + It provides the necessary files for other packages to extend the azure namespace. If you are looking to install the Azure client libraries, see the diff --git a/azure-nspkg/azure/__init__.py b/azure-nspkg/azure/__init__.py index 5f282702bb03e..0260537a02bb9 100644 --- a/azure-nspkg/azure/__init__.py +++ b/azure-nspkg/azure/__init__.py @@ -1 +1 @@ - \ No newline at end of file +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-nspkg/setup.py b/azure-nspkg/setup.py index 67337a82f3266..3914cc06c2d78 100644 --- a/azure-nspkg/setup.py +++ b/azure-nspkg/setup.py @@ -25,25 +25,21 @@ setup( name='azure-nspkg', - version='2.0.0', + version='3.0.0', description='Microsoft Azure Namespace Package [Internal]', long_description=open('README.rst', 'r').read(), license='MIT License', author='Microsoft Corporation', - author_email='ptvshelp@microsoft.com', + author_email='azpysdkhelp@microsoft.com', url='https://github.com/Azure/azure-sdk-for-python', classifiers=[ 'Development Status :: 5 - Production/Stable', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', 'License :: OSI Approved :: MIT License', ], + python_requires='<3', zip_safe=False, packages=[ 'azure', From 5a7d6ad54361be9035aed17a89110facb924eaca Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Fri, 21 Sep 2018 17:05:33 -0700 Subject: [PATCH 02/23] Adapt dev_setup to new nspkg --- scripts/dev_setup.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/scripts/dev_setup.py b/scripts/dev_setup.py index 3bf6b74d720a7..0f3518a817eb8 100644 --- a/scripts/dev_setup.py +++ b/scripts/dev_setup.py @@ -30,13 +30,13 @@ def pip_command(command): nspkg_packages = [p for p in packages if "nspkg" in p] nspkg_packages.sort(key = lambda x: len([c for c in x if c == '-'])) -# Consider "azure-common" as a power nspkg : has to be installed after nspkg -nspkg_packages.append("azure-common") - # Manually push meta-packages at the end, in reverse dependency order meta_packages = ['azure-mgmt', 'azure'] content_packages = [p for p in packages if p not in nspkg_packages+meta_packages] +# Put azure-common in front +content_packages.remove("azure-common") +content_packages.insert(0, "azure-common") print('Running dev setup...') print('Root directory \'{}\'\n'.format(root_dir)) @@ -47,11 +47,15 @@ def pip_command(command): whl_list = ' '.join([os.path.join(privates_dir, f) for f in os.listdir(privates_dir)]) pip_command('install {}'.format(whl_list)) -# install packages -for package_list in [nspkg_packages, content_packages]: - for package_name in package_list: +# install nspkg only on py2 +if sys.version_info < (3, ): + for package_name in nspkg_packages: pip_command('install -e {}'.format(package_name)) +# install packages +for package_name in content_packages: + pip_command('install -e {}'.format(package_name)) + # Ensure that the site package's azure/__init__.py has the old style namespace # package declaration by installing the old namespace package pip_command('install --force-reinstall azure-mgmt-nspkg==1.0.0') From 786d44bc49bac282d9c0e99ab9f153b763964870 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Mon, 24 Sep 2018 13:08:11 -0700 Subject: [PATCH 03/23] New nspkg system --- azure-sdk-tools/packaging_tools/__init__.py | 21 ++++++-- azure-sdk-tools/packaging_tools/conf.py | 2 + .../packaging_tools/templates/MANIFEST.in | 1 - .../packaging_tools/templates/__init__.py | 2 +- .../templates/azure_bdist_wheel.py | 54 ------------------- .../packaging_tools/templates/setup.cfg | 1 - .../packaging_tools/templates/setup.py | 18 ++++--- 7 files changed, 30 insertions(+), 69 deletions(-) delete mode 100644 azure-sdk-tools/packaging_tools/templates/azure_bdist_wheel.py diff --git a/azure-sdk-tools/packaging_tools/__init__.py b/azure-sdk-tools/packaging_tools/__init__.py index 0b9d14c54f848..52f5daff580a9 100644 --- a/azure-sdk-tools/packaging_tools/__init__.py +++ b/azure-sdk-tools/packaging_tools/__init__.py @@ -1,3 +1,4 @@ +from contextlib import suppress import logging import os from pathlib import Path @@ -23,10 +24,20 @@ def build_config(config : Dict[str, Any]) -> Dict[str, str]: result["classifier"] = "Development Status :: 4 - Beta" # Manage the nspkg package_name = result["package_name"] - result["package_nspkg"] = package_name[:package_name.rindex('-')]+"-nspkg" + result["package_nspkg"] = result.pop( + "package_nspkg", + package_name[:package_name.rindex('-')]+"-nspkg" + ) # ARM? result['is_arm'] = result.pop("is_arm", True) + # Pre-compute some Jinja variable that are complicated to do inside the templates + package_parts = result["package_nspkg"][:-len('-nspkg')].split('-') + result['nspkg_names'] = [ + ".".join(package_parts[:i+1]) + for i in range(len(package_parts)) + ] + # Return result return result @@ -82,15 +93,13 @@ def build_packaging_by_package_name(package_name: str, output_folder: str, build # __init__.py is a weird one if template_name == "__init__.py": - split_package_name = package_name.split("-") + split_package_name = package_name.split("-")[:-1] for i in range(len(split_package_name)): init_path = Path(output_folder).joinpath( package_name, *split_package_name[:i+1], template_name ) - if init_path.exists(): - break with open(init_path, "w") as fd: fd.write(result) @@ -98,5 +107,9 @@ def build_packaging_by_package_name(package_name: str, output_folder: str, build with open(future_filepath, "w") as fd: fd.write(result) + # azure_bdist_wheel had been removed, but need to delete it manually + with suppress(FileNotFoundError): + (Path(output_folder) / package_name / "azure_bdist_wheel.py").unlink() + _LOGGER.info("Template done %s", package_name) \ No newline at end of file diff --git a/azure-sdk-tools/packaging_tools/conf.py b/azure-sdk-tools/packaging_tools/conf.py index 783de37c1f51a..2059ccfdddacc 100644 --- a/azure-sdk-tools/packaging_tools/conf.py +++ b/azure-sdk-tools/packaging_tools/conf.py @@ -12,6 +12,7 @@ # Default conf _CONFIG = { "package_name": "packagename", + "package_nspkg": "packagenspkg", "package_pprint_name": "MyService Management", "package_doc_id": "", "is_stable": False, @@ -35,6 +36,7 @@ def build_default_conf(folder: Path, package_name: str) -> None: _LOGGER.info("Build default conf for %s", package_name) conf = {_SECTION: _CONFIG.copy()} conf[_SECTION]["package_name"] = package_name + conf[_SECTION]["package_nspkg"] = package_name[:package_name.rindex('-')]+"-nspkg" with open(conf_path, "w") as fd: toml.dump(conf, fd) diff --git a/azure-sdk-tools/packaging_tools/templates/MANIFEST.in b/azure-sdk-tools/packaging_tools/templates/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-sdk-tools/packaging_tools/templates/MANIFEST.in +++ b/azure-sdk-tools/packaging_tools/templates/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-sdk-tools/packaging_tools/templates/__init__.py b/azure-sdk-tools/packaging_tools/templates/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-sdk-tools/packaging_tools/templates/__init__.py +++ b/azure-sdk-tools/packaging_tools/templates/__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-sdk-tools/packaging_tools/templates/azure_bdist_wheel.py b/azure-sdk-tools/packaging_tools/templates/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-sdk-tools/packaging_tools/templates/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-sdk-tools/packaging_tools/templates/setup.cfg b/azure-sdk-tools/packaging_tools/templates/setup.cfg index 57c8683c0b05f..3c6e79cf31da1 100644 --- a/azure-sdk-tools/packaging_tools/templates/setup.cfg +++ b/azure-sdk-tools/packaging_tools/templates/setup.cfg @@ -1,3 +1,2 @@ [bdist_wheel] universal=1 -azure-namespace-package={{package_nspkg}} \ No newline at end of file diff --git a/azure-sdk-tools/packaging_tools/templates/setup.py b/azure-sdk-tools/packaging_tools/templates/setup.py index eeb4bd3d35ce7..89be50d5dfb98 100644 --- a/azure-sdk-tools/packaging_tools/templates/setup.py +++ b/azure-sdk-tools/packaging_tools/templates/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 = "{{package_name}}" @@ -76,11 +70,19 @@ '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 + {%- for nspkg_name in nspkg_names %} + '{{ nspkg_name }}', + {%- endfor %} + ]), 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'": ['{{package_nspkg}}'], + } ) From 15489884eebb72d9a4d99327901abebc8f1b1a5e Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Mon, 24 Sep 2018 13:16:04 -0700 Subject: [PATCH 04/23] Auto-update parameter for toml --- azure-batch/sdk_packaging.toml | 2 ++ azure-common/sdk_packaging.toml | 2 ++ azure-sdk-tools/packaging_tools/__init__.py | 4 ++++ azure-sdk-tools/sdk_packaging.toml | 2 ++ azure-servicebus/sdk_packaging.toml | 2 ++ azure-servicemanagement-legacy/sdk_packaging.toml | 2 ++ 6 files changed, 14 insertions(+) create mode 100644 azure-batch/sdk_packaging.toml create mode 100644 azure-common/sdk_packaging.toml create mode 100644 azure-sdk-tools/sdk_packaging.toml create mode 100644 azure-servicebus/sdk_packaging.toml create mode 100644 azure-servicemanagement-legacy/sdk_packaging.toml diff --git a/azure-batch/sdk_packaging.toml b/azure-batch/sdk_packaging.toml new file mode 100644 index 0000000000000..e7687fdae93bc --- /dev/null +++ b/azure-batch/sdk_packaging.toml @@ -0,0 +1,2 @@ +[packaging] +auto_update = false \ No newline at end of file diff --git a/azure-common/sdk_packaging.toml b/azure-common/sdk_packaging.toml new file mode 100644 index 0000000000000..e7687fdae93bc --- /dev/null +++ b/azure-common/sdk_packaging.toml @@ -0,0 +1,2 @@ +[packaging] +auto_update = false \ No newline at end of file diff --git a/azure-sdk-tools/packaging_tools/__init__.py b/azure-sdk-tools/packaging_tools/__init__.py index 52f5daff580a9..d8ac6cfb6c124 100644 --- a/azure-sdk-tools/packaging_tools/__init__.py +++ b/azure-sdk-tools/packaging_tools/__init__.py @@ -73,6 +73,10 @@ def build_packaging_by_package_name(package_name: str, output_folder: str, build if not conf: raise ValueError("Create a {} file before calling this script".format(package_folder / CONF_NAME)) + if not conf.get("auto_update", True): + _LOGGER.info(f"Package {package_name} has no auto-packaging update enabled") + return + env = Environment( loader=PackageLoader('packaging_tools', 'templates'), keep_trailing_newline=True diff --git a/azure-sdk-tools/sdk_packaging.toml b/azure-sdk-tools/sdk_packaging.toml new file mode 100644 index 0000000000000..e7687fdae93bc --- /dev/null +++ b/azure-sdk-tools/sdk_packaging.toml @@ -0,0 +1,2 @@ +[packaging] +auto_update = false \ No newline at end of file diff --git a/azure-servicebus/sdk_packaging.toml b/azure-servicebus/sdk_packaging.toml new file mode 100644 index 0000000000000..e7687fdae93bc --- /dev/null +++ b/azure-servicebus/sdk_packaging.toml @@ -0,0 +1,2 @@ +[packaging] +auto_update = false \ No newline at end of file diff --git a/azure-servicemanagement-legacy/sdk_packaging.toml b/azure-servicemanagement-legacy/sdk_packaging.toml new file mode 100644 index 0000000000000..e7687fdae93bc --- /dev/null +++ b/azure-servicemanagement-legacy/sdk_packaging.toml @@ -0,0 +1,2 @@ +[packaging] +auto_update = false \ No newline at end of file From ffe8a271cdf0d8f0e3be35a3f3dcfd7b92df98ea Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Mon, 24 Sep 2018 14:03:18 -0700 Subject: [PATCH 05/23] Common with new packaging style --- azure-common/MANIFEST.in | 1 - azure-common/azure/__init__.py | 2 +- azure-common/azure/common/__init__.py | 3 +- azure-common/azure/common/_version.py | 7 ++++ azure-common/azure_bdist_wheel.py | 54 --------------------------- azure-common/sdk_packaging.toml | 8 +++- azure-common/setup.cfg | 1 - azure-common/setup.py | 33 ++++++++++------ 8 files changed, 38 insertions(+), 71 deletions(-) create mode 100644 azure-common/azure/common/_version.py delete mode 100644 azure-common/azure_bdist_wheel.py diff --git a/azure-common/MANIFEST.in b/azure-common/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-common/MANIFEST.in +++ b/azure-common/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-common/azure/__init__.py b/azure-common/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-common/azure/__init__.py +++ b/azure-common/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-common/azure/common/__init__.py b/azure-common/azure/common/__init__.py index 95d844e068295..6fbc7a2dcdbf5 100644 --- a/azure-common/azure/common/__init__.py +++ b/azure-common/azure/common/__init__.py @@ -3,9 +3,10 @@ # Licensed under the MIT License. See License.txt in the project root for # license information. #-------------------------------------------------------------------------- +from ._version import VERSION as _VERSION __author__ = 'Microsoft Corp. ' -__version__ = '1.1.15' +__version__ = _VERSION class AzureException(Exception): diff --git a/azure-common/azure/common/_version.py b/azure-common/azure/common/_version.py new file mode 100644 index 0000000000000..dcf0eeefa5bd3 --- /dev/null +++ b/azure-common/azure/common/_version.py @@ -0,0 +1,7 @@ +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +VERSION = "1.1.15" \ No newline at end of file diff --git a/azure-common/azure_bdist_wheel.py b/azure-common/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-common/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-common/sdk_packaging.toml b/azure-common/sdk_packaging.toml index e7687fdae93bc..c1ee830cf824e 100644 --- a/azure-common/sdk_packaging.toml +++ b/azure-common/sdk_packaging.toml @@ -1,2 +1,8 @@ [packaging] -auto_update = false \ No newline at end of file +auto_update = false +package_name = "azure-common" +package_nspkg = "azure-nspkg" +package_pprint_name = "MyService Management" +package_doc_id = "" +is_stable = false +is_arm = true diff --git a/azure-common/setup.cfg b/azure-common/setup.cfg index ccdace23b2d55..3c6e79cf31da1 100644 --- a/azure-common/setup.cfg +++ b/azure-common/setup.cfg @@ -1,3 +1,2 @@ [bdist_wheel] universal=1 -azure-namespace-package=azure-nspkg diff --git a/azure-common/setup.py b/azure-common/setup.py index e3e03a2794ae8..b073af1354d77 100644 --- a/azure-common/setup.py +++ b/azure-common/setup.py @@ -6,16 +6,18 @@ # license information. #-------------------------------------------------------------------------- +import re +import os.path from io import open from setuptools import setup -import sys -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-common" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace('-', '/') +# a-b-c => a.b.c +namespace_name = PACKAGE_NAME.replace('-', '.') # azure v0.x is not compatible with this package # azure v0.x used to have a __version__ attribute (newer versions don't) @@ -32,14 +34,22 @@ except ImportError: pass +# Version extraction inspired from 'requests' +with open(os.path.join(package_folder_path, '_version.py'), 'r') as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', + fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError('Cannot find version information') + with open('README.rst', encoding='utf-8') as f: readme = f.read() with open('HISTORY.rst', encoding='utf-8') as f: history = f.read() setup( - name='azure-common', - version='1.1.15', + name=PACKAGE_NAME, + version=version, description='Microsoft Azure Client Library for Python (Common)', long_description=readme + '\n\n' + history, license='MIT License', @@ -60,14 +70,13 @@ ], zip_safe=False, packages=[ - 'azure', 'azure.common', 'azure.profiles', ], extras_require={ + ":python_version<'3.0'": ['azure-nspkg'], 'autorest':[ 'msrestazure>=0.4.0,<2.0.0', ] - }, - cmdclass=cmdclass + } ) From 04c49c078f65dd10a920bd58ae0836387c0c8463 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Mon, 24 Sep 2018 14:03:37 -0700 Subject: [PATCH 06/23] Kill install old nspkg --- scripts/dev_setup.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/scripts/dev_setup.py b/scripts/dev_setup.py index 0f3518a817eb8..1604bf9afacdc 100644 --- a/scripts/dev_setup.py +++ b/scripts/dev_setup.py @@ -56,8 +56,4 @@ def pip_command(command): for package_name in content_packages: pip_command('install -e {}'.format(package_name)) -# Ensure that the site package's azure/__init__.py has the old style namespace -# package declaration by installing the old namespace package -pip_command('install --force-reinstall azure-mgmt-nspkg==1.0.0') -pip_command('install --force-reinstall azure-nspkg==1.0.0') print('Finished dev setup.') From 2c92fbd2ac15b50d375b7bce5d525f635a218df2 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Mon, 24 Sep 2018 14:45:16 -0700 Subject: [PATCH 07/23] Ignore packaging for bundle package --- azure-mgmt/sdk_packaging.toml | 2 ++ azure/sdk_packaging.toml | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 azure-mgmt/sdk_packaging.toml create mode 100644 azure/sdk_packaging.toml diff --git a/azure-mgmt/sdk_packaging.toml b/azure-mgmt/sdk_packaging.toml new file mode 100644 index 0000000000000..e7687fdae93bc --- /dev/null +++ b/azure-mgmt/sdk_packaging.toml @@ -0,0 +1,2 @@ +[packaging] +auto_update = false \ No newline at end of file diff --git a/azure/sdk_packaging.toml b/azure/sdk_packaging.toml new file mode 100644 index 0000000000000..e7687fdae93bc --- /dev/null +++ b/azure/sdk_packaging.toml @@ -0,0 +1,2 @@ +[packaging] +auto_update = false \ No newline at end of file From 1493f3823cf0884abec9b924bc82e5e4dc1cf70c Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Mon, 24 Sep 2018 14:48:02 -0700 Subject: [PATCH 08/23] Don't auto-update Cognitive Services nspkg --- azure-cognitiveservices-language-nspkg/sdk_packaging.toml | 2 ++ azure-cognitiveservices-nspkg/sdk_packaging.toml | 2 ++ azure-cognitiveservices-search-nspkg/sdk_packaging.toml | 2 ++ azure-cognitiveservices-vision-nspkg/sdk_packaging.toml | 2 ++ 4 files changed, 8 insertions(+) create mode 100644 azure-cognitiveservices-language-nspkg/sdk_packaging.toml create mode 100644 azure-cognitiveservices-nspkg/sdk_packaging.toml create mode 100644 azure-cognitiveservices-search-nspkg/sdk_packaging.toml create mode 100644 azure-cognitiveservices-vision-nspkg/sdk_packaging.toml diff --git a/azure-cognitiveservices-language-nspkg/sdk_packaging.toml b/azure-cognitiveservices-language-nspkg/sdk_packaging.toml new file mode 100644 index 0000000000000..e7687fdae93bc --- /dev/null +++ b/azure-cognitiveservices-language-nspkg/sdk_packaging.toml @@ -0,0 +1,2 @@ +[packaging] +auto_update = false \ No newline at end of file diff --git a/azure-cognitiveservices-nspkg/sdk_packaging.toml b/azure-cognitiveservices-nspkg/sdk_packaging.toml new file mode 100644 index 0000000000000..e7687fdae93bc --- /dev/null +++ b/azure-cognitiveservices-nspkg/sdk_packaging.toml @@ -0,0 +1,2 @@ +[packaging] +auto_update = false \ No newline at end of file diff --git a/azure-cognitiveservices-search-nspkg/sdk_packaging.toml b/azure-cognitiveservices-search-nspkg/sdk_packaging.toml new file mode 100644 index 0000000000000..e7687fdae93bc --- /dev/null +++ b/azure-cognitiveservices-search-nspkg/sdk_packaging.toml @@ -0,0 +1,2 @@ +[packaging] +auto_update = false \ No newline at end of file diff --git a/azure-cognitiveservices-vision-nspkg/sdk_packaging.toml b/azure-cognitiveservices-vision-nspkg/sdk_packaging.toml new file mode 100644 index 0000000000000..e7687fdae93bc --- /dev/null +++ b/azure-cognitiveservices-vision-nspkg/sdk_packaging.toml @@ -0,0 +1,2 @@ +[packaging] +auto_update = false \ No newline at end of file From 8180519f8556fa98d815d5d0ceeef7f05abff950 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Mon, 24 Sep 2018 15:04:32 -0700 Subject: [PATCH 09/23] azure-nspkg no auto-update --- azure-nspkg/sdk_packaging.toml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 azure-nspkg/sdk_packaging.toml diff --git a/azure-nspkg/sdk_packaging.toml b/azure-nspkg/sdk_packaging.toml new file mode 100644 index 0000000000000..e7687fdae93bc --- /dev/null +++ b/azure-nspkg/sdk_packaging.toml @@ -0,0 +1,2 @@ +[packaging] +auto_update = false \ No newline at end of file From f0e9cf2362fe3f146610cb59602a51965c816dee Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Mon, 24 Sep 2018 15:21:34 -0700 Subject: [PATCH 10/23] Cognitive Services new packaging --- .../MANIFEST.in | 1 - .../azure/__init__.py | 2 +- .../azure/cognitiveservices/__init__.py | 2 +- .../cognitiveservices/language/__init__.py | 2 +- .../azure_bdist_wheel.py | 54 ------------------- .../setup.cfg | 1 - .../setup.py | 18 ++++--- .../MANIFEST.in | 1 - .../README.rst | 8 +-- .../azure/__init__.py | 2 +- .../azure/cognitiveservices/__init__.py | 2 +- .../cognitiveservices/language/__init__.py | 2 +- .../azure_bdist_wheel.py | 54 ------------------- .../sdk_packaging.toml | 7 +++ .../setup.cfg | 1 - .../setup.py | 23 ++++---- .../MANIFEST.in | 1 - .../README.rst | 16 +++--- .../azure/__init__.py | 2 +- .../azure/cognitiveservices/__init__.py | 2 +- .../cognitiveservices/language/__init__.py | 2 +- .../azure_bdist_wheel.py | 54 ------------------- .../sdk_packaging.toml | 7 +++ .../setup.cfg | 1 - .../setup.py | 21 ++++---- .../MANIFEST.in | 1 - .../azure/__init__.py | 2 +- .../azure/cognitiveservices/__init__.py | 2 +- .../cognitiveservices/search/__init__.py | 2 +- .../azure_bdist_wheel.py | 54 ------------------- .../setup.cfg | 1 - .../setup.py | 20 +++---- .../MANIFEST.in | 1 - .../README.rst | 16 ++---- .../azure/__init__.py | 2 +- .../azure/cognitiveservices/__init__.py | 2 +- .../cognitiveservices/search/__init__.py | 2 +- .../azure_bdist_wheel.py | 54 ------------------- .../sdk_packaging.toml | 7 +++ .../setup.cfg | 1 - .../setup.py | 23 ++++---- .../MANIFEST.in | 1 - .../README.rst | 6 +-- .../azure/__init__.py | 2 +- .../azure/cognitiveservices/__init__.py | 2 +- .../cognitiveservices/search/__init__.py | 2 +- .../azure_bdist_wheel.py | 54 ------------------- .../sdk_packaging.toml | 7 +++ .../setup.cfg | 1 - .../setup.py | 23 ++++---- .../MANIFEST.in | 1 - .../README.rst | 8 +-- .../azure/__init__.py | 2 +- .../azure/cognitiveservices/__init__.py | 2 +- .../cognitiveservices/search/__init__.py | 2 +- .../azure_bdist_wheel.py | 54 ------------------- .../sdk_packaging.toml | 7 +++ .../setup.cfg | 1 - .../setup.py | 23 ++++---- .../MANIFEST.in | 1 - .../README.rst | 8 +-- .../azure/__init__.py | 2 +- .../azure/cognitiveservices/__init__.py | 2 +- .../cognitiveservices/search/__init__.py | 2 +- .../azure_bdist_wheel.py | 54 ------------------- .../sdk_packaging.toml | 7 +++ .../setup.cfg | 1 - .../setup.py | 23 ++++---- .../MANIFEST.in | 1 - .../README.rst | 6 +-- .../azure/__init__.py | 2 +- .../azure/cognitiveservices/__init__.py | 2 +- .../cognitiveservices/search/__init__.py | 2 +- .../azure_bdist_wheel.py | 54 ------------------- .../sdk_packaging.toml | 7 +++ .../setup.cfg | 1 - .../setup.py | 23 ++++---- .../MANIFEST.in | 1 - .../README.rst | 8 +-- .../azure/__init__.py | 2 +- .../azure/cognitiveservices/__init__.py | 2 +- .../cognitiveservices/search/__init__.py | 2 +- .../azure_bdist_wheel.py | 54 ------------------- .../sdk_packaging.toml | 7 +++ .../setup.cfg | 1 - .../setup.py | 23 ++++---- .../MANIFEST.in | 1 - .../README.rst | 8 +-- .../azure/__init__.py | 2 +- .../azure/cognitiveservices/__init__.py | 2 +- .../cognitiveservices/search/__init__.py | 2 +- .../azure_bdist_wheel.py | 54 ------------------- .../sdk_packaging.toml | 7 +++ .../setup.cfg | 1 - .../setup.py | 23 ++++---- .../MANIFEST.in | 1 - .../README.rst | 2 +- .../azure/__init__.py | 2 +- .../azure/cognitiveservices/__init__.py | 2 +- .../cognitiveservices/vision/__init__.py | 2 +- .../azure_bdist_wheel.py | 54 ------------------- .../setup.cfg | 1 - .../setup.py | 21 ++++---- .../MANIFEST.in | 1 - .../README.rst | 16 +++--- .../azure/__init__.py | 2 +- .../azure/cognitiveservices/__init__.py | 2 +- .../cognitiveservices/vision/__init__.py | 2 +- .../azure_bdist_wheel.py | 54 ------------------- .../sdk_packaging.toml | 7 +++ .../setup.cfg | 1 - .../setup.py | 22 ++++---- .../MANIFEST.in | 1 - .../README.rst | 2 +- .../azure/__init__.py | 2 +- .../azure/cognitiveservices/__init__.py | 2 +- .../cognitiveservices/vision/__init__.py | 2 +- .../azure_bdist_wheel.py | 54 ------------------- .../setup.cfg | 1 - .../setup.py | 20 +++---- .../MANIFEST.in | 1 - .../README.rst | 16 +++--- .../azure/__init__.py | 2 +- .../azure/cognitiveservices/__init__.py | 2 +- .../cognitiveservices/vision/__init__.py | 2 +- .../azure_bdist_wheel.py | 54 ------------------- .../sdk_packaging.toml | 7 +++ azure-cognitiveservices-vision-face/setup.cfg | 1 - azure-cognitiveservices-vision-face/setup.py | 22 ++++---- 129 files changed, 366 insertions(+), 1089 deletions(-) delete mode 100644 azure-cognitiveservices-language-luis/azure_bdist_wheel.py delete mode 100644 azure-cognitiveservices-language-spellcheck/azure_bdist_wheel.py create mode 100644 azure-cognitiveservices-language-spellcheck/sdk_packaging.toml delete mode 100644 azure-cognitiveservices-language-textanalytics/azure_bdist_wheel.py create mode 100644 azure-cognitiveservices-language-textanalytics/sdk_packaging.toml delete mode 100644 azure-cognitiveservices-search-autosuggest/azure_bdist_wheel.py delete mode 100644 azure-cognitiveservices-search-customsearch/azure_bdist_wheel.py create mode 100644 azure-cognitiveservices-search-customsearch/sdk_packaging.toml delete mode 100644 azure-cognitiveservices-search-entitysearch/azure_bdist_wheel.py create mode 100644 azure-cognitiveservices-search-entitysearch/sdk_packaging.toml delete mode 100644 azure-cognitiveservices-search-imagesearch/azure_bdist_wheel.py create mode 100644 azure-cognitiveservices-search-imagesearch/sdk_packaging.toml delete mode 100644 azure-cognitiveservices-search-newssearch/azure_bdist_wheel.py create mode 100644 azure-cognitiveservices-search-newssearch/sdk_packaging.toml delete mode 100644 azure-cognitiveservices-search-videosearch/azure_bdist_wheel.py create mode 100644 azure-cognitiveservices-search-videosearch/sdk_packaging.toml delete mode 100644 azure-cognitiveservices-search-visualsearch/azure_bdist_wheel.py create mode 100644 azure-cognitiveservices-search-visualsearch/sdk_packaging.toml delete mode 100644 azure-cognitiveservices-search-websearch/azure_bdist_wheel.py create mode 100644 azure-cognitiveservices-search-websearch/sdk_packaging.toml delete mode 100644 azure-cognitiveservices-vision-computervision/azure_bdist_wheel.py delete mode 100644 azure-cognitiveservices-vision-contentmoderator/azure_bdist_wheel.py create mode 100644 azure-cognitiveservices-vision-contentmoderator/sdk_packaging.toml delete mode 100644 azure-cognitiveservices-vision-customvision/azure_bdist_wheel.py delete mode 100644 azure-cognitiveservices-vision-face/azure_bdist_wheel.py create mode 100644 azure-cognitiveservices-vision-face/sdk_packaging.toml diff --git a/azure-cognitiveservices-language-luis/MANIFEST.in b/azure-cognitiveservices-language-luis/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-cognitiveservices-language-luis/MANIFEST.in +++ b/azure-cognitiveservices-language-luis/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-cognitiveservices-language-luis/azure/__init__.py b/azure-cognitiveservices-language-luis/azure/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-cognitiveservices-language-luis/azure/__init__.py +++ b/azure-cognitiveservices-language-luis/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-cognitiveservices-language-luis/azure/cognitiveservices/__init__.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/__init__.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/__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-cognitiveservices-language-luis/azure/cognitiveservices/language/__init__.py b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/__init__.py +++ b/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/__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-cognitiveservices-language-luis/azure_bdist_wheel.py b/azure-cognitiveservices-language-luis/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-cognitiveservices-language-luis/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-cognitiveservices-language-luis/setup.cfg b/azure-cognitiveservices-language-luis/setup.cfg index 2d986195ea2fe..3c6e79cf31da1 100644 --- a/azure-cognitiveservices-language-luis/setup.cfg +++ b/azure-cognitiveservices-language-luis/setup.cfg @@ -1,3 +1,2 @@ [bdist_wheel] universal=1 -azure-namespace-package=azure-cognitiveservices-language-nspkg \ No newline at end of file diff --git a/azure-cognitiveservices-language-luis/setup.py b/azure-cognitiveservices-language-luis/setup.py index 6b7cacb95092c..c47a8246eabfe 100644 --- a/azure-cognitiveservices-language-luis/setup.py +++ b/azure-cognitiveservices-language-luis/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-cognitiveservices-language-luis" @@ -76,10 +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.cognitiveservices', + 'azure.cognitiveservices.language', + ]), install_requires=[ 'msrest>=0.5.0', 'azure-common~=1.1', ], - cmdclass=cmdclass + extras_require={ + ":python_version<'3.0'": ['azure-cognitiveservices-language-nspkg'], + } ) diff --git a/azure-cognitiveservices-language-spellcheck/MANIFEST.in b/azure-cognitiveservices-language-spellcheck/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-cognitiveservices-language-spellcheck/MANIFEST.in +++ b/azure-cognitiveservices-language-spellcheck/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-cognitiveservices-language-spellcheck/README.rst b/azure-cognitiveservices-language-spellcheck/README.rst index 2c240139e4b49..dceb5241f7bff 100644 --- a/azure-cognitiveservices-language-spellcheck/README.rst +++ b/azure-cognitiveservices-language-spellcheck/README.rst @@ -1,9 +1,9 @@ Microsoft Azure SDK for Python ============================== -This is the Microsoft Azure Cognitive Services Bing Spell Check Client Library. +This is the Microsoft Azure Cognitive Services Spellcheck Client Library. -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For a more complete set of Azure libraries, see the `azure `__ bundle package. @@ -30,9 +30,9 @@ If you see azure==0.11.0 (or any version below 1.0), uninstall it first: Usage ===== -For code examples, see `Spell Check +For code examples, see `Cognitive Services Spellcheck `__ -on readthedocs.org. +on docs.microsoft.com. Provide Feedback diff --git a/azure-cognitiveservices-language-spellcheck/azure/__init__.py b/azure-cognitiveservices-language-spellcheck/azure/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-cognitiveservices-language-spellcheck/azure/__init__.py +++ b/azure-cognitiveservices-language-spellcheck/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-cognitiveservices-language-spellcheck/azure/cognitiveservices/__init__.py b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/__init__.py +++ b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/__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-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/__init__.py b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/__init__.py +++ b/azure-cognitiveservices-language-spellcheck/azure/cognitiveservices/language/__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-cognitiveservices-language-spellcheck/azure_bdist_wheel.py b/azure-cognitiveservices-language-spellcheck/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-cognitiveservices-language-spellcheck/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-cognitiveservices-language-spellcheck/sdk_packaging.toml b/azure-cognitiveservices-language-spellcheck/sdk_packaging.toml new file mode 100644 index 0000000000000..6a638b7c31ef4 --- /dev/null +++ b/azure-cognitiveservices-language-spellcheck/sdk_packaging.toml @@ -0,0 +1,7 @@ +[packaging] +package_name = "azure-cognitiveservices-language-spellcheck" +package_nspkg = "azure-cognitiveservices-language-nspkg" +package_pprint_name = "Cognitive Services Spellcheck" +package_doc_id = "cognitive-services" +is_stable = true +is_arm = false diff --git a/azure-cognitiveservices-language-spellcheck/setup.cfg b/azure-cognitiveservices-language-spellcheck/setup.cfg index 2d986195ea2fe..3c6e79cf31da1 100644 --- a/azure-cognitiveservices-language-spellcheck/setup.cfg +++ b/azure-cognitiveservices-language-spellcheck/setup.cfg @@ -1,3 +1,2 @@ [bdist_wheel] universal=1 -azure-namespace-package=azure-cognitiveservices-language-nspkg \ No newline at end of file diff --git a/azure-cognitiveservices-language-spellcheck/setup.py b/azure-cognitiveservices-language-spellcheck/setup.py index 3b538a6d4c99f..013c2c21f08e6 100644 --- a/azure-cognitiveservices-language-spellcheck/setup.py +++ b/azure-cognitiveservices-language-spellcheck/setup.py @@ -10,16 +10,10 @@ 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-cognitiveservices-language-spellcheck" -PACKAGE_PPRINT_NAME = "Cognitive Services Bing Spell Check" +PACKAGE_PPRINT_NAME = "Cognitive Services Spellcheck" # a-b-c => a/b/c package_folder_path = PACKAGE_NAME.replace('-', '/') @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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.cognitiveservices', + 'azure.cognitiveservices.language', + ]), install_requires=[ - 'msrest>=0.4.28,<2.0.0', + 'msrest>=0.5.0', 'azure-common~=1.1', ], - cmdclass=cmdclass + extras_require={ + ":python_version<'3.0'": ['azure-cognitiveservices-language-nspkg'], + } ) diff --git a/azure-cognitiveservices-language-textanalytics/MANIFEST.in b/azure-cognitiveservices-language-textanalytics/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-cognitiveservices-language-textanalytics/MANIFEST.in +++ b/azure-cognitiveservices-language-textanalytics/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-cognitiveservices-language-textanalytics/README.rst b/azure-cognitiveservices-language-textanalytics/README.rst index c26973cad3a0e..1f148fb859e88 100644 --- a/azure-cognitiveservices-language-textanalytics/README.rst +++ b/azure-cognitiveservices-language-textanalytics/README.rst @@ -3,13 +3,7 @@ Microsoft Azure SDK for Python This is the Microsoft Azure Cognitive Services Text Analytics Client Library. -Azure Resource Manager (ARM) is the next generation of management APIs that -replace the old Azure Service Management (ASM). - -This package has been tested with Python 2.7, 3.3, 3.4, 3.5 and 3.6. - -For the older Azure Service Management (ASM) libraries, see -`azure-servicemanagement-legacy `__ library. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For a more complete set of Azure libraries, see the `azure `__ bundle package. @@ -33,6 +27,14 @@ If you see azure==0.11.0 (or any version below 1.0), uninstall it first: pip uninstall azure +Usage +===== + +For code examples, see `Cognitive Services Text Analytics +`__ +on docs.microsoft.com. + + Provide Feedback ================ diff --git a/azure-cognitiveservices-language-textanalytics/azure/__init__.py b/azure-cognitiveservices-language-textanalytics/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-cognitiveservices-language-textanalytics/azure/__init__.py +++ b/azure-cognitiveservices-language-textanalytics/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-cognitiveservices-language-textanalytics/azure/cognitiveservices/__init__.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/__init__.py +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/__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-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/__init__.py b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/__init__.py +++ b/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/__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-cognitiveservices-language-textanalytics/azure_bdist_wheel.py b/azure-cognitiveservices-language-textanalytics/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-cognitiveservices-language-textanalytics/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-cognitiveservices-language-textanalytics/sdk_packaging.toml b/azure-cognitiveservices-language-textanalytics/sdk_packaging.toml new file mode 100644 index 0000000000000..8e4a121a7f7cb --- /dev/null +++ b/azure-cognitiveservices-language-textanalytics/sdk_packaging.toml @@ -0,0 +1,7 @@ +[packaging] +package_name = "azure-cognitiveservices-language-textanalytics" +package_nspkg = "azure-cognitiveservices-language-nspkg" +package_pprint_name = "Cognitive Services Text Analytics" +package_doc_id = "cognitive-services" +is_stable = false +is_arm = false diff --git a/azure-cognitiveservices-language-textanalytics/setup.cfg b/azure-cognitiveservices-language-textanalytics/setup.cfg index 2d986195ea2fe..3c6e79cf31da1 100644 --- a/azure-cognitiveservices-language-textanalytics/setup.cfg +++ b/azure-cognitiveservices-language-textanalytics/setup.cfg @@ -1,3 +1,2 @@ [bdist_wheel] universal=1 -azure-namespace-package=azure-cognitiveservices-language-nspkg \ No newline at end of file diff --git a/azure-cognitiveservices-language-textanalytics/setup.py b/azure-cognitiveservices-language-textanalytics/setup.py index d7e918673dfa4..f022d8306378d 100644 --- a/azure-cognitiveservices-language-textanalytics/setup.py +++ b/azure-cognitiveservices-language-textanalytics/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-cognitiveservices-language-textanalytics" @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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.cognitiveservices', + 'azure.cognitiveservices.language', + ]), install_requires=[ - 'msrest>=0.4.24,<2.0.0', + 'msrest>=0.5.0', 'azure-common~=1.1', ], - cmdclass=cmdclass + extras_require={ + ":python_version<'3.0'": ['azure-cognitiveservices-language-nspkg'], + } ) diff --git a/azure-cognitiveservices-search-autosuggest/MANIFEST.in b/azure-cognitiveservices-search-autosuggest/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-cognitiveservices-search-autosuggest/MANIFEST.in +++ b/azure-cognitiveservices-search-autosuggest/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-cognitiveservices-search-autosuggest/azure/__init__.py b/azure-cognitiveservices-search-autosuggest/azure/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-cognitiveservices-search-autosuggest/azure/__init__.py +++ b/azure-cognitiveservices-search-autosuggest/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-cognitiveservices-search-autosuggest/azure/cognitiveservices/__init__.py b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/__init__.py +++ b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/__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-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/__init__.py b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/__init__.py +++ b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/__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-cognitiveservices-search-autosuggest/azure_bdist_wheel.py b/azure-cognitiveservices-search-autosuggest/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-cognitiveservices-search-autosuggest/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-cognitiveservices-search-autosuggest/setup.cfg b/azure-cognitiveservices-search-autosuggest/setup.cfg index 4659976f991cf..3c6e79cf31da1 100644 --- a/azure-cognitiveservices-search-autosuggest/setup.cfg +++ b/azure-cognitiveservices-search-autosuggest/setup.cfg @@ -1,3 +1,2 @@ [bdist_wheel] universal=1 -azure-namespace-package=azure-cognitiveservices-search-nspkg \ No newline at end of file diff --git a/azure-cognitiveservices-search-autosuggest/setup.py b/azure-cognitiveservices-search-autosuggest/setup.py index 1b656cc93ee82..c8d0f0923eeb8 100644 --- a/azure-cognitiveservices-search-autosuggest/setup.py +++ b/azure-cognitiveservices-search-autosuggest/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-cognitiveservices-search-autosuggest" @@ -76,10 +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.cognitiveservices', + 'azure.cognitiveservices.search', + ]), install_requires=[ - 'msrest>=0.4.28,<2.0.0', + 'msrest>=0.5.0', 'azure-common~=1.1', ], - cmdclass=cmdclass + extras_require={ + ":python_version<'3.0'": ['azure-cognitiveservices-search-nspkg'], + } ) diff --git a/azure-cognitiveservices-search-customsearch/MANIFEST.in b/azure-cognitiveservices-search-customsearch/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-cognitiveservices-search-customsearch/MANIFEST.in +++ b/azure-cognitiveservices-search-customsearch/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-cognitiveservices-search-customsearch/README.rst b/azure-cognitiveservices-search-customsearch/README.rst index a2a36aef21d2c..aba29e496e9f5 100644 --- a/azure-cognitiveservices-search-customsearch/README.rst +++ b/azure-cognitiveservices-search-customsearch/README.rst @@ -1,15 +1,9 @@ Microsoft Azure SDK for Python ============================== -This is the Microsoft Azure CustomSearch Client Library. +This is the Microsoft Azure Cognitive Services Custom Search Client Library. -Azure Resource Manager (ARM) is the next generation of management APIs that -replace the old Azure Service Management (ASM). - -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. - -For the older Azure Service Management (ASM) libraries, see -`azure-servicemanagement-legacy `__ library. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For a more complete set of Azure libraries, see the `azure `__ bundle package. @@ -36,9 +30,9 @@ If you see azure==0.11.0 (or any version below 1.0), uninstall it first: Usage ===== -For code examples, see `CustomSearch -`__ -on readthedocs.org. +For code examples, see `Cognitive Services Custom Search +`__ +on docs.microsoft.com. Provide Feedback diff --git a/azure-cognitiveservices-search-customsearch/azure/__init__.py b/azure-cognitiveservices-search-customsearch/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-cognitiveservices-search-customsearch/azure/__init__.py +++ b/azure-cognitiveservices-search-customsearch/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-cognitiveservices-search-customsearch/azure/cognitiveservices/__init__.py b/azure-cognitiveservices-search-customsearch/azure/cognitiveservices/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-cognitiveservices-search-customsearch/azure/cognitiveservices/__init__.py +++ b/azure-cognitiveservices-search-customsearch/azure/cognitiveservices/__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-cognitiveservices-search-customsearch/azure/cognitiveservices/search/__init__.py b/azure-cognitiveservices-search-customsearch/azure/cognitiveservices/search/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-cognitiveservices-search-customsearch/azure/cognitiveservices/search/__init__.py +++ b/azure-cognitiveservices-search-customsearch/azure/cognitiveservices/search/__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-cognitiveservices-search-customsearch/azure_bdist_wheel.py b/azure-cognitiveservices-search-customsearch/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-cognitiveservices-search-customsearch/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-cognitiveservices-search-customsearch/sdk_packaging.toml b/azure-cognitiveservices-search-customsearch/sdk_packaging.toml new file mode 100644 index 0000000000000..d97eacc3aaabf --- /dev/null +++ b/azure-cognitiveservices-search-customsearch/sdk_packaging.toml @@ -0,0 +1,7 @@ +[packaging] +package_name = "azure-cognitiveservices-search-customsearch" +package_nspkg = "azure-cognitiveservices-search-nspkg" +package_pprint_name = "Cognitive Services Custom Search" +package_doc_id = "cognitive-services" +is_stable = false +is_arm = false diff --git a/azure-cognitiveservices-search-customsearch/setup.cfg b/azure-cognitiveservices-search-customsearch/setup.cfg index 4659976f991cf..3c6e79cf31da1 100644 --- a/azure-cognitiveservices-search-customsearch/setup.cfg +++ b/azure-cognitiveservices-search-customsearch/setup.cfg @@ -1,3 +1,2 @@ [bdist_wheel] universal=1 -azure-namespace-package=azure-cognitiveservices-search-nspkg \ No newline at end of file diff --git a/azure-cognitiveservices-search-customsearch/setup.py b/azure-cognitiveservices-search-customsearch/setup.py index d4cb316c821de..44c8e77c68b74 100644 --- a/azure-cognitiveservices-search-customsearch/setup.py +++ b/azure-cognitiveservices-search-customsearch/setup.py @@ -10,16 +10,10 @@ 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-cognitiveservices-search-customsearch" -PACKAGE_PPRINT_NAME = "CustomSearch" +PACKAGE_PPRINT_NAME = "Cognitive Services Custom Search" # a-b-c => a/b/c package_folder_path = PACKAGE_NAME.replace('-', '/') @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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.cognitiveservices', + 'azure.cognitiveservices.search', + ]), install_requires=[ - 'msrest>=0.4.24,<2.0.0', + 'msrest>=0.5.0', 'azure-common~=1.1', ], - cmdclass=cmdclass + extras_require={ + ":python_version<'3.0'": ['azure-cognitiveservices-search-nspkg'], + } ) diff --git a/azure-cognitiveservices-search-entitysearch/MANIFEST.in b/azure-cognitiveservices-search-entitysearch/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-cognitiveservices-search-entitysearch/MANIFEST.in +++ b/azure-cognitiveservices-search-entitysearch/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-cognitiveservices-search-entitysearch/README.rst b/azure-cognitiveservices-search-entitysearch/README.rst index cb7449a6e773a..4e7a1c9a0a0d3 100644 --- a/azure-cognitiveservices-search-entitysearch/README.rst +++ b/azure-cognitiveservices-search-entitysearch/README.rst @@ -3,7 +3,7 @@ Microsoft Azure SDK for Python This is the Microsoft Azure Cognitive Services Entity Search Client Library. -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For a more complete set of Azure libraries, see the `azure `__ bundle package. @@ -30,9 +30,9 @@ If you see azure==0.11.0 (or any version below 1.0), uninstall it first: Usage ===== -For code examples, see `Entity Search +For code examples, see `Cognitive Services Entity Search `__ -on readthedocs.org. +on docs.microsoft.com. Provide Feedback diff --git a/azure-cognitiveservices-search-entitysearch/azure/__init__.py b/azure-cognitiveservices-search-entitysearch/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/__init__.py +++ b/azure-cognitiveservices-search-entitysearch/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-cognitiveservices-search-entitysearch/azure/cognitiveservices/__init__.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/__init__.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/__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-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/__init__.py b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/__init__.py +++ b/azure-cognitiveservices-search-entitysearch/azure/cognitiveservices/search/__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-cognitiveservices-search-entitysearch/azure_bdist_wheel.py b/azure-cognitiveservices-search-entitysearch/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-cognitiveservices-search-entitysearch/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-cognitiveservices-search-entitysearch/sdk_packaging.toml b/azure-cognitiveservices-search-entitysearch/sdk_packaging.toml new file mode 100644 index 0000000000000..8046fb73aa1a7 --- /dev/null +++ b/azure-cognitiveservices-search-entitysearch/sdk_packaging.toml @@ -0,0 +1,7 @@ +[packaging] +package_name = "azure-cognitiveservices-search-entitysearch" +package_nspkg = "azure-cognitiveservices-search-nspkg" +package_pprint_name = "Cognitive Services Entity Search" +package_doc_id = "cognitive-services" +is_stable = true +is_arm = false diff --git a/azure-cognitiveservices-search-entitysearch/setup.cfg b/azure-cognitiveservices-search-entitysearch/setup.cfg index 4659976f991cf..3c6e79cf31da1 100644 --- a/azure-cognitiveservices-search-entitysearch/setup.cfg +++ b/azure-cognitiveservices-search-entitysearch/setup.cfg @@ -1,3 +1,2 @@ [bdist_wheel] universal=1 -azure-namespace-package=azure-cognitiveservices-search-nspkg \ No newline at end of file diff --git a/azure-cognitiveservices-search-entitysearch/setup.py b/azure-cognitiveservices-search-entitysearch/setup.py index 04f29eff4382a..00b00ddd7b05f 100644 --- a/azure-cognitiveservices-search-entitysearch/setup.py +++ b/azure-cognitiveservices-search-entitysearch/setup.py @@ -10,16 +10,10 @@ 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-cognitiveservices-search-entitysearch" -PACKAGE_PPRINT_NAME = "Cognitive Services EntitySearch" +PACKAGE_PPRINT_NAME = "Cognitive Services Entity Search" # a-b-c => a/b/c package_folder_path = PACKAGE_NAME.replace('-', '/') @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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.cognitiveservices', + 'azure.cognitiveservices.search', + ]), install_requires=[ - 'msrest>=0.4.28,<2.0.0', + 'msrest>=0.5.0', 'azure-common~=1.1', ], - cmdclass=cmdclass + extras_require={ + ":python_version<'3.0'": ['azure-cognitiveservices-search-nspkg'], + } ) diff --git a/azure-cognitiveservices-search-imagesearch/MANIFEST.in b/azure-cognitiveservices-search-imagesearch/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-cognitiveservices-search-imagesearch/MANIFEST.in +++ b/azure-cognitiveservices-search-imagesearch/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-cognitiveservices-search-imagesearch/README.rst b/azure-cognitiveservices-search-imagesearch/README.rst index ca389b6dff297..26360c01f7805 100644 --- a/azure-cognitiveservices-search-imagesearch/README.rst +++ b/azure-cognitiveservices-search-imagesearch/README.rst @@ -1,9 +1,9 @@ Microsoft Azure SDK for Python ============================== -This is the Microsoft Azure ImageSearch Client Library. +This is the Microsoft Azure Cognitive Services Image Search Client Library. -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For a more complete set of Azure libraries, see the `azure `__ bundle package. @@ -30,9 +30,9 @@ If you see azure==0.11.0 (or any version below 1.0), uninstall it first: Usage ===== -For code examples, see `Image Search +For code examples, see `Cognitive Services Image Search `__ -on readthedocs.org. +on docs.microsoft.com. Provide Feedback diff --git a/azure-cognitiveservices-search-imagesearch/azure/__init__.py b/azure-cognitiveservices-search-imagesearch/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/__init__.py +++ b/azure-cognitiveservices-search-imagesearch/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-cognitiveservices-search-imagesearch/azure/cognitiveservices/__init__.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/__init__.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/__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-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/__init__.py b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/__init__.py +++ b/azure-cognitiveservices-search-imagesearch/azure/cognitiveservices/search/__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-cognitiveservices-search-imagesearch/azure_bdist_wheel.py b/azure-cognitiveservices-search-imagesearch/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-cognitiveservices-search-imagesearch/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-cognitiveservices-search-imagesearch/sdk_packaging.toml b/azure-cognitiveservices-search-imagesearch/sdk_packaging.toml new file mode 100644 index 0000000000000..4d1c39e6380b4 --- /dev/null +++ b/azure-cognitiveservices-search-imagesearch/sdk_packaging.toml @@ -0,0 +1,7 @@ +[packaging] +package_name = "azure-cognitiveservices-search-imagesearch" +package_nspkg = "azure-cognitiveservices-search-nspkg" +package_pprint_name = "Cognitive Services Image Search" +package_doc_id = "cognitive-services" +is_stable = true +is_arm = false diff --git a/azure-cognitiveservices-search-imagesearch/setup.cfg b/azure-cognitiveservices-search-imagesearch/setup.cfg index 4659976f991cf..3c6e79cf31da1 100644 --- a/azure-cognitiveservices-search-imagesearch/setup.cfg +++ b/azure-cognitiveservices-search-imagesearch/setup.cfg @@ -1,3 +1,2 @@ [bdist_wheel] universal=1 -azure-namespace-package=azure-cognitiveservices-search-nspkg \ No newline at end of file diff --git a/azure-cognitiveservices-search-imagesearch/setup.py b/azure-cognitiveservices-search-imagesearch/setup.py index 7503e47dbd956..a2bd4197c30b6 100644 --- a/azure-cognitiveservices-search-imagesearch/setup.py +++ b/azure-cognitiveservices-search-imagesearch/setup.py @@ -10,16 +10,10 @@ 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-cognitiveservices-search-imagesearch" -PACKAGE_PPRINT_NAME = "ImageSearch" +PACKAGE_PPRINT_NAME = "Cognitive Services Image Search" # a-b-c => a/b/c package_folder_path = PACKAGE_NAME.replace('-', '/') @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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.cognitiveservices', + 'azure.cognitiveservices.search', + ]), install_requires=[ - 'msrest>=0.4.28,<2.0.0', + 'msrest>=0.5.0', 'azure-common~=1.1', ], - cmdclass=cmdclass + extras_require={ + ":python_version<'3.0'": ['azure-cognitiveservices-search-nspkg'], + } ) diff --git a/azure-cognitiveservices-search-newssearch/MANIFEST.in b/azure-cognitiveservices-search-newssearch/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-cognitiveservices-search-newssearch/MANIFEST.in +++ b/azure-cognitiveservices-search-newssearch/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-cognitiveservices-search-newssearch/README.rst b/azure-cognitiveservices-search-newssearch/README.rst index 81f27501afe5d..3231e0d524961 100644 --- a/azure-cognitiveservices-search-newssearch/README.rst +++ b/azure-cognitiveservices-search-newssearch/README.rst @@ -1,9 +1,9 @@ Microsoft Azure SDK for Python ============================== -This is the Microsoft Azure NewsSearch Client Library. +This is the Microsoft Azure Cognitive Services News Search Client Library. -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For a more complete set of Azure libraries, see the `azure `__ bundle package. @@ -30,9 +30,9 @@ If you see azure==0.11.0 (or any version below 1.0), uninstall it first: Usage ===== -For code examples, see `News Search +For code examples, see `Cognitive Services News Search `__ -on readthedocs.org. +on docs.microsoft.com. Provide Feedback diff --git a/azure-cognitiveservices-search-newssearch/azure/__init__.py b/azure-cognitiveservices-search-newssearch/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-cognitiveservices-search-newssearch/azure/__init__.py +++ b/azure-cognitiveservices-search-newssearch/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-cognitiveservices-search-newssearch/azure/cognitiveservices/__init__.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/__init__.py +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/__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-cognitiveservices-search-newssearch/azure/cognitiveservices/search/__init__.py b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/__init__.py +++ b/azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/__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-cognitiveservices-search-newssearch/azure_bdist_wheel.py b/azure-cognitiveservices-search-newssearch/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-cognitiveservices-search-newssearch/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-cognitiveservices-search-newssearch/sdk_packaging.toml b/azure-cognitiveservices-search-newssearch/sdk_packaging.toml new file mode 100644 index 0000000000000..7266bf210330d --- /dev/null +++ b/azure-cognitiveservices-search-newssearch/sdk_packaging.toml @@ -0,0 +1,7 @@ +[packaging] +package_name = "azure-cognitiveservices-search-newssearch" +package_nspkg = "azure-cognitiveservices-search-nspkg" +package_pprint_name = "Cognitive Services News Search" +package_doc_id = "cognitive-services" +is_stable = true +is_arm = false diff --git a/azure-cognitiveservices-search-newssearch/setup.cfg b/azure-cognitiveservices-search-newssearch/setup.cfg index 4659976f991cf..3c6e79cf31da1 100644 --- a/azure-cognitiveservices-search-newssearch/setup.cfg +++ b/azure-cognitiveservices-search-newssearch/setup.cfg @@ -1,3 +1,2 @@ [bdist_wheel] universal=1 -azure-namespace-package=azure-cognitiveservices-search-nspkg \ No newline at end of file diff --git a/azure-cognitiveservices-search-newssearch/setup.py b/azure-cognitiveservices-search-newssearch/setup.py index 06a8b47a48911..02d898c25520b 100644 --- a/azure-cognitiveservices-search-newssearch/setup.py +++ b/azure-cognitiveservices-search-newssearch/setup.py @@ -10,16 +10,10 @@ 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-cognitiveservices-search-newssearch" -PACKAGE_PPRINT_NAME = "NewsSearch" +PACKAGE_PPRINT_NAME = "Cognitive Services News Search" # a-b-c => a/b/c package_folder_path = PACKAGE_NAME.replace('-', '/') @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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.cognitiveservices', + 'azure.cognitiveservices.search', + ]), install_requires=[ - 'msrest>=0.4.28,<2.0.0', + 'msrest>=0.5.0', 'azure-common~=1.1', ], - cmdclass=cmdclass + extras_require={ + ":python_version<'3.0'": ['azure-cognitiveservices-search-nspkg'], + } ) diff --git a/azure-cognitiveservices-search-videosearch/MANIFEST.in b/azure-cognitiveservices-search-videosearch/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-cognitiveservices-search-videosearch/MANIFEST.in +++ b/azure-cognitiveservices-search-videosearch/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-cognitiveservices-search-videosearch/README.rst b/azure-cognitiveservices-search-videosearch/README.rst index 0639e8736007a..d74b2f5f64fd2 100644 --- a/azure-cognitiveservices-search-videosearch/README.rst +++ b/azure-cognitiveservices-search-videosearch/README.rst @@ -3,7 +3,7 @@ Microsoft Azure SDK for Python This is the Microsoft Azure Cognitive Services Video Search Client Library. -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For a more complete set of Azure libraries, see the `azure `__ bundle package. @@ -30,9 +30,9 @@ If you see azure==0.11.0 (or any version below 1.0), uninstall it first: Usage ===== -For code examples, see `Video Search +For code examples, see `Cognitive Services Video Search `__ -on readthedocs.org. +on docs.microsoft.com. Provide Feedback diff --git a/azure-cognitiveservices-search-videosearch/azure/__init__.py b/azure-cognitiveservices-search-videosearch/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-cognitiveservices-search-videosearch/azure/__init__.py +++ b/azure-cognitiveservices-search-videosearch/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-cognitiveservices-search-videosearch/azure/cognitiveservices/__init__.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/__init__.py +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/__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-cognitiveservices-search-videosearch/azure/cognitiveservices/search/__init__.py b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/__init__.py +++ b/azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/__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-cognitiveservices-search-videosearch/azure_bdist_wheel.py b/azure-cognitiveservices-search-videosearch/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-cognitiveservices-search-videosearch/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-cognitiveservices-search-videosearch/sdk_packaging.toml b/azure-cognitiveservices-search-videosearch/sdk_packaging.toml new file mode 100644 index 0000000000000..9ec2c0acaeeb9 --- /dev/null +++ b/azure-cognitiveservices-search-videosearch/sdk_packaging.toml @@ -0,0 +1,7 @@ +[packaging] +package_name = "azure-cognitiveservices-search-videosearch" +package_nspkg = "azure-cognitiveservices-search-nspkg" +package_pprint_name = "Cognitive Services Video Search" +package_doc_id = "cognitive-services" +is_stable = true +is_arm = false diff --git a/azure-cognitiveservices-search-videosearch/setup.cfg b/azure-cognitiveservices-search-videosearch/setup.cfg index 4659976f991cf..3c6e79cf31da1 100644 --- a/azure-cognitiveservices-search-videosearch/setup.cfg +++ b/azure-cognitiveservices-search-videosearch/setup.cfg @@ -1,3 +1,2 @@ [bdist_wheel] universal=1 -azure-namespace-package=azure-cognitiveservices-search-nspkg \ No newline at end of file diff --git a/azure-cognitiveservices-search-videosearch/setup.py b/azure-cognitiveservices-search-videosearch/setup.py index 6d3f83d35bbfa..ab90266b76233 100644 --- a/azure-cognitiveservices-search-videosearch/setup.py +++ b/azure-cognitiveservices-search-videosearch/setup.py @@ -10,16 +10,10 @@ 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-cognitiveservices-search-videosearch" -PACKAGE_PPRINT_NAME = "Cognitive Services VideoSearch" +PACKAGE_PPRINT_NAME = "Cognitive Services Video Search" # a-b-c => a/b/c package_folder_path = PACKAGE_NAME.replace('-', '/') @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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.cognitiveservices', + 'azure.cognitiveservices.search', + ]), install_requires=[ - 'msrest>=0.4.28,<2.0.0', + 'msrest>=0.5.0', 'azure-common~=1.1', ], - cmdclass=cmdclass + extras_require={ + ":python_version<'3.0'": ['azure-cognitiveservices-search-nspkg'], + } ) diff --git a/azure-cognitiveservices-search-visualsearch/MANIFEST.in b/azure-cognitiveservices-search-visualsearch/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-cognitiveservices-search-visualsearch/MANIFEST.in +++ b/azure-cognitiveservices-search-visualsearch/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-cognitiveservices-search-visualsearch/README.rst b/azure-cognitiveservices-search-visualsearch/README.rst index 800f91d3eeb5d..353d78c5b6063 100644 --- a/azure-cognitiveservices-search-visualsearch/README.rst +++ b/azure-cognitiveservices-search-visualsearch/README.rst @@ -1,9 +1,9 @@ Microsoft Azure SDK for Python ============================== -This is the Microsoft Azure Cognitive Services VisualSearch Client Library. +This is the Microsoft Azure Cognitive Services Visual Search Client Library. -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For a more complete set of Azure libraries, see the `azure `__ bundle package. @@ -30,9 +30,9 @@ If you see azure==0.11.0 (or any version below 1.0), uninstall it first: Usage ===== -For code examples, see `Visual Search +For code examples, see `Cognitive Services Visual Search `__ -on readthedocs.org. +on docs.microsoft.com. Provide Feedback diff --git a/azure-cognitiveservices-search-visualsearch/azure/__init__.py b/azure-cognitiveservices-search-visualsearch/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-cognitiveservices-search-visualsearch/azure/__init__.py +++ b/azure-cognitiveservices-search-visualsearch/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-cognitiveservices-search-visualsearch/azure/cognitiveservices/__init__.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/__init__.py +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/__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-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/__init__.py b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/__init__.py +++ b/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/__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-cognitiveservices-search-visualsearch/azure_bdist_wheel.py b/azure-cognitiveservices-search-visualsearch/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-cognitiveservices-search-visualsearch/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-cognitiveservices-search-visualsearch/sdk_packaging.toml b/azure-cognitiveservices-search-visualsearch/sdk_packaging.toml new file mode 100644 index 0000000000000..269e6996fa9b7 --- /dev/null +++ b/azure-cognitiveservices-search-visualsearch/sdk_packaging.toml @@ -0,0 +1,7 @@ +[packaging] +package_name = "azure-cognitiveservices-search-visualsearch" +package_nspkg = "azure-cognitiveservices-search-nspkg" +package_pprint_name = "Cognitive Services Visual Search" +package_doc_id = "cognitive-services" +is_stable = false +is_arm = false diff --git a/azure-cognitiveservices-search-visualsearch/setup.cfg b/azure-cognitiveservices-search-visualsearch/setup.cfg index 4659976f991cf..3c6e79cf31da1 100644 --- a/azure-cognitiveservices-search-visualsearch/setup.cfg +++ b/azure-cognitiveservices-search-visualsearch/setup.cfg @@ -1,3 +1,2 @@ [bdist_wheel] universal=1 -azure-namespace-package=azure-cognitiveservices-search-nspkg \ No newline at end of file diff --git a/azure-cognitiveservices-search-visualsearch/setup.py b/azure-cognitiveservices-search-visualsearch/setup.py index c815f23999c02..1526e0ed3aa58 100644 --- a/azure-cognitiveservices-search-visualsearch/setup.py +++ b/azure-cognitiveservices-search-visualsearch/setup.py @@ -10,16 +10,10 @@ 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-cognitiveservices-search-visualsearch" -PACKAGE_PPRINT_NAME = "Cognitive Services VisualSearch" +PACKAGE_PPRINT_NAME = "Cognitive Services Visual Search" # a-b-c => a/b/c package_folder_path = PACKAGE_NAME.replace('-', '/') @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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.cognitiveservices', + 'azure.cognitiveservices.search', + ]), install_requires=[ - 'msrest>=0.4.28,<2.0.0', + 'msrest>=0.5.0', 'azure-common~=1.1', ], - cmdclass=cmdclass + extras_require={ + ":python_version<'3.0'": ['azure-cognitiveservices-search-nspkg'], + } ) diff --git a/azure-cognitiveservices-search-websearch/MANIFEST.in b/azure-cognitiveservices-search-websearch/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-cognitiveservices-search-websearch/MANIFEST.in +++ b/azure-cognitiveservices-search-websearch/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-cognitiveservices-search-websearch/README.rst b/azure-cognitiveservices-search-websearch/README.rst index 1c4ca851b42c2..6963a49a6ece2 100644 --- a/azure-cognitiveservices-search-websearch/README.rst +++ b/azure-cognitiveservices-search-websearch/README.rst @@ -1,9 +1,9 @@ Microsoft Azure SDK for Python ============================== -This is the Microsoft Azure Cognitive Services WebSearch Client Library. +This is the Microsoft Azure Cognitive Services Web Search Client Library. -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For a more complete set of Azure libraries, see the `azure `__ bundle package. @@ -30,9 +30,9 @@ If you see azure==0.11.0 (or any version below 1.0), uninstall it first: Usage ===== -For code examples, see `Web Search +For code examples, see `Cognitive Services Web Search `__ -on readthedocs.org. +on docs.microsoft.com. Provide Feedback diff --git a/azure-cognitiveservices-search-websearch/azure/__init__.py b/azure-cognitiveservices-search-websearch/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-cognitiveservices-search-websearch/azure/__init__.py +++ b/azure-cognitiveservices-search-websearch/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-cognitiveservices-search-websearch/azure/cognitiveservices/__init__.py b/azure-cognitiveservices-search-websearch/azure/cognitiveservices/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-cognitiveservices-search-websearch/azure/cognitiveservices/__init__.py +++ b/azure-cognitiveservices-search-websearch/azure/cognitiveservices/__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-cognitiveservices-search-websearch/azure/cognitiveservices/search/__init__.py b/azure-cognitiveservices-search-websearch/azure/cognitiveservices/search/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-cognitiveservices-search-websearch/azure/cognitiveservices/search/__init__.py +++ b/azure-cognitiveservices-search-websearch/azure/cognitiveservices/search/__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-cognitiveservices-search-websearch/azure_bdist_wheel.py b/azure-cognitiveservices-search-websearch/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-cognitiveservices-search-websearch/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-cognitiveservices-search-websearch/sdk_packaging.toml b/azure-cognitiveservices-search-websearch/sdk_packaging.toml new file mode 100644 index 0000000000000..ee6f132533576 --- /dev/null +++ b/azure-cognitiveservices-search-websearch/sdk_packaging.toml @@ -0,0 +1,7 @@ +[packaging] +package_name = "azure-cognitiveservices-search-websearch" +package_nspkg = "azure-cognitiveservices-search-nspkg" +package_pprint_name = "Cognitive Services Web Search" +package_doc_id = "cognitive-services" +is_stable = true +is_arm = false diff --git a/azure-cognitiveservices-search-websearch/setup.cfg b/azure-cognitiveservices-search-websearch/setup.cfg index 4659976f991cf..3c6e79cf31da1 100644 --- a/azure-cognitiveservices-search-websearch/setup.cfg +++ b/azure-cognitiveservices-search-websearch/setup.cfg @@ -1,3 +1,2 @@ [bdist_wheel] universal=1 -azure-namespace-package=azure-cognitiveservices-search-nspkg \ No newline at end of file diff --git a/azure-cognitiveservices-search-websearch/setup.py b/azure-cognitiveservices-search-websearch/setup.py index 27dfd82c49a0b..c92251cf0f5c4 100644 --- a/azure-cognitiveservices-search-websearch/setup.py +++ b/azure-cognitiveservices-search-websearch/setup.py @@ -10,16 +10,10 @@ 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-cognitiveservices-search-websearch" -PACKAGE_PPRINT_NAME = "Cognitive Services WebSearch" +PACKAGE_PPRINT_NAME = "Cognitive Services Web Search" # a-b-c => a/b/c package_folder_path = PACKAGE_NAME.replace('-', '/') @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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.cognitiveservices', + 'azure.cognitiveservices.search', + ]), install_requires=[ - 'msrest>=0.4.28,<2.0.0', + 'msrest>=0.5.0', 'azure-common~=1.1', ], - cmdclass=cmdclass + extras_require={ + ":python_version<'3.0'": ['azure-cognitiveservices-search-nspkg'], + } ) diff --git a/azure-cognitiveservices-vision-computervision/MANIFEST.in b/azure-cognitiveservices-vision-computervision/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-cognitiveservices-vision-computervision/MANIFEST.in +++ b/azure-cognitiveservices-vision-computervision/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-cognitiveservices-vision-computervision/README.rst b/azure-cognitiveservices-vision-computervision/README.rst index ee1ba86cf7c04..eee101b4fb52c 100644 --- a/azure-cognitiveservices-vision-computervision/README.rst +++ b/azure-cognitiveservices-vision-computervision/README.rst @@ -3,7 +3,7 @@ Microsoft Azure SDK for Python This is the Microsoft Azure Cognitive Services Computer Vision Client Library. -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For a more complete set of Azure libraries, see the `azure `__ bundle package. diff --git a/azure-cognitiveservices-vision-computervision/azure/__init__.py b/azure-cognitiveservices-vision-computervision/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-cognitiveservices-vision-computervision/azure/__init__.py +++ b/azure-cognitiveservices-vision-computervision/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-cognitiveservices-vision-computervision/azure/cognitiveservices/__init__.py b/azure-cognitiveservices-vision-computervision/azure/cognitiveservices/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-cognitiveservices-vision-computervision/azure/cognitiveservices/__init__.py +++ b/azure-cognitiveservices-vision-computervision/azure/cognitiveservices/__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-cognitiveservices-vision-computervision/azure/cognitiveservices/vision/__init__.py b/azure-cognitiveservices-vision-computervision/azure/cognitiveservices/vision/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-cognitiveservices-vision-computervision/azure/cognitiveservices/vision/__init__.py +++ b/azure-cognitiveservices-vision-computervision/azure/cognitiveservices/vision/__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-cognitiveservices-vision-computervision/azure_bdist_wheel.py b/azure-cognitiveservices-vision-computervision/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-cognitiveservices-vision-computervision/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-cognitiveservices-vision-computervision/setup.cfg b/azure-cognitiveservices-vision-computervision/setup.cfg index 6197b40d106e6..3c6e79cf31da1 100644 --- a/azure-cognitiveservices-vision-computervision/setup.cfg +++ b/azure-cognitiveservices-vision-computervision/setup.cfg @@ -1,3 +1,2 @@ [bdist_wheel] universal=1 -azure-namespace-package=azure-cognitiveservices-vision-nspkg \ No newline at end of file diff --git a/azure-cognitiveservices-vision-computervision/setup.py b/azure-cognitiveservices-vision-computervision/setup.py index 7402c1967c375..500702758cf2c 100644 --- a/azure-cognitiveservices-vision-computervision/setup.py +++ b/azure-cognitiveservices-vision-computervision/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-cognitiveservices-vision-computervision" @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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.cognitiveservices', + 'azure.cognitiveservices.vision', + ]), install_requires=[ - 'msrest>=0.4.29,<2.0.0', + 'msrest>=0.5.0', 'azure-common~=1.1', ], - cmdclass=cmdclass + extras_require={ + ":python_version<'3.0'": ['azure-cognitiveservices-vision-nspkg'], + } ) diff --git a/azure-cognitiveservices-vision-contentmoderator/MANIFEST.in b/azure-cognitiveservices-vision-contentmoderator/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-cognitiveservices-vision-contentmoderator/MANIFEST.in +++ b/azure-cognitiveservices-vision-contentmoderator/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-cognitiveservices-vision-contentmoderator/README.rst b/azure-cognitiveservices-vision-contentmoderator/README.rst index 71b89a9adbf1a..655bc03184d39 100644 --- a/azure-cognitiveservices-vision-contentmoderator/README.rst +++ b/azure-cognitiveservices-vision-contentmoderator/README.rst @@ -3,13 +3,7 @@ Microsoft Azure SDK for Python This is the Microsoft Azure Cognitive Services Content Moderator Client Library. -Azure Resource Manager (ARM) is the next generation of management APIs that -replace the old Azure Service Management (ASM). - -This package has been tested with Python 2.7, 3.3, 3.4, 3.5 and 3.6. - -For the older Azure Service Management (ASM) libraries, see -`azure-servicemanagement-legacy `__ library. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For a more complete set of Azure libraries, see the `azure `__ bundle package. @@ -33,6 +27,14 @@ If you see azure==0.11.0 (or any version below 1.0), uninstall it first: pip uninstall azure +Usage +===== + +For code examples, see `Cognitive Services Content Moderator +`__ +on docs.microsoft.com. + + Provide Feedback ================ diff --git a/azure-cognitiveservices-vision-contentmoderator/azure/__init__.py b/azure-cognitiveservices-vision-contentmoderator/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-cognitiveservices-vision-contentmoderator/azure/__init__.py +++ b/azure-cognitiveservices-vision-contentmoderator/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-cognitiveservices-vision-contentmoderator/azure/cognitiveservices/__init__.py b/azure-cognitiveservices-vision-contentmoderator/azure/cognitiveservices/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-cognitiveservices-vision-contentmoderator/azure/cognitiveservices/__init__.py +++ b/azure-cognitiveservices-vision-contentmoderator/azure/cognitiveservices/__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-cognitiveservices-vision-contentmoderator/azure/cognitiveservices/vision/__init__.py b/azure-cognitiveservices-vision-contentmoderator/azure/cognitiveservices/vision/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-cognitiveservices-vision-contentmoderator/azure/cognitiveservices/vision/__init__.py +++ b/azure-cognitiveservices-vision-contentmoderator/azure/cognitiveservices/vision/__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-cognitiveservices-vision-contentmoderator/azure_bdist_wheel.py b/azure-cognitiveservices-vision-contentmoderator/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-cognitiveservices-vision-contentmoderator/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-cognitiveservices-vision-contentmoderator/sdk_packaging.toml b/azure-cognitiveservices-vision-contentmoderator/sdk_packaging.toml new file mode 100644 index 0000000000000..07907c5ade981 --- /dev/null +++ b/azure-cognitiveservices-vision-contentmoderator/sdk_packaging.toml @@ -0,0 +1,7 @@ +[packaging] +package_name = "azure-cognitiveservices-vision-contentmoderator" +package_nspkg = "azure-cognitiveservices-vision-nspkg" +package_pprint_name = "Cognitive Services Content Moderator" +package_doc_id = "cognitive-services" +is_stable = false +is_arm = false diff --git a/azure-cognitiveservices-vision-contentmoderator/setup.cfg b/azure-cognitiveservices-vision-contentmoderator/setup.cfg index 6197b40d106e6..3c6e79cf31da1 100644 --- a/azure-cognitiveservices-vision-contentmoderator/setup.cfg +++ b/azure-cognitiveservices-vision-contentmoderator/setup.cfg @@ -1,3 +1,2 @@ [bdist_wheel] universal=1 -azure-namespace-package=azure-cognitiveservices-vision-nspkg \ No newline at end of file diff --git a/azure-cognitiveservices-vision-contentmoderator/setup.py b/azure-cognitiveservices-vision-contentmoderator/setup.py index 8111d4a03e2c1..1f33265792a53 100644 --- a/azure-cognitiveservices-vision-contentmoderator/setup.py +++ b/azure-cognitiveservices-vision-contentmoderator/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-cognitiveservices-vision-contentmoderator" @@ -69,17 +63,25 @@ 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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.cognitiveservices', + 'azure.cognitiveservices.vision', + ]), install_requires=[ - 'msrest>=0.4.24,<2.0.0', + 'msrest>=0.5.0', 'azure-common~=1.1', ], - cmdclass=cmdclass + extras_require={ + ":python_version<'3.0'": ['azure-cognitiveservices-vision-nspkg'], + } ) diff --git a/azure-cognitiveservices-vision-customvision/MANIFEST.in b/azure-cognitiveservices-vision-customvision/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-cognitiveservices-vision-customvision/MANIFEST.in +++ b/azure-cognitiveservices-vision-customvision/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-cognitiveservices-vision-customvision/README.rst b/azure-cognitiveservices-vision-customvision/README.rst index d8c393a73675f..637b670d39ad9 100644 --- a/azure-cognitiveservices-vision-customvision/README.rst +++ b/azure-cognitiveservices-vision-customvision/README.rst @@ -3,7 +3,7 @@ Microsoft Azure SDK for Python This is the Microsoft Azure Custom Vision Client Library. -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For a more complete set of Azure libraries, see the `azure `__ bundle package. diff --git a/azure-cognitiveservices-vision-customvision/azure/__init__.py b/azure-cognitiveservices-vision-customvision/azure/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-cognitiveservices-vision-customvision/azure/__init__.py +++ b/azure-cognitiveservices-vision-customvision/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-cognitiveservices-vision-customvision/azure/cognitiveservices/__init__.py b/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/__init__.py +++ b/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/__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-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/__init__.py b/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/__init__.py +++ b/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/__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-cognitiveservices-vision-customvision/azure_bdist_wheel.py b/azure-cognitiveservices-vision-customvision/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-cognitiveservices-vision-customvision/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-cognitiveservices-vision-customvision/setup.cfg b/azure-cognitiveservices-vision-customvision/setup.cfg index 6197b40d106e6..3c6e79cf31da1 100644 --- a/azure-cognitiveservices-vision-customvision/setup.cfg +++ b/azure-cognitiveservices-vision-customvision/setup.cfg @@ -1,3 +1,2 @@ [bdist_wheel] universal=1 -azure-namespace-package=azure-cognitiveservices-vision-nspkg \ No newline at end of file diff --git a/azure-cognitiveservices-vision-customvision/setup.py b/azure-cognitiveservices-vision-customvision/setup.py index af4df99dddaf2..96db640f2a901 100644 --- a/azure-cognitiveservices-vision-customvision/setup.py +++ b/azure-cognitiveservices-vision-customvision/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-cognitiveservices-vision-customvision" @@ -76,10 +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.cognitiveservices', + 'azure.cognitiveservices.vision', + ]), install_requires=[ - 'msrest>=0.4.28,<2.0.0', + 'msrest>=0.5.0', 'azure-common~=1.1', ], - cmdclass=cmdclass + extras_require={ + ":python_version<'3.0'": ['azure-cognitiveservices-vision-nspkg'], + } ) diff --git a/azure-cognitiveservices-vision-face/MANIFEST.in b/azure-cognitiveservices-vision-face/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-cognitiveservices-vision-face/MANIFEST.in +++ b/azure-cognitiveservices-vision-face/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-cognitiveservices-vision-face/README.rst b/azure-cognitiveservices-vision-face/README.rst index 2775509d38015..072d2c22386f2 100644 --- a/azure-cognitiveservices-vision-face/README.rst +++ b/azure-cognitiveservices-vision-face/README.rst @@ -3,13 +3,7 @@ Microsoft Azure SDK for Python This is the Microsoft Azure Cognitive Services Face Client Library. -Azure Resource Manager (ARM) is the next generation of management APIs that -replace the old Azure Service Management (ASM). - -This package has been tested with Python 2.7, 3.3, 3.4, 3.5 and 3.6. - -For the older Azure Service Management (ASM) libraries, see -`azure-servicemanagement-legacy `__ library. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For a more complete set of Azure libraries, see the `azure `__ bundle package. @@ -33,6 +27,14 @@ If you see azure==0.11.0 (or any version below 1.0), uninstall it first: pip uninstall azure +Usage +===== + +For code examples, see `Cognitive Services Face +`__ +on docs.microsoft.com. + + Provide Feedback ================ diff --git a/azure-cognitiveservices-vision-face/azure/__init__.py b/azure-cognitiveservices-vision-face/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-cognitiveservices-vision-face/azure/__init__.py +++ b/azure-cognitiveservices-vision-face/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-cognitiveservices-vision-face/azure/cognitiveservices/__init__.py b/azure-cognitiveservices-vision-face/azure/cognitiveservices/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-cognitiveservices-vision-face/azure/cognitiveservices/__init__.py +++ b/azure-cognitiveservices-vision-face/azure/cognitiveservices/__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-cognitiveservices-vision-face/azure/cognitiveservices/vision/__init__.py b/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/__init__.py +++ b/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/__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-cognitiveservices-vision-face/azure_bdist_wheel.py b/azure-cognitiveservices-vision-face/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-cognitiveservices-vision-face/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-cognitiveservices-vision-face/sdk_packaging.toml b/azure-cognitiveservices-vision-face/sdk_packaging.toml new file mode 100644 index 0000000000000..3755264a50f44 --- /dev/null +++ b/azure-cognitiveservices-vision-face/sdk_packaging.toml @@ -0,0 +1,7 @@ +[packaging] +package_name = "azure-cognitiveservices-vision-face" +package_nspkg = "azure-cognitiveservices-vision-nspkg" +package_pprint_name = "Cognitive Services Face" +package_doc_id = "cognitive-services" +is_stable = false +is_arm = false diff --git a/azure-cognitiveservices-vision-face/setup.cfg b/azure-cognitiveservices-vision-face/setup.cfg index 6197b40d106e6..3c6e79cf31da1 100644 --- a/azure-cognitiveservices-vision-face/setup.cfg +++ b/azure-cognitiveservices-vision-face/setup.cfg @@ -1,3 +1,2 @@ [bdist_wheel] universal=1 -azure-namespace-package=azure-cognitiveservices-vision-nspkg \ No newline at end of file diff --git a/azure-cognitiveservices-vision-face/setup.py b/azure-cognitiveservices-vision-face/setup.py index 71868eea4aa0c..f7ab200174d8c 100644 --- a/azure-cognitiveservices-vision-face/setup.py +++ b/azure-cognitiveservices-vision-face/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-cognitiveservices-vision-face" @@ -69,17 +63,25 @@ 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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.cognitiveservices', + 'azure.cognitiveservices.vision', + ]), install_requires=[ - 'msrest>=0.4.24,<2.0.0', + 'msrest>=0.5.0', 'azure-common~=1.1', ], - cmdclass=cmdclass + extras_require={ + ":python_version<'3.0'": ['azure-cognitiveservices-vision-nspkg'], + } ) From 7f1e4a016db70a24ea93be634e08f7cbbc89db9c Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Mon, 24 Sep 2018 15:29:06 -0700 Subject: [PATCH 11/23] Dataplane new packaging --- azure-applicationinsights/MANIFEST.in | 1 - azure-applicationinsights/README.rst | 2 +- azure-applicationinsights/azure/__init__.py | 2 +- .../azure_bdist_wheel.py | 54 ------------------- azure-applicationinsights/setup.cfg | 1 - azure-applicationinsights/setup.py | 18 +++---- azure-eventgrid/MANIFEST.in | 1 - azure-eventgrid/azure/__init__.py | 2 +- azure-eventgrid/azure_bdist_wheel.py | 54 ------------------- azure-eventgrid/setup.cfg | 1 - azure-eventgrid/setup.py | 16 +++--- azure-graphrbac/MANIFEST.in | 1 - azure-graphrbac/README.rst | 10 +--- azure-graphrbac/azure/__init__.py | 2 +- azure-graphrbac/azure_bdist_wheel.py | 54 ------------------- azure-graphrbac/sdk_packaging.toml | 7 +++ azure-graphrbac/setup.cfg | 1 - azure-graphrbac/setup.py | 20 +++---- azure-keyvault/MANIFEST.in | 1 - azure-keyvault/README.rst | 2 +- azure-keyvault/azure/__init__.py | 2 +- azure-keyvault/azure_bdist_wheel.py | 54 ------------------- azure-keyvault/sdk_packaging.toml | 2 + azure-keyvault/setup.cfg | 1 - azure-keyvault/setup.py | 17 +++--- azure-loganalytics/MANIFEST.in | 1 - azure-loganalytics/README.rst | 2 +- azure-loganalytics/azure/__init__.py | 2 +- azure-loganalytics/azure_bdist_wheel.py | 54 ------------------- azure-loganalytics/setup.cfg | 1 - azure-loganalytics/setup.py | 18 +++---- azure-servicefabric/MANIFEST.in | 1 - azure-servicefabric/README.rst | 10 +--- azure-servicefabric/azure/__init__.py | 2 +- azure-servicefabric/azure_bdist_wheel.py | 54 ------------------- azure-servicefabric/sdk_packaging.toml | 7 +++ azure-servicefabric/setup.cfg | 1 - azure-servicefabric/setup.py | 20 +++---- 38 files changed, 85 insertions(+), 414 deletions(-) delete mode 100644 azure-applicationinsights/azure_bdist_wheel.py delete mode 100644 azure-eventgrid/azure_bdist_wheel.py delete mode 100644 azure-graphrbac/azure_bdist_wheel.py create mode 100644 azure-graphrbac/sdk_packaging.toml delete mode 100644 azure-keyvault/azure_bdist_wheel.py delete mode 100644 azure-loganalytics/azure_bdist_wheel.py delete mode 100644 azure-servicefabric/azure_bdist_wheel.py create mode 100644 azure-servicefabric/sdk_packaging.toml diff --git a/azure-applicationinsights/MANIFEST.in b/azure-applicationinsights/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-applicationinsights/MANIFEST.in +++ b/azure-applicationinsights/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-applicationinsights/README.rst b/azure-applicationinsights/README.rst index 47d9a1fe69b3b..01181cde9839d 100644 --- a/azure-applicationinsights/README.rst +++ b/azure-applicationinsights/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure Application Insights Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. diff --git a/azure-applicationinsights/azure/__init__.py b/azure-applicationinsights/azure/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-applicationinsights/azure/__init__.py +++ b/azure-applicationinsights/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-applicationinsights/azure_bdist_wheel.py b/azure-applicationinsights/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-applicationinsights/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-applicationinsights/setup.cfg b/azure-applicationinsights/setup.cfg index 669e94e63df3a..3c6e79cf31da1 100644 --- a/azure-applicationinsights/setup.cfg +++ b/azure-applicationinsights/setup.cfg @@ -1,3 +1,2 @@ [bdist_wheel] universal=1 -azure-namespace-package=azure-nspkg \ No newline at end of file diff --git a/azure-applicationinsights/setup.py b/azure-applicationinsights/setup.py index ea6a093aaec15..80142e19f1975 100644 --- a/azure-applicationinsights/setup.py +++ b/azure-applicationinsights/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-applicationinsights" @@ -76,10 +70,16 @@ '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', + ]), install_requires=[ - 'msrest>=0.5.4,<2.0.0', + 'msrest>=0.5.0', 'azure-common~=1.1', ], - cmdclass=cmdclass + extras_require={ + ":python_version<'3.0'": ['azure-nspkg'], + } ) diff --git a/azure-eventgrid/MANIFEST.in b/azure-eventgrid/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-eventgrid/MANIFEST.in +++ b/azure-eventgrid/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-eventgrid/azure/__init__.py b/azure-eventgrid/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-eventgrid/azure/__init__.py +++ b/azure-eventgrid/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-eventgrid/azure_bdist_wheel.py b/azure-eventgrid/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-eventgrid/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-eventgrid/setup.cfg b/azure-eventgrid/setup.cfg index 669e94e63df3a..3c6e79cf31da1 100644 --- a/azure-eventgrid/setup.cfg +++ b/azure-eventgrid/setup.cfg @@ -1,3 +1,2 @@ [bdist_wheel] universal=1 -azure-namespace-package=azure-nspkg \ No newline at end of file diff --git a/azure-eventgrid/setup.py b/azure-eventgrid/setup.py index b5ded43b0ed76..35c7d8087e6a8 100644 --- a/azure-eventgrid/setup.py +++ b/azure-eventgrid/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-eventgrid" @@ -76,11 +70,17 @@ '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', + ]), 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-nspkg'], + } ) diff --git a/azure-graphrbac/MANIFEST.in b/azure-graphrbac/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-graphrbac/MANIFEST.in +++ b/azure-graphrbac/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-graphrbac/README.rst b/azure-graphrbac/README.rst index 53909d4c55956..378e694726793 100644 --- a/azure-graphrbac/README.rst +++ b/azure-graphrbac/README.rst @@ -3,13 +3,7 @@ Microsoft Azure SDK for Python This is the Microsoft Azure Graph RBAC Client Library. -Azure Resource Manager (ARM) is the next generation of management APIs that -replace the old Azure Service Management (ASM). - -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. - -For the older Azure Service Management (ASM) libraries, see -`azure-servicemanagement-legacy `__ library. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For a more complete set of Azure libraries, see the `azure `__ bundle package. @@ -36,7 +30,7 @@ If you see azure==0.11.0 (or any version below 1.0), uninstall it first: Usage ===== -For code examples, see `GraphRBAC +For code examples, see `Graph RBAC `__ on docs.microsoft.com. diff --git a/azure-graphrbac/azure/__init__.py b/azure-graphrbac/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-graphrbac/azure/__init__.py +++ b/azure-graphrbac/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-graphrbac/azure_bdist_wheel.py b/azure-graphrbac/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-graphrbac/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-graphrbac/sdk_packaging.toml b/azure-graphrbac/sdk_packaging.toml new file mode 100644 index 0000000000000..90a577aebd860 --- /dev/null +++ b/azure-graphrbac/sdk_packaging.toml @@ -0,0 +1,7 @@ +[packaging] +package_name = "azure-graphrbac" +package_nspkg = "azure-nspkg" +package_pprint_name = "Graph RBAC" +package_doc_id = "activedirectory" +is_stable = false +is_arm = false diff --git a/azure-graphrbac/setup.cfg b/azure-graphrbac/setup.cfg index 669e94e63df3a..3c6e79cf31da1 100644 --- a/azure-graphrbac/setup.cfg +++ b/azure-graphrbac/setup.cfg @@ -1,3 +1,2 @@ [bdist_wheel] universal=1 -azure-namespace-package=azure-nspkg \ No newline at end of file diff --git a/azure-graphrbac/setup.py b/azure-graphrbac/setup.py index 1ea4679ce3e1e..c805471af0bb8 100644 --- a/azure-graphrbac/setup.py +++ b/azure-graphrbac/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-graphrbac" @@ -72,13 +66,21 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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', + ]), install_requires=[ - 'msrestazure>=0.4.20,<2.0.0', + 'msrest>=0.5.0', + 'msrestazure>=0.4.32,<2.0.0', 'azure-common~=1.1', ], - cmdclass=cmdclass + extras_require={ + ":python_version<'3.0'": ['azure-nspkg'], + } ) diff --git a/azure-keyvault/MANIFEST.in b/azure-keyvault/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-keyvault/MANIFEST.in +++ b/azure-keyvault/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-keyvault/README.rst b/azure-keyvault/README.rst index 6b7b5ab5bc08b..75129f4f2d60f 100644 --- a/azure-keyvault/README.rst +++ b/azure-keyvault/README.rst @@ -3,7 +3,7 @@ Microsoft Azure SDK for Python This is the Microsoft Azure Key Vault Client Library. -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For a more complete set of Azure libraries, see the `azure `__ bundle package. diff --git a/azure-keyvault/azure/__init__.py b/azure-keyvault/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-keyvault/azure/__init__.py +++ b/azure-keyvault/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-keyvault/azure_bdist_wheel.py b/azure-keyvault/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-keyvault/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-keyvault/sdk_packaging.toml b/azure-keyvault/sdk_packaging.toml index 5c2041749c301..a8ce4869ae3bf 100644 --- a/azure-keyvault/sdk_packaging.toml +++ b/azure-keyvault/sdk_packaging.toml @@ -1,5 +1,7 @@ [packaging] +auto_update = false package_name = "azure-keyvault" package_pprint_name = "Key Vault" package_doc_id = "key-vault" is_stable = false +is_arm = false diff --git a/azure-keyvault/setup.cfg b/azure-keyvault/setup.cfg index 669e94e63df3a..3c6e79cf31da1 100644 --- a/azure-keyvault/setup.cfg +++ b/azure-keyvault/setup.cfg @@ -1,3 +1,2 @@ [bdist_wheel] universal=1 -azure-namespace-package=azure-nspkg \ No newline at end of file diff --git a/azure-keyvault/setup.py b/azure-keyvault/setup.py index 337388a1eb9c2..ddf1892e19f89 100644 --- a/azure-keyvault/setup.py +++ b/azure-keyvault/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-keyvault" @@ -72,10 +66,15 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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', + ]), install_requires=[ 'msrest>=0.5.0', 'msrestazure>=0.4.32,<2.0.0', @@ -83,5 +82,7 @@ 'cryptography>=2.1.4', 'requests>=2.18.4' ], - cmdclass=cmdclass + extras_require={ + ":python_version<'3.0'": ['azure-nspkg'], + } ) diff --git a/azure-loganalytics/MANIFEST.in b/azure-loganalytics/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-loganalytics/MANIFEST.in +++ b/azure-loganalytics/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-loganalytics/README.rst b/azure-loganalytics/README.rst index f4f4204ffd17a..874a0adc79f2d 100644 --- a/azure-loganalytics/README.rst +++ b/azure-loganalytics/README.rst @@ -3,7 +3,7 @@ Microsoft Azure SDK for Python This is the Microsoft Azure Log Analytics Client Library. -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For a more complete set of Azure libraries, see the `azure `__ bundle package. diff --git a/azure-loganalytics/azure/__init__.py b/azure-loganalytics/azure/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-loganalytics/azure/__init__.py +++ b/azure-loganalytics/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-loganalytics/azure_bdist_wheel.py b/azure-loganalytics/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-loganalytics/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-loganalytics/setup.cfg b/azure-loganalytics/setup.cfg index 669e94e63df3a..3c6e79cf31da1 100644 --- a/azure-loganalytics/setup.cfg +++ b/azure-loganalytics/setup.cfg @@ -1,3 +1,2 @@ [bdist_wheel] universal=1 -azure-namespace-package=azure-nspkg \ No newline at end of file diff --git a/azure-loganalytics/setup.py b/azure-loganalytics/setup.py index 49882c7bc2ecd..87ff80807710e 100644 --- a/azure-loganalytics/setup.py +++ b/azure-loganalytics/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-loganalytics" @@ -76,10 +70,16 @@ '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', + ]), install_requires=[ - 'msrest>=0.4.29,<2.0.0', + 'msrest>=0.5.0', 'azure-common~=1.1', ], - cmdclass=cmdclass + extras_require={ + ":python_version<'3.0'": ['azure-nspkg'], + } ) diff --git a/azure-servicefabric/MANIFEST.in b/azure-servicefabric/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-servicefabric/MANIFEST.in +++ b/azure-servicefabric/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-servicefabric/README.rst b/azure-servicefabric/README.rst index cdb9d23af0aaf..4fffdefcfcc5a 100644 --- a/azure-servicefabric/README.rst +++ b/azure-servicefabric/README.rst @@ -3,13 +3,7 @@ Microsoft Azure SDK for Python This is the Microsoft Azure Service Fabric Client Library. -Azure Resource Manager (ARM) is the next generation of management APIs that -replace the old Azure Service Management (ASM). - -This package has been tested with Python 2.7, 3.4, 3.5, 3.6, and 3.7. - -For the older Azure Service Management (ASM) libraries, see -`azure-servicemanagement-legacy `__ library. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For a more complete set of Azure libraries, see the `azure `__ bundle package. @@ -37,7 +31,7 @@ Usage ===== For code examples, see `Service Fabric -`__ +`__ on docs.microsoft.com. diff --git a/azure-servicefabric/azure/__init__.py b/azure-servicefabric/azure/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-servicefabric/azure/__init__.py +++ b/azure-servicefabric/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-servicefabric/azure_bdist_wheel.py b/azure-servicefabric/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-servicefabric/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-servicefabric/sdk_packaging.toml b/azure-servicefabric/sdk_packaging.toml new file mode 100644 index 0000000000000..c1ff0e94edcf3 --- /dev/null +++ b/azure-servicefabric/sdk_packaging.toml @@ -0,0 +1,7 @@ +[packaging] +package_name = "azure-servicefabric" +package_nspkg = "azure-nspkg" +package_pprint_name = "Service Fabric" +package_doc_id = "servicefabric" +is_stable = true +is_arm = false diff --git a/azure-servicefabric/setup.cfg b/azure-servicefabric/setup.cfg index 669e94e63df3a..3c6e79cf31da1 100644 --- a/azure-servicefabric/setup.cfg +++ b/azure-servicefabric/setup.cfg @@ -1,3 +1,2 @@ [bdist_wheel] universal=1 -azure-namespace-package=azure-nspkg \ No newline at end of file diff --git a/azure-servicefabric/setup.py b/azure-servicefabric/setup.py index 97cd51c0089dc..ae9d865d3229c 100644 --- a/azure-servicefabric/setup.py +++ b/azure-servicefabric/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-servicefabric" @@ -64,7 +58,7 @@ author_email='azpysdkhelp@microsoft.com', url='https://github.com/Azure/azure-sdk-for-python', classifiers=[ - 'Development Status :: 4 - Beta', + 'Development Status :: 5 - Production/Stable', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', @@ -76,10 +70,16 @@ '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', + ]), install_requires=[ - 'msrest>=0.4.26,<2.0.0', + 'msrest>=0.5.0', 'azure-common~=1.1', ], - cmdclass=cmdclass + extras_require={ + ":python_version<'3.0'": ['azure-nspkg'], + } ) From 253ebe686d0184029cbf267afed10fa9d8aa31e4 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Mon, 24 Sep 2018 15:30:17 -0700 Subject: [PATCH 12/23] Never auto-update the nspkg --- azure-mgmt-datalake-nspkg/sdk_packaging.toml | 2 ++ azure-mgmt-nspkg/sdk_packaging.toml | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 azure-mgmt-datalake-nspkg/sdk_packaging.toml create mode 100644 azure-mgmt-nspkg/sdk_packaging.toml diff --git a/azure-mgmt-datalake-nspkg/sdk_packaging.toml b/azure-mgmt-datalake-nspkg/sdk_packaging.toml new file mode 100644 index 0000000000000..e7687fdae93bc --- /dev/null +++ b/azure-mgmt-datalake-nspkg/sdk_packaging.toml @@ -0,0 +1,2 @@ +[packaging] +auto_update = false \ No newline at end of file diff --git a/azure-mgmt-nspkg/sdk_packaging.toml b/azure-mgmt-nspkg/sdk_packaging.toml new file mode 100644 index 0000000000000..e7687fdae93bc --- /dev/null +++ b/azure-mgmt-nspkg/sdk_packaging.toml @@ -0,0 +1,2 @@ +[packaging] +auto_update = false \ No newline at end of file From 932ce67c4d00ee2ba316871cd6ac358a306a4de6 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Mon, 24 Sep 2018 15:54:30 -0700 Subject: [PATCH 13/23] All packages which didn't have toml file --- azure-mgmt-advisor/MANIFEST.in | 1 - azure-mgmt-advisor/README.rst | 4 +- azure-mgmt-advisor/azure/__init__.py | 2 +- azure-mgmt-advisor/azure/mgmt/__init__.py | 2 +- azure-mgmt-advisor/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-advisor/sdk_packaging.toml | 7 +++ azure-mgmt-advisor/setup.cfg | 1 - azure-mgmt-advisor/setup.py | 21 ++++---- azure-mgmt-applicationinsights/MANIFEST.in | 1 - azure-mgmt-applicationinsights/README.rst | 4 +- .../azure/__init__.py | 2 +- .../azure/mgmt/__init__.py | 2 +- .../azure_bdist_wheel.py | 54 ------------------- .../sdk_packaging.toml | 7 +++ azure-mgmt-applicationinsights/setup.cfg | 1 - azure-mgmt-applicationinsights/setup.py | 21 ++++---- azure-mgmt-batchai/MANIFEST.in | 1 - azure-mgmt-batchai/README.rst | 2 +- azure-mgmt-batchai/azure/__init__.py | 2 +- azure-mgmt-batchai/azure/mgmt/__init__.py | 2 +- azure-mgmt-batchai/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-batchai/sdk_packaging.toml | 7 +++ azure-mgmt-batchai/setup.cfg | 1 - azure-mgmt-batchai/setup.py | 21 ++++---- azure-mgmt-billing/MANIFEST.in | 1 - azure-mgmt-billing/README.rst | 4 +- azure-mgmt-billing/azure/__init__.py | 2 +- azure-mgmt-billing/azure/mgmt/__init__.py | 2 +- azure-mgmt-billing/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-billing/sdk_packaging.toml | 7 +++ azure-mgmt-billing/setup.cfg | 1 - azure-mgmt-billing/setup.py | 21 ++++---- azure-mgmt-cognitiveservices/MANIFEST.in | 1 - azure-mgmt-cognitiveservices/README.rst | 2 +- .../azure/__init__.py | 2 +- .../azure/mgmt/__init__.py | 2 +- .../azure_bdist_wheel.py | 54 ------------------- .../sdk_packaging.toml | 7 +++ azure-mgmt-cognitiveservices/setup.cfg | 1 - azure-mgmt-cognitiveservices/setup.py | 23 ++++---- azure-mgmt-commerce/MANIFEST.in | 1 - azure-mgmt-commerce/README.rst | 2 +- azure-mgmt-commerce/azure/__init__.py | 2 +- azure-mgmt-commerce/azure/mgmt/__init__.py | 2 +- azure-mgmt-commerce/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-commerce/sdk_packaging.toml | 7 +++ azure-mgmt-commerce/setup.cfg | 1 - azure-mgmt-commerce/setup.py | 21 ++++---- azure-mgmt-consumption/MANIFEST.in | 1 - azure-mgmt-consumption/README.rst | 6 +-- azure-mgmt-consumption/azure/__init__.py | 2 +- azure-mgmt-consumption/azure/mgmt/__init__.py | 2 +- azure-mgmt-consumption/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-consumption/sdk_packaging.toml | 7 +++ azure-mgmt-consumption/setup.cfg | 1 - azure-mgmt-consumption/setup.py | 23 ++++---- azure-mgmt-cosmosdb/MANIFEST.in | 1 - azure-mgmt-cosmosdb/README.rst | 4 +- azure-mgmt-cosmosdb/azure/__init__.py | 2 +- azure-mgmt-cosmosdb/azure/mgmt/__init__.py | 2 +- azure-mgmt-cosmosdb/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-cosmosdb/sdk_packaging.toml | 7 +++ azure-mgmt-cosmosdb/setup.cfg | 1 - azure-mgmt-cosmosdb/setup.py | 21 ++++---- azure-mgmt-datafactory/MANIFEST.in | 1 - azure-mgmt-datafactory/README.rst | 4 +- azure-mgmt-datafactory/azure/__init__.py | 2 +- azure-mgmt-datafactory/azure/mgmt/__init__.py | 2 +- azure-mgmt-datafactory/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-datafactory/sdk_packaging.toml | 7 +++ azure-mgmt-datafactory/setup.cfg | 1 - azure-mgmt-datafactory/setup.py | 21 ++++---- azure-mgmt-devtestlabs/MANIFEST.in | 1 - azure-mgmt-devtestlabs/README.rst | 2 +- azure-mgmt-devtestlabs/azure/__init__.py | 2 +- azure-mgmt-devtestlabs/azure/mgmt/__init__.py | 2 +- azure-mgmt-devtestlabs/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-devtestlabs/sdk_packaging.toml | 7 +++ azure-mgmt-devtestlabs/setup.cfg | 1 - azure-mgmt-devtestlabs/setup.py | 21 ++++---- azure-mgmt-documentdb/azure/__init__.py | 2 +- azure-mgmt-documentdb/azure/mgmt/__init__.py | 2 +- azure-mgmt-documentdb/sdk_packaging.toml | 2 + azure-mgmt-eventgrid/MANIFEST.in | 1 - azure-mgmt-eventgrid/README.rst | 4 +- azure-mgmt-eventgrid/azure/__init__.py | 2 +- azure-mgmt-eventgrid/azure/mgmt/__init__.py | 2 +- azure-mgmt-eventgrid/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-eventgrid/sdk_packaging.toml | 7 +++ azure-mgmt-eventgrid/setup.cfg | 1 - azure-mgmt-eventgrid/setup.py | 21 ++++---- .../MANIFEST.in | 1 - .../README.rst | 2 +- .../azure/__init__.py | 2 +- .../azure/mgmt/__init__.py | 2 +- .../azure_bdist_wheel.py | 54 ------------------- .../sdk_packaging.toml | 7 +++ .../setup.cfg | 1 - .../setup.py | 21 ++++---- azure-mgmt-managementpartner/MANIFEST.in | 1 - azure-mgmt-managementpartner/README.rst | 6 ++- .../azure/__init__.py | 2 +- .../azure/mgmt/__init__.py | 2 +- .../azure_bdist_wheel.py | 54 ------------------- .../sdk_packaging.toml | 7 +++ azure-mgmt-managementpartner/setup.cfg | 1 - azure-mgmt-managementpartner/setup.py | 21 ++++---- azure-mgmt-maps/MANIFEST.in | 1 - azure-mgmt-maps/README.rst | 4 +- azure-mgmt-maps/azure/__init__.py | 2 +- azure-mgmt-maps/azure/mgmt/__init__.py | 2 +- azure-mgmt-maps/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-maps/sdk_packaging.toml | 7 +++ azure-mgmt-maps/setup.cfg | 1 - azure-mgmt-maps/setup.py | 21 ++++---- azure-mgmt-marketplaceordering/MANIFEST.in | 1 - azure-mgmt-marketplaceordering/README.rst | 4 +- .../azure/__init__.py | 2 +- .../azure/mgmt/__init__.py | 2 +- .../azure_bdist_wheel.py | 54 ------------------- .../sdk_packaging.toml | 7 +++ azure-mgmt-marketplaceordering/setup.cfg | 1 - azure-mgmt-marketplaceordering/setup.py | 21 ++++---- azure-mgmt-policyinsights/MANIFEST.in | 1 - azure-mgmt-policyinsights/README.rst | 4 +- azure-mgmt-policyinsights/azure/__init__.py | 2 +- .../azure/mgmt/__init__.py | 2 +- .../azure_bdist_wheel.py | 54 ------------------- azure-mgmt-policyinsights/sdk_packaging.toml | 7 +++ azure-mgmt-policyinsights/setup.cfg | 1 - azure-mgmt-policyinsights/setup.py | 21 ++++---- azure-mgmt-redis/MANIFEST.in | 1 - azure-mgmt-redis/README.rst | 2 +- azure-mgmt-redis/azure/__init__.py | 2 +- azure-mgmt-redis/azure/mgmt/__init__.py | 2 +- azure-mgmt-redis/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-redis/sdk_packaging.toml | 7 +++ azure-mgmt-redis/setup.cfg | 1 - azure-mgmt-redis/setup.py | 21 ++++---- azure-mgmt-relay/MANIFEST.in | 1 - azure-mgmt-relay/README.rst | 4 +- azure-mgmt-relay/azure/__init__.py | 2 +- azure-mgmt-relay/azure/mgmt/__init__.py | 2 +- azure-mgmt-relay/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-relay/sdk_packaging.toml | 7 +++ azure-mgmt-relay/setup.cfg | 1 - azure-mgmt-relay/setup.py | 21 ++++---- azure-mgmt-search/MANIFEST.in | 1 - azure-mgmt-search/README.rst | 2 +- azure-mgmt-search/azure/__init__.py | 2 +- azure-mgmt-search/azure/mgmt/__init__.py | 2 +- azure-mgmt-search/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-search/sdk_packaging.toml | 7 +++ azure-mgmt-search/setup.cfg | 1 - azure-mgmt-search/setup.py | 21 ++++---- azure-mgmt-subscription/MANIFEST.in | 1 - azure-mgmt-subscription/README.rst | 4 +- azure-mgmt-subscription/azure/__init__.py | 2 +- .../azure/mgmt/__init__.py | 2 +- azure-mgmt-subscription/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-subscription/sdk_packaging.toml | 7 +++ azure-mgmt-subscription/setup.cfg | 1 - azure-mgmt-subscription/setup.py | 21 ++++---- 163 files changed, 462 insertions(+), 1378 deletions(-) delete mode 100644 azure-mgmt-advisor/azure_bdist_wheel.py create mode 100644 azure-mgmt-advisor/sdk_packaging.toml delete mode 100644 azure-mgmt-applicationinsights/azure_bdist_wheel.py create mode 100644 azure-mgmt-applicationinsights/sdk_packaging.toml delete mode 100644 azure-mgmt-batchai/azure_bdist_wheel.py create mode 100644 azure-mgmt-batchai/sdk_packaging.toml delete mode 100644 azure-mgmt-billing/azure_bdist_wheel.py create mode 100644 azure-mgmt-billing/sdk_packaging.toml delete mode 100644 azure-mgmt-cognitiveservices/azure_bdist_wheel.py create mode 100644 azure-mgmt-cognitiveservices/sdk_packaging.toml delete mode 100644 azure-mgmt-commerce/azure_bdist_wheel.py create mode 100644 azure-mgmt-commerce/sdk_packaging.toml delete mode 100644 azure-mgmt-consumption/azure_bdist_wheel.py create mode 100644 azure-mgmt-consumption/sdk_packaging.toml delete mode 100644 azure-mgmt-cosmosdb/azure_bdist_wheel.py create mode 100644 azure-mgmt-cosmosdb/sdk_packaging.toml delete mode 100644 azure-mgmt-datafactory/azure_bdist_wheel.py create mode 100644 azure-mgmt-datafactory/sdk_packaging.toml delete mode 100644 azure-mgmt-devtestlabs/azure_bdist_wheel.py create mode 100644 azure-mgmt-devtestlabs/sdk_packaging.toml create mode 100644 azure-mgmt-documentdb/sdk_packaging.toml delete mode 100644 azure-mgmt-eventgrid/azure_bdist_wheel.py create mode 100644 azure-mgmt-eventgrid/sdk_packaging.toml delete mode 100644 azure-mgmt-iothubprovisioningservices/azure_bdist_wheel.py create mode 100644 azure-mgmt-iothubprovisioningservices/sdk_packaging.toml delete mode 100644 azure-mgmt-managementpartner/azure_bdist_wheel.py create mode 100644 azure-mgmt-managementpartner/sdk_packaging.toml delete mode 100644 azure-mgmt-maps/azure_bdist_wheel.py create mode 100644 azure-mgmt-maps/sdk_packaging.toml delete mode 100644 azure-mgmt-marketplaceordering/azure_bdist_wheel.py create mode 100644 azure-mgmt-marketplaceordering/sdk_packaging.toml delete mode 100644 azure-mgmt-policyinsights/azure_bdist_wheel.py create mode 100644 azure-mgmt-policyinsights/sdk_packaging.toml delete mode 100644 azure-mgmt-redis/azure_bdist_wheel.py create mode 100644 azure-mgmt-redis/sdk_packaging.toml delete mode 100644 azure-mgmt-relay/azure_bdist_wheel.py create mode 100644 azure-mgmt-relay/sdk_packaging.toml delete mode 100644 azure-mgmt-search/azure_bdist_wheel.py create mode 100644 azure-mgmt-search/sdk_packaging.toml delete mode 100644 azure-mgmt-subscription/azure_bdist_wheel.py create mode 100644 azure-mgmt-subscription/sdk_packaging.toml diff --git a/azure-mgmt-advisor/MANIFEST.in b/azure-mgmt-advisor/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-advisor/MANIFEST.in +++ b/azure-mgmt-advisor/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-advisor/README.rst b/azure-mgmt-advisor/README.rst index 5946a96dcaa13..710a4d0adf423 100644 --- a/azure-mgmt-advisor/README.rst +++ b/azure-mgmt-advisor/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure Advisor Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. @@ -37,7 +37,7 @@ Usage ===== For code examples, see `Advisor -`__ +`__ on docs.microsoft.com. diff --git a/azure-mgmt-advisor/azure/__init__.py b/azure-mgmt-advisor/azure/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-mgmt-advisor/azure/__init__.py +++ b/azure-mgmt-advisor/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-advisor/azure/mgmt/__init__.py b/azure-mgmt-advisor/azure/mgmt/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-mgmt-advisor/azure/mgmt/__init__.py +++ b/azure-mgmt-advisor/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-advisor/azure_bdist_wheel.py b/azure-mgmt-advisor/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-advisor/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-advisor/sdk_packaging.toml b/azure-mgmt-advisor/sdk_packaging.toml new file mode 100644 index 0000000000000..861b42f1ee213 --- /dev/null +++ b/azure-mgmt-advisor/sdk_packaging.toml @@ -0,0 +1,7 @@ +[packaging] +package_name = "azure-mgmt-advisor" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "Advisor" +package_doc_id = "advisor" +is_stable = false +is_arm = true diff --git a/azure-mgmt-advisor/setup.cfg b/azure-mgmt-advisor/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-advisor/setup.cfg +++ b/azure-mgmt-advisor/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-advisor/setup.py b/azure-mgmt-advisor/setup.py index 0d889dd9d8868..0a41844d4184a 100644 --- a/azure-mgmt-advisor/setup.py +++ b/azure-mgmt-advisor/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-advisor" @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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=[ - 'msrestazure>=0.4.20,<2.0.0', + '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'], + } ) diff --git a/azure-mgmt-applicationinsights/MANIFEST.in b/azure-mgmt-applicationinsights/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-applicationinsights/MANIFEST.in +++ b/azure-mgmt-applicationinsights/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-applicationinsights/README.rst b/azure-mgmt-applicationinsights/README.rst index f100e9cd0d923..64548862ddbe7 100644 --- a/azure-mgmt-applicationinsights/README.rst +++ b/azure-mgmt-applicationinsights/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure Application Insights Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. @@ -37,7 +37,7 @@ Usage ===== For code examples, see `Application Insights Management -`__ +`__ on docs.microsoft.com. diff --git a/azure-mgmt-applicationinsights/azure/__init__.py b/azure-mgmt-applicationinsights/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-applicationinsights/azure/__init__.py +++ b/azure-mgmt-applicationinsights/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-applicationinsights/azure/mgmt/__init__.py b/azure-mgmt-applicationinsights/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/__init__.py +++ b/azure-mgmt-applicationinsights/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-applicationinsights/azure_bdist_wheel.py b/azure-mgmt-applicationinsights/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-applicationinsights/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-applicationinsights/sdk_packaging.toml b/azure-mgmt-applicationinsights/sdk_packaging.toml new file mode 100644 index 0000000000000..a61dd3a611422 --- /dev/null +++ b/azure-mgmt-applicationinsights/sdk_packaging.toml @@ -0,0 +1,7 @@ +[packaging] +package_name = "azure-mgmt-applicationinsights" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "Application Insights Management" +package_doc_id = "" +is_stable = false +is_arm = true diff --git a/azure-mgmt-applicationinsights/setup.cfg b/azure-mgmt-applicationinsights/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-applicationinsights/setup.cfg +++ b/azure-mgmt-applicationinsights/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-applicationinsights/setup.py b/azure-mgmt-applicationinsights/setup.py index 09a51a75c0230..5f95dcc02668a 100644 --- a/azure-mgmt-applicationinsights/setup.py +++ b/azure-mgmt-applicationinsights/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-applicationinsights" @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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=[ - 'msrestazure>=0.4.20,<2.0.0', + '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'], + } ) diff --git a/azure-mgmt-batchai/MANIFEST.in b/azure-mgmt-batchai/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-batchai/MANIFEST.in +++ b/azure-mgmt-batchai/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-batchai/README.rst b/azure-mgmt-batchai/README.rst index d562999e29b79..65fcfec76e3a4 100644 --- a/azure-mgmt-batchai/README.rst +++ b/azure-mgmt-batchai/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure Batch AI Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. diff --git a/azure-mgmt-batchai/azure/__init__.py b/azure-mgmt-batchai/azure/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-mgmt-batchai/azure/__init__.py +++ b/azure-mgmt-batchai/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-batchai/azure/mgmt/__init__.py b/azure-mgmt-batchai/azure/mgmt/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-mgmt-batchai/azure/mgmt/__init__.py +++ b/azure-mgmt-batchai/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-batchai/azure_bdist_wheel.py b/azure-mgmt-batchai/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-batchai/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-batchai/sdk_packaging.toml b/azure-mgmt-batchai/sdk_packaging.toml new file mode 100644 index 0000000000000..37777a8441e47 --- /dev/null +++ b/azure-mgmt-batchai/sdk_packaging.toml @@ -0,0 +1,7 @@ +[packaging] +package_name = "azure-mgmt-batchai" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "Batch AI Management" +package_doc_id = "batchai" +is_stable = true +is_arm = true diff --git a/azure-mgmt-batchai/setup.cfg b/azure-mgmt-batchai/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-batchai/setup.cfg +++ b/azure-mgmt-batchai/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-batchai/setup.py b/azure-mgmt-batchai/setup.py index dbd12ff17775e..e79c25c9fb6d9 100644 --- a/azure-mgmt-batchai/setup.py +++ b/azure-mgmt-batchai/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-batchai" @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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=[ - 'msrestazure>=0.4.20,<2.0.0', + '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'], + } ) diff --git a/azure-mgmt-billing/MANIFEST.in b/azure-mgmt-billing/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-billing/MANIFEST.in +++ b/azure-mgmt-billing/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-billing/README.rst b/azure-mgmt-billing/README.rst index 945a404aaa532..7fbd5ada9c50c 100644 --- a/azure-mgmt-billing/README.rst +++ b/azure-mgmt-billing/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure Billing Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. @@ -37,7 +37,7 @@ Usage ===== For code examples, see `Billing -`__ +`__ on docs.microsoft.com. diff --git a/azure-mgmt-billing/azure/__init__.py b/azure-mgmt-billing/azure/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-mgmt-billing/azure/__init__.py +++ b/azure-mgmt-billing/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-billing/azure/mgmt/__init__.py b/azure-mgmt-billing/azure/mgmt/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-mgmt-billing/azure/mgmt/__init__.py +++ b/azure-mgmt-billing/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-billing/azure_bdist_wheel.py b/azure-mgmt-billing/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-billing/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-billing/sdk_packaging.toml b/azure-mgmt-billing/sdk_packaging.toml new file mode 100644 index 0000000000000..d3bfbb1072b0c --- /dev/null +++ b/azure-mgmt-billing/sdk_packaging.toml @@ -0,0 +1,7 @@ +[packaging] +package_name = "azure-mgmt-billing" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "Billing" +package_doc_id = "billing" +is_stable = false +is_arm = true diff --git a/azure-mgmt-billing/setup.cfg b/azure-mgmt-billing/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-billing/setup.cfg +++ b/azure-mgmt-billing/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-billing/setup.py b/azure-mgmt-billing/setup.py index e7e8f635cd995..8d3585c49983b 100644 --- a/azure-mgmt-billing/setup.py +++ b/azure-mgmt-billing/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-billing" @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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=[ - 'msrestazure>=0.4.20,<2.0.0', + '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'], + } ) diff --git a/azure-mgmt-cognitiveservices/MANIFEST.in b/azure-mgmt-cognitiveservices/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-cognitiveservices/MANIFEST.in +++ b/azure-mgmt-cognitiveservices/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-cognitiveservices/README.rst b/azure-mgmt-cognitiveservices/README.rst index 0ea301b72b84c..70de0c6a776f3 100644 --- a/azure-mgmt-cognitiveservices/README.rst +++ b/azure-mgmt-cognitiveservices/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure Cognitive Services Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. diff --git a/azure-mgmt-cognitiveservices/azure/__init__.py b/azure-mgmt-cognitiveservices/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-cognitiveservices/azure/__init__.py +++ b/azure-mgmt-cognitiveservices/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-cognitiveservices/azure/mgmt/__init__.py b/azure-mgmt-cognitiveservices/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-cognitiveservices/azure/mgmt/__init__.py +++ b/azure-mgmt-cognitiveservices/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-cognitiveservices/azure_bdist_wheel.py b/azure-mgmt-cognitiveservices/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-cognitiveservices/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-cognitiveservices/sdk_packaging.toml b/azure-mgmt-cognitiveservices/sdk_packaging.toml new file mode 100644 index 0000000000000..e859b4f246247 --- /dev/null +++ b/azure-mgmt-cognitiveservices/sdk_packaging.toml @@ -0,0 +1,7 @@ +[packaging] +package_name = "azure-mgmt-cognitiveservices" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "Cognitive Services Management" +package_doc_id = "cognitive-services" +is_stable = true +is_arm = true diff --git a/azure-mgmt-cognitiveservices/setup.cfg b/azure-mgmt-cognitiveservices/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-cognitiveservices/setup.cfg +++ b/azure-mgmt-cognitiveservices/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-cognitiveservices/setup.py b/azure-mgmt-cognitiveservices/setup.py index f6e9b649508be..ff87dc89f78cb 100644 --- a/azure-mgmt-cognitiveservices/setup.py +++ b/azure-mgmt-cognitiveservices/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-cognitiveservices" @@ -64,7 +58,7 @@ author_email='azpysdkhelp@microsoft.com', url='https://github.com/Azure/azure-sdk-for-python', classifiers=[ - 'Development Status :: 4 - Beta', + 'Development Status :: 5 - Production/Stable', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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=[ - 'msrestazure>=0.4.27,<2.0.0', + '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'], + } ) diff --git a/azure-mgmt-commerce/MANIFEST.in b/azure-mgmt-commerce/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-commerce/MANIFEST.in +++ b/azure-mgmt-commerce/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-commerce/README.rst b/azure-mgmt-commerce/README.rst index e33143e5977ac..5a3024744fe44 100644 --- a/azure-mgmt-commerce/README.rst +++ b/azure-mgmt-commerce/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure Commerce Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. diff --git a/azure-mgmt-commerce/azure/__init__.py b/azure-mgmt-commerce/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-commerce/azure/__init__.py +++ b/azure-mgmt-commerce/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-commerce/azure/mgmt/__init__.py b/azure-mgmt-commerce/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-commerce/azure/mgmt/__init__.py +++ b/azure-mgmt-commerce/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-commerce/azure_bdist_wheel.py b/azure-mgmt-commerce/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-commerce/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-commerce/sdk_packaging.toml b/azure-mgmt-commerce/sdk_packaging.toml new file mode 100644 index 0000000000000..30fa31f5124e7 --- /dev/null +++ b/azure-mgmt-commerce/sdk_packaging.toml @@ -0,0 +1,7 @@ +[packaging] +package_name = "azure-mgmt-commerce" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "Commerce" +package_doc_id = "commerce" +is_stable = false +is_arm = true diff --git a/azure-mgmt-commerce/setup.cfg b/azure-mgmt-commerce/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-commerce/setup.cfg +++ b/azure-mgmt-commerce/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-commerce/setup.py b/azure-mgmt-commerce/setup.py index 21a6666687863..c6a09509f4304 100644 --- a/azure-mgmt-commerce/setup.py +++ b/azure-mgmt-commerce/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-commerce" @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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=[ - 'msrestazure>=0.4.20,<2.0.0', + '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'], + } ) diff --git a/azure-mgmt-consumption/MANIFEST.in b/azure-mgmt-consumption/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-consumption/MANIFEST.in +++ b/azure-mgmt-consumption/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-consumption/README.rst b/azure-mgmt-consumption/README.rst index 2ae9c2f9ef87f..c5aa4878ceccc 100644 --- a/azure-mgmt-consumption/README.rst +++ b/azure-mgmt-consumption/README.rst @@ -1,12 +1,12 @@ Microsoft Azure SDK for Python ============================== -This is the Microsoft Azure Consumption Management Client Library. +This is the Microsoft Azure Consumption Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. @@ -36,7 +36,7 @@ If you see azure==0.11.0 (or any version below 1.0), uninstall it first: Usage ===== -For code examples, see `Consumption Management +For code examples, see `Consumption `__ on docs.microsoft.com. diff --git a/azure-mgmt-consumption/azure/__init__.py b/azure-mgmt-consumption/azure/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-mgmt-consumption/azure/__init__.py +++ b/azure-mgmt-consumption/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-consumption/azure/mgmt/__init__.py b/azure-mgmt-consumption/azure/mgmt/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-mgmt-consumption/azure/mgmt/__init__.py +++ b/azure-mgmt-consumption/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-consumption/azure_bdist_wheel.py b/azure-mgmt-consumption/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-consumption/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-consumption/sdk_packaging.toml b/azure-mgmt-consumption/sdk_packaging.toml new file mode 100644 index 0000000000000..9d22f9d91e8e0 --- /dev/null +++ b/azure-mgmt-consumption/sdk_packaging.toml @@ -0,0 +1,7 @@ +[packaging] +package_name = "azure-mgmt-consumption" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "Consumption" +package_doc_id = "consumption" +is_stable = false +is_arm = true diff --git a/azure-mgmt-consumption/setup.cfg b/azure-mgmt-consumption/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-consumption/setup.cfg +++ b/azure-mgmt-consumption/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-consumption/setup.py b/azure-mgmt-consumption/setup.py index 9823c27b0e605..78596402b36d2 100644 --- a/azure-mgmt-consumption/setup.py +++ b/azure-mgmt-consumption/setup.py @@ -10,16 +10,10 @@ 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-consumption" -PACKAGE_PPRINT_NAME = "Consumption Management" +PACKAGE_PPRINT_NAME = "Consumption" # a-b-c => a/b/c package_folder_path = PACKAGE_NAME.replace('-', '/') @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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=[ - 'msrestazure>=0.4.20,<2.0.0', + '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'], + } ) diff --git a/azure-mgmt-cosmosdb/MANIFEST.in b/azure-mgmt-cosmosdb/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-cosmosdb/MANIFEST.in +++ b/azure-mgmt-cosmosdb/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-cosmosdb/README.rst b/azure-mgmt-cosmosdb/README.rst index 4a958d34b8db3..82bd979c7bf5e 100644 --- a/azure-mgmt-cosmosdb/README.rst +++ b/azure-mgmt-cosmosdb/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure Cosmos DB Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. @@ -36,7 +36,7 @@ If you see azure==0.11.0 (or any version below 1.0), uninstall it first: Usage ===== -For code examples, see `CosmosDB Management +For code examples, see `Cosmos DB Management `__ on docs.microsoft.com. diff --git a/azure-mgmt-cosmosdb/azure/__init__.py b/azure-mgmt-cosmosdb/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-cosmosdb/azure/__init__.py +++ b/azure-mgmt-cosmosdb/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-cosmosdb/azure/mgmt/__init__.py b/azure-mgmt-cosmosdb/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/__init__.py +++ b/azure-mgmt-cosmosdb/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-cosmosdb/azure_bdist_wheel.py b/azure-mgmt-cosmosdb/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-cosmosdb/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-cosmosdb/sdk_packaging.toml b/azure-mgmt-cosmosdb/sdk_packaging.toml new file mode 100644 index 0000000000000..fca0c23c016e6 --- /dev/null +++ b/azure-mgmt-cosmosdb/sdk_packaging.toml @@ -0,0 +1,7 @@ +[packaging] +package_name = "azure-mgmt-cosmosdb" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "Cosmos DB Management" +package_doc_id = "cosmosdb" +is_stable = false +is_arm = true diff --git a/azure-mgmt-cosmosdb/setup.cfg b/azure-mgmt-cosmosdb/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-cosmosdb/setup.cfg +++ b/azure-mgmt-cosmosdb/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-cosmosdb/setup.py b/azure-mgmt-cosmosdb/setup.py index e6eefb660f173..4bec3ee72d0e9 100644 --- a/azure-mgmt-cosmosdb/setup.py +++ b/azure-mgmt-cosmosdb/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-cosmosdb" @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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=[ - 'msrestazure>=0.4.20,<2.0.0', + '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'], + } ) diff --git a/azure-mgmt-datafactory/MANIFEST.in b/azure-mgmt-datafactory/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-datafactory/MANIFEST.in +++ b/azure-mgmt-datafactory/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-datafactory/README.rst b/azure-mgmt-datafactory/README.rst index 1d331b91cec5a..04ec9cafb387e 100644 --- a/azure-mgmt-datafactory/README.rst +++ b/azure-mgmt-datafactory/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure Data Factory Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. @@ -36,7 +36,7 @@ If you see azure==0.11.0 (or any version below 1.0), uninstall it first: Usage ===== -For code examples, see `DataFactory Management +For code examples, see `Data Factory Management `__ on docs.microsoft.com. diff --git a/azure-mgmt-datafactory/azure/__init__.py b/azure-mgmt-datafactory/azure/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-mgmt-datafactory/azure/__init__.py +++ b/azure-mgmt-datafactory/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-datafactory/azure/mgmt/__init__.py b/azure-mgmt-datafactory/azure/mgmt/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-mgmt-datafactory/azure/mgmt/__init__.py +++ b/azure-mgmt-datafactory/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-datafactory/azure_bdist_wheel.py b/azure-mgmt-datafactory/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-datafactory/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-datafactory/sdk_packaging.toml b/azure-mgmt-datafactory/sdk_packaging.toml new file mode 100644 index 0000000000000..9aeaa41a975a4 --- /dev/null +++ b/azure-mgmt-datafactory/sdk_packaging.toml @@ -0,0 +1,7 @@ +[packaging] +package_name = "azure-mgmt-datafactory" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "Data Factory Management" +package_doc_id = "datafactory" +is_stable = false +is_arm = true diff --git a/azure-mgmt-datafactory/setup.cfg b/azure-mgmt-datafactory/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-datafactory/setup.cfg +++ b/azure-mgmt-datafactory/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-datafactory/setup.py b/azure-mgmt-datafactory/setup.py index 94a4f2de250d2..4b3ca4777aca0 100644 --- a/azure-mgmt-datafactory/setup.py +++ b/azure-mgmt-datafactory/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-datafactory" @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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=[ - 'msrestazure>=0.4.20,<2.0.0', + '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'], + } ) diff --git a/azure-mgmt-devtestlabs/MANIFEST.in b/azure-mgmt-devtestlabs/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-devtestlabs/MANIFEST.in +++ b/azure-mgmt-devtestlabs/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-devtestlabs/README.rst b/azure-mgmt-devtestlabs/README.rst index 0fc0da3a061ff..09b0c54db4db8 100644 --- a/azure-mgmt-devtestlabs/README.rst +++ b/azure-mgmt-devtestlabs/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure DevTestLabs Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. diff --git a/azure-mgmt-devtestlabs/azure/__init__.py b/azure-mgmt-devtestlabs/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-devtestlabs/azure/__init__.py +++ b/azure-mgmt-devtestlabs/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-devtestlabs/azure/mgmt/__init__.py b/azure-mgmt-devtestlabs/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-devtestlabs/azure/mgmt/__init__.py +++ b/azure-mgmt-devtestlabs/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-devtestlabs/azure_bdist_wheel.py b/azure-mgmt-devtestlabs/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-devtestlabs/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-devtestlabs/sdk_packaging.toml b/azure-mgmt-devtestlabs/sdk_packaging.toml new file mode 100644 index 0000000000000..8bcd468c8d600 --- /dev/null +++ b/azure-mgmt-devtestlabs/sdk_packaging.toml @@ -0,0 +1,7 @@ +[packaging] +package_name = "azure-mgmt-devtestlabs" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "DevTestLabs Management" +package_doc_id = "devtest-labs" +is_stable = true +is_arm = true diff --git a/azure-mgmt-devtestlabs/setup.cfg b/azure-mgmt-devtestlabs/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-devtestlabs/setup.cfg +++ b/azure-mgmt-devtestlabs/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-devtestlabs/setup.py b/azure-mgmt-devtestlabs/setup.py index c4275b45c75b7..c74bcc7d5281f 100644 --- a/azure-mgmt-devtestlabs/setup.py +++ b/azure-mgmt-devtestlabs/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-devtestlabs" @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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=[ - 'msrestazure>=0.4.20,<2.0.0', + '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'], + } ) diff --git a/azure-mgmt-documentdb/azure/__init__.py b/azure-mgmt-documentdb/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-documentdb/azure/__init__.py +++ b/azure-mgmt-documentdb/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-documentdb/azure/mgmt/__init__.py b/azure-mgmt-documentdb/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-documentdb/azure/mgmt/__init__.py +++ b/azure-mgmt-documentdb/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-documentdb/sdk_packaging.toml b/azure-mgmt-documentdb/sdk_packaging.toml new file mode 100644 index 0000000000000..e7687fdae93bc --- /dev/null +++ b/azure-mgmt-documentdb/sdk_packaging.toml @@ -0,0 +1,2 @@ +[packaging] +auto_update = false \ No newline at end of file diff --git a/azure-mgmt-eventgrid/MANIFEST.in b/azure-mgmt-eventgrid/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-eventgrid/MANIFEST.in +++ b/azure-mgmt-eventgrid/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-eventgrid/README.rst b/azure-mgmt-eventgrid/README.rst index 1ec01a03bffe2..7792414c6dda0 100644 --- a/azure-mgmt-eventgrid/README.rst +++ b/azure-mgmt-eventgrid/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure EventGrid Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. @@ -37,7 +37,7 @@ Usage ===== For code examples, see `EventGrid Management -`__ +`__ on docs.microsoft.com. diff --git a/azure-mgmt-eventgrid/azure/__init__.py b/azure-mgmt-eventgrid/azure/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-mgmt-eventgrid/azure/__init__.py +++ b/azure-mgmt-eventgrid/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-eventgrid/azure/mgmt/__init__.py b/azure-mgmt-eventgrid/azure/mgmt/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-mgmt-eventgrid/azure/mgmt/__init__.py +++ b/azure-mgmt-eventgrid/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-eventgrid/azure_bdist_wheel.py b/azure-mgmt-eventgrid/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-eventgrid/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-eventgrid/sdk_packaging.toml b/azure-mgmt-eventgrid/sdk_packaging.toml new file mode 100644 index 0000000000000..e23ce4df07abb --- /dev/null +++ b/azure-mgmt-eventgrid/sdk_packaging.toml @@ -0,0 +1,7 @@ +[packaging] +package_name = "azure-mgmt-eventgrid" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "EventGrid Management" +package_doc_id = "event-grid" +is_stable = false +is_arm = true diff --git a/azure-mgmt-eventgrid/setup.cfg b/azure-mgmt-eventgrid/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-eventgrid/setup.cfg +++ b/azure-mgmt-eventgrid/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-eventgrid/setup.py b/azure-mgmt-eventgrid/setup.py index 8323ed33996b2..8fd5d1b00bded 100644 --- a/azure-mgmt-eventgrid/setup.py +++ b/azure-mgmt-eventgrid/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-eventgrid" @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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=[ - 'msrestazure>=0.4.27,<2.0.0', + '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'], + } ) diff --git a/azure-mgmt-iothubprovisioningservices/MANIFEST.in b/azure-mgmt-iothubprovisioningservices/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-iothubprovisioningservices/MANIFEST.in +++ b/azure-mgmt-iothubprovisioningservices/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-iothubprovisioningservices/README.rst b/azure-mgmt-iothubprovisioningservices/README.rst index 8866c376cdbe8..875e40fd73d35 100644 --- a/azure-mgmt-iothubprovisioningservices/README.rst +++ b/azure-mgmt-iothubprovisioningservices/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure IoTHub Provisioning Services Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. diff --git a/azure-mgmt-iothubprovisioningservices/azure/__init__.py b/azure-mgmt-iothubprovisioningservices/azure/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-mgmt-iothubprovisioningservices/azure/__init__.py +++ b/azure-mgmt-iothubprovisioningservices/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-iothubprovisioningservices/azure/mgmt/__init__.py b/azure-mgmt-iothubprovisioningservices/azure/mgmt/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-mgmt-iothubprovisioningservices/azure/mgmt/__init__.py +++ b/azure-mgmt-iothubprovisioningservices/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-iothubprovisioningservices/azure_bdist_wheel.py b/azure-mgmt-iothubprovisioningservices/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-iothubprovisioningservices/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-iothubprovisioningservices/sdk_packaging.toml b/azure-mgmt-iothubprovisioningservices/sdk_packaging.toml new file mode 100644 index 0000000000000..4a5b1deca17f9 --- /dev/null +++ b/azure-mgmt-iothubprovisioningservices/sdk_packaging.toml @@ -0,0 +1,7 @@ +[packaging] +package_name = "azure-mgmt-iothubprovisioningservices" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "IoTHub Provisioning Services" +package_doc_id = "iot" +is_stable = false +is_arm = true diff --git a/azure-mgmt-iothubprovisioningservices/setup.cfg b/azure-mgmt-iothubprovisioningservices/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-iothubprovisioningservices/setup.cfg +++ b/azure-mgmt-iothubprovisioningservices/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-iothubprovisioningservices/setup.py b/azure-mgmt-iothubprovisioningservices/setup.py index f8d19f74c507f..456f8bc235cb9 100644 --- a/azure-mgmt-iothubprovisioningservices/setup.py +++ b/azure-mgmt-iothubprovisioningservices/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-iothubprovisioningservices" @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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=[ - 'msrestazure>=0.4.20,<2.0.0', + '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'], + } ) diff --git a/azure-mgmt-managementpartner/MANIFEST.in b/azure-mgmt-managementpartner/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-managementpartner/MANIFEST.in +++ b/azure-mgmt-managementpartner/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-managementpartner/README.rst b/azure-mgmt-managementpartner/README.rst index d1e577c52b276..1a9601ca680cc 100644 --- a/azure-mgmt-managementpartner/README.rst +++ b/azure-mgmt-managementpartner/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure ManagementPartner Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.3, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. @@ -36,7 +36,9 @@ If you see azure==0.11.0 (or any version below 1.0), uninstall it first: Usage ===== -no examples yet +For code examples, see `ManagementPartner Management +`__ +on docs.microsoft.com. Provide Feedback diff --git a/azure-mgmt-managementpartner/azure/__init__.py b/azure-mgmt-managementpartner/azure/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-mgmt-managementpartner/azure/__init__.py +++ b/azure-mgmt-managementpartner/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-managementpartner/azure/mgmt/__init__.py b/azure-mgmt-managementpartner/azure/mgmt/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-mgmt-managementpartner/azure/mgmt/__init__.py +++ b/azure-mgmt-managementpartner/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-managementpartner/azure_bdist_wheel.py b/azure-mgmt-managementpartner/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-managementpartner/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-managementpartner/sdk_packaging.toml b/azure-mgmt-managementpartner/sdk_packaging.toml new file mode 100644 index 0000000000000..c3130a6630447 --- /dev/null +++ b/azure-mgmt-managementpartner/sdk_packaging.toml @@ -0,0 +1,7 @@ +[packaging] +package_name = "azure-mgmt-managementpartner" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "ManagementPartner Management" +package_doc_id = "" +is_stable = false +is_arm = true diff --git a/azure-mgmt-managementpartner/setup.cfg b/azure-mgmt-managementpartner/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-managementpartner/setup.cfg +++ b/azure-mgmt-managementpartner/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-managementpartner/setup.py b/azure-mgmt-managementpartner/setup.py index 0691da19ad351..4f2d5c01c87ab 100644 --- a/azure-mgmt-managementpartner/setup.py +++ b/azure-mgmt-managementpartner/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-managementpartner" @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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=[ - 'msrestazure>=0.4.20,<2.0.0', + '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'], + } ) diff --git a/azure-mgmt-maps/MANIFEST.in b/azure-mgmt-maps/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-maps/MANIFEST.in +++ b/azure-mgmt-maps/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-maps/README.rst b/azure-mgmt-maps/README.rst index dce98f14d369b..b5d13ab9f75c3 100644 --- a/azure-mgmt-maps/README.rst +++ b/azure-mgmt-maps/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure Maps Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. @@ -37,7 +37,7 @@ Usage ===== For code examples, see `Maps -`__ +`__ on docs.microsoft.com. diff --git a/azure-mgmt-maps/azure/__init__.py b/azure-mgmt-maps/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-maps/azure/__init__.py +++ b/azure-mgmt-maps/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-maps/azure/mgmt/__init__.py b/azure-mgmt-maps/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-maps/azure/mgmt/__init__.py +++ b/azure-mgmt-maps/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-maps/azure_bdist_wheel.py b/azure-mgmt-maps/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-maps/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-maps/sdk_packaging.toml b/azure-mgmt-maps/sdk_packaging.toml new file mode 100644 index 0000000000000..d5bdfdc4180e4 --- /dev/null +++ b/azure-mgmt-maps/sdk_packaging.toml @@ -0,0 +1,7 @@ +[packaging] +package_name = "azure-mgmt-maps" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "Maps" +package_doc_id = "" +is_stable = false +is_arm = true diff --git a/azure-mgmt-maps/setup.cfg b/azure-mgmt-maps/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-maps/setup.cfg +++ b/azure-mgmt-maps/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-maps/setup.py b/azure-mgmt-maps/setup.py index c9454a079e725..b2a19d8b995d8 100644 --- a/azure-mgmt-maps/setup.py +++ b/azure-mgmt-maps/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-maps" @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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=[ - 'msrestazure>=0.4.27,<2.0.0', + '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'], + } ) diff --git a/azure-mgmt-marketplaceordering/MANIFEST.in b/azure-mgmt-marketplaceordering/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-marketplaceordering/MANIFEST.in +++ b/azure-mgmt-marketplaceordering/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-marketplaceordering/README.rst b/azure-mgmt-marketplaceordering/README.rst index 328e2c3e28f50..beb100b029fc9 100644 --- a/azure-mgmt-marketplaceordering/README.rst +++ b/azure-mgmt-marketplaceordering/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure Market Place Ordering Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. @@ -37,7 +37,7 @@ Usage ===== For code examples, see `Market Place Ordering -`__ +`__ on docs.microsoft.com. diff --git a/azure-mgmt-marketplaceordering/azure/__init__.py b/azure-mgmt-marketplaceordering/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-marketplaceordering/azure/__init__.py +++ b/azure-mgmt-marketplaceordering/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-marketplaceordering/azure/mgmt/__init__.py b/azure-mgmt-marketplaceordering/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-marketplaceordering/azure/mgmt/__init__.py +++ b/azure-mgmt-marketplaceordering/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-marketplaceordering/azure_bdist_wheel.py b/azure-mgmt-marketplaceordering/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-marketplaceordering/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-marketplaceordering/sdk_packaging.toml b/azure-mgmt-marketplaceordering/sdk_packaging.toml new file mode 100644 index 0000000000000..11e17b4459cdf --- /dev/null +++ b/azure-mgmt-marketplaceordering/sdk_packaging.toml @@ -0,0 +1,7 @@ +[packaging] +package_name = "azure-mgmt-marketplaceordering" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "Market Place Ordering" +package_doc_id = "" +is_stable = false +is_arm = true diff --git a/azure-mgmt-marketplaceordering/setup.cfg b/azure-mgmt-marketplaceordering/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-marketplaceordering/setup.cfg +++ b/azure-mgmt-marketplaceordering/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-marketplaceordering/setup.py b/azure-mgmt-marketplaceordering/setup.py index 7d54ced525766..14af2b977719d 100644 --- a/azure-mgmt-marketplaceordering/setup.py +++ b/azure-mgmt-marketplaceordering/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-marketplaceordering" @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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=[ - 'msrestazure>=0.4.20,<2.0.0', + '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'], + } ) diff --git a/azure-mgmt-policyinsights/MANIFEST.in b/azure-mgmt-policyinsights/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-policyinsights/MANIFEST.in +++ b/azure-mgmt-policyinsights/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-policyinsights/README.rst b/azure-mgmt-policyinsights/README.rst index ed70aaf0537f0..9fbe107ff4563 100644 --- a/azure-mgmt-policyinsights/README.rst +++ b/azure-mgmt-policyinsights/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure Policy Insights Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. @@ -37,7 +37,7 @@ Usage ===== For code examples, see `Policy Insights -`__ +`__ on docs.microsoft.com. diff --git a/azure-mgmt-policyinsights/azure/__init__.py b/azure-mgmt-policyinsights/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-policyinsights/azure/__init__.py +++ b/azure-mgmt-policyinsights/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-policyinsights/azure/mgmt/__init__.py b/azure-mgmt-policyinsights/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-policyinsights/azure/mgmt/__init__.py +++ b/azure-mgmt-policyinsights/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-policyinsights/azure_bdist_wheel.py b/azure-mgmt-policyinsights/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-policyinsights/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-policyinsights/sdk_packaging.toml b/azure-mgmt-policyinsights/sdk_packaging.toml new file mode 100644 index 0000000000000..b1f106a899ce0 --- /dev/null +++ b/azure-mgmt-policyinsights/sdk_packaging.toml @@ -0,0 +1,7 @@ +[packaging] +package_name = "azure-mgmt-policyinsights" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "Policy Insights" +package_doc_id = "" +is_stable = false +is_arm = true diff --git a/azure-mgmt-policyinsights/setup.cfg b/azure-mgmt-policyinsights/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-policyinsights/setup.cfg +++ b/azure-mgmt-policyinsights/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-policyinsights/setup.py b/azure-mgmt-policyinsights/setup.py index ed08d16233683..f8a123157ec80 100644 --- a/azure-mgmt-policyinsights/setup.py +++ b/azure-mgmt-policyinsights/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-policyinsights" @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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=[ - 'msrestazure>=0.4.27,<2.0.0', + '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'], + } ) diff --git a/azure-mgmt-redis/MANIFEST.in b/azure-mgmt-redis/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-redis/MANIFEST.in +++ b/azure-mgmt-redis/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-redis/README.rst b/azure-mgmt-redis/README.rst index af688d055ff01..a9fad04b31f7b 100644 --- a/azure-mgmt-redis/README.rst +++ b/azure-mgmt-redis/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure Redis Cache Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. diff --git a/azure-mgmt-redis/azure/__init__.py b/azure-mgmt-redis/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-redis/azure/__init__.py +++ b/azure-mgmt-redis/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-redis/azure/mgmt/__init__.py b/azure-mgmt-redis/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-redis/azure/mgmt/__init__.py +++ b/azure-mgmt-redis/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-redis/azure_bdist_wheel.py b/azure-mgmt-redis/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-redis/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-redis/sdk_packaging.toml b/azure-mgmt-redis/sdk_packaging.toml new file mode 100644 index 0000000000000..697bf3080149e --- /dev/null +++ b/azure-mgmt-redis/sdk_packaging.toml @@ -0,0 +1,7 @@ +[packaging] +package_name = "azure-mgmt-redis" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "Redis Cache Management" +package_doc_id = "redis" +is_stable = true +is_arm = true diff --git a/azure-mgmt-redis/setup.cfg b/azure-mgmt-redis/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-redis/setup.cfg +++ b/azure-mgmt-redis/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-redis/setup.py b/azure-mgmt-redis/setup.py index 17430393a5489..e9f9148f8e991 100644 --- a/azure-mgmt-redis/setup.py +++ b/azure-mgmt-redis/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-redis" @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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=[ - 'msrestazure>=0.4.20,<2.0.0', + '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'], + } ) diff --git a/azure-mgmt-relay/MANIFEST.in b/azure-mgmt-relay/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-relay/MANIFEST.in +++ b/azure-mgmt-relay/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-relay/README.rst b/azure-mgmt-relay/README.rst index b1ceb983533cb..ce87a46bd7c7f 100644 --- a/azure-mgmt-relay/README.rst +++ b/azure-mgmt-relay/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure Relay Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. @@ -37,7 +37,7 @@ Usage ===== For code examples, see `Relay -`__ +`__ on docs.microsoft.com. diff --git a/azure-mgmt-relay/azure/__init__.py b/azure-mgmt-relay/azure/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-mgmt-relay/azure/__init__.py +++ b/azure-mgmt-relay/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-relay/azure/mgmt/__init__.py b/azure-mgmt-relay/azure/mgmt/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-mgmt-relay/azure/mgmt/__init__.py +++ b/azure-mgmt-relay/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-relay/azure_bdist_wheel.py b/azure-mgmt-relay/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-relay/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-relay/sdk_packaging.toml b/azure-mgmt-relay/sdk_packaging.toml new file mode 100644 index 0000000000000..cef981a1a9f13 --- /dev/null +++ b/azure-mgmt-relay/sdk_packaging.toml @@ -0,0 +1,7 @@ +[packaging] +package_name = "azure-mgmt-relay" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "Relay" +package_doc_id = "relay" +is_stable = false +is_arm = true diff --git a/azure-mgmt-relay/setup.cfg b/azure-mgmt-relay/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-relay/setup.cfg +++ b/azure-mgmt-relay/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-relay/setup.py b/azure-mgmt-relay/setup.py index b7242e80f5977..eca5fb38f1204 100644 --- a/azure-mgmt-relay/setup.py +++ b/azure-mgmt-relay/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-relay" @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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=[ - 'msrestazure>=0.4.20,<2.0.0', + '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'], + } ) diff --git a/azure-mgmt-search/MANIFEST.in b/azure-mgmt-search/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-search/MANIFEST.in +++ b/azure-mgmt-search/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-search/README.rst b/azure-mgmt-search/README.rst index 20f634c325909..d0a245b81b69c 100644 --- a/azure-mgmt-search/README.rst +++ b/azure-mgmt-search/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure Search Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. diff --git a/azure-mgmt-search/azure/__init__.py b/azure-mgmt-search/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-search/azure/__init__.py +++ b/azure-mgmt-search/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-search/azure/mgmt/__init__.py b/azure-mgmt-search/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-search/azure/mgmt/__init__.py +++ b/azure-mgmt-search/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-search/azure_bdist_wheel.py b/azure-mgmt-search/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-search/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-search/sdk_packaging.toml b/azure-mgmt-search/sdk_packaging.toml new file mode 100644 index 0000000000000..da7f6badb68b4 --- /dev/null +++ b/azure-mgmt-search/sdk_packaging.toml @@ -0,0 +1,7 @@ +[packaging] +package_name = "azure-mgmt-search" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "Search Management" +package_doc_id = "search" +is_stable = false +is_arm = true diff --git a/azure-mgmt-search/setup.cfg b/azure-mgmt-search/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-search/setup.cfg +++ b/azure-mgmt-search/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-search/setup.py b/azure-mgmt-search/setup.py index d9147216639ba..e429c58e63147 100644 --- a/azure-mgmt-search/setup.py +++ b/azure-mgmt-search/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-search" @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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=[ - 'msrestazure>=0.4.27,<2.0.0', + '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'], + } ) diff --git a/azure-mgmt-subscription/MANIFEST.in b/azure-mgmt-subscription/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-subscription/MANIFEST.in +++ b/azure-mgmt-subscription/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-subscription/README.rst b/azure-mgmt-subscription/README.rst index 24a1ed35f1955..7b10f46ab760d 100644 --- a/azure-mgmt-subscription/README.rst +++ b/azure-mgmt-subscription/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure Subscription Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. @@ -37,7 +37,7 @@ Usage ===== For code examples, see `Subscription Management -`__ +`__ on docs.microsoft.com. diff --git a/azure-mgmt-subscription/azure/__init__.py b/azure-mgmt-subscription/azure/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-mgmt-subscription/azure/__init__.py +++ b/azure-mgmt-subscription/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-subscription/azure/mgmt/__init__.py b/azure-mgmt-subscription/azure/mgmt/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-mgmt-subscription/azure/mgmt/__init__.py +++ b/azure-mgmt-subscription/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-subscription/azure_bdist_wheel.py b/azure-mgmt-subscription/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-subscription/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-subscription/sdk_packaging.toml b/azure-mgmt-subscription/sdk_packaging.toml new file mode 100644 index 0000000000000..2f5ab7bab8bd4 --- /dev/null +++ b/azure-mgmt-subscription/sdk_packaging.toml @@ -0,0 +1,7 @@ +[packaging] +package_name = "azure-mgmt-subscription" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "Subscription Management" +package_doc_id = "" +is_stable = false +is_arm = true diff --git a/azure-mgmt-subscription/setup.cfg b/azure-mgmt-subscription/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-subscription/setup.cfg +++ b/azure-mgmt-subscription/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-subscription/setup.py b/azure-mgmt-subscription/setup.py index e390e5391cd6e..65141593bea4a 100644 --- a/azure-mgmt-subscription/setup.py +++ b/azure-mgmt-subscription/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-subscription" @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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=[ - 'msrestazure>=0.4.20,<2.0.0', + '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'], + } ) From f0bd18f83c207f56fde9091eddc90612d46ab313 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Mon, 24 Sep 2018 16:00:59 -0700 Subject: [PATCH 14/23] Manual pkgutil for not auto-update --- azure-batch/azure/__init__.py | 2 +- azure-servicebus/azure/__init__.py | 2 +- azure-servicemanagement-legacy/azure/__init__.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-batch/azure/__init__.py b/azure-batch/azure/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-batch/azure/__init__.py +++ b/azure-batch/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-servicebus/azure/__init__.py b/azure-servicebus/azure/__init__.py index 849489fca33cc..56200e1b95c58 100644 --- a/azure-servicebus/azure/__init__.py +++ b/azure-servicebus/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-servicemanagement-legacy/azure/__init__.py b/azure-servicemanagement-legacy/azure/__init__.py index 849489fca33cc..56200e1b95c58 100644 --- a/azure-servicemanagement-legacy/azure/__init__.py +++ b/azure-servicemanagement-legacy/azure/__init__.py @@ -1 +1 @@ -__import__('pkg_resources').declare_namespace(__name__) +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file From 2efc91f46e7110497b26332bc8a36b221aa31435 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Mon, 24 Sep 2018 16:01:44 -0700 Subject: [PATCH 15/23] Batch commit all package with already a toml --- azure-mgmt-alertsmanagement/MANIFEST.in | 1 - azure-mgmt-alertsmanagement/azure/__init__.py | 2 +- .../azure/mgmt/__init__.py | 2 +- .../azure_bdist_wheel.py | 54 ------------------- azure-mgmt-alertsmanagement/setup.cfg | 1 - azure-mgmt-alertsmanagement/setup.py | 17 +++--- azure-mgmt-authorization/MANIFEST.in | 1 - azure-mgmt-authorization/README.rst | 2 +- azure-mgmt-authorization/azure/__init__.py | 2 +- .../azure/mgmt/__init__.py | 2 +- azure-mgmt-authorization/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-authorization/setup.cfg | 1 - azure-mgmt-authorization/setup.py | 23 ++++---- azure-mgmt-batch/MANIFEST.in | 1 - azure-mgmt-batch/README.rst | 16 ++++-- azure-mgmt-batch/azure/__init__.py | 2 +- azure-mgmt-batch/azure/mgmt/__init__.py | 2 +- azure-mgmt-batch/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-batch/setup.cfg | 1 - azure-mgmt-batch/setup.py | 21 ++++---- azure-mgmt-botservice/MANIFEST.in | 1 - azure-mgmt-botservice/azure/__init__.py | 2 +- azure-mgmt-botservice/azure/mgmt/__init__.py | 2 +- azure-mgmt-botservice/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-botservice/setup.cfg | 1 - azure-mgmt-botservice/setup.py | 17 +++--- azure-mgmt-cdn/MANIFEST.in | 1 - azure-mgmt-cdn/README.rst | 2 +- azure-mgmt-cdn/azure/__init__.py | 2 +- azure-mgmt-cdn/azure/mgmt/__init__.py | 2 +- azure-mgmt-cdn/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-cdn/setup.cfg | 1 - azure-mgmt-cdn/setup.py | 21 ++++---- azure-mgmt-compute/MANIFEST.in | 1 - azure-mgmt-compute/azure/__init__.py | 2 +- azure-mgmt-compute/azure/mgmt/__init__.py | 2 +- azure-mgmt-compute/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-compute/setup.cfg | 1 - azure-mgmt-compute/setup.py | 17 +++--- azure-mgmt-containerinstance/MANIFEST.in | 1 - .../azure/__init__.py | 2 +- .../azure/mgmt/__init__.py | 2 +- .../azure_bdist_wheel.py | 54 ------------------- azure-mgmt-containerinstance/setup.cfg | 1 - azure-mgmt-containerinstance/setup.py | 17 +++--- azure-mgmt-containerregistry/MANIFEST.in | 1 - .../azure/__init__.py | 2 +- .../azure/mgmt/__init__.py | 2 +- .../azure_bdist_wheel.py | 54 ------------------- azure-mgmt-containerregistry/setup.cfg | 1 - azure-mgmt-containerregistry/setup.py | 17 +++--- azure-mgmt-containerservice/MANIFEST.in | 1 - azure-mgmt-containerservice/azure/__init__.py | 2 +- .../azure/mgmt/__init__.py | 2 +- .../azure_bdist_wheel.py | 54 ------------------- azure-mgmt-containerservice/setup.cfg | 1 - azure-mgmt-containerservice/setup.py | 17 +++--- azure-mgmt-datalake-analytics/MANIFEST.in | 1 - azure-mgmt-datalake-analytics/README.rst | 2 +- .../azure/__init__.py | 2 +- .../azure/mgmt/__init__.py | 2 +- .../azure/mgmt/datalake/__init__.py | 2 +- .../azure_bdist_wheel.py | 54 ------------------- azure-mgmt-datalake-analytics/setup.cfg | 1 - azure-mgmt-datalake-analytics/setup.py | 22 ++++---- azure-mgmt-datalake-store/MANIFEST.in | 1 - azure-mgmt-datalake-store/README.rst | 2 +- azure-mgmt-datalake-store/azure/__init__.py | 2 +- .../azure/mgmt/__init__.py | 2 +- .../azure/mgmt/datalake/__init__.py | 2 +- .../azure_bdist_wheel.py | 54 ------------------- azure-mgmt-datalake-store/setup.cfg | 1 - azure-mgmt-datalake-store/setup.py | 22 ++++---- azure-mgmt-datamigration/MANIFEST.in | 1 - azure-mgmt-datamigration/azure/__init__.py | 2 +- .../azure/mgmt/__init__.py | 2 +- azure-mgmt-datamigration/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-datamigration/setup.cfg | 1 - azure-mgmt-datamigration/setup.py | 17 +++--- azure-mgmt-devspaces/MANIFEST.in | 1 - azure-mgmt-devspaces/azure/__init__.py | 2 +- azure-mgmt-devspaces/azure/mgmt/__init__.py | 2 +- azure-mgmt-devspaces/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-devspaces/setup.cfg | 1 - azure-mgmt-devspaces/setup.py | 18 ++++--- azure-mgmt-dns/MANIFEST.in | 1 - azure-mgmt-dns/azure/__init__.py | 2 +- azure-mgmt-dns/azure/mgmt/__init__.py | 2 +- azure-mgmt-dns/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-dns/setup.cfg | 1 - azure-mgmt-dns/setup.py | 17 +++--- azure-mgmt-eventhub/MANIFEST.in | 1 - azure-mgmt-eventhub/azure/__init__.py | 2 +- azure-mgmt-eventhub/azure/mgmt/__init__.py | 2 +- azure-mgmt-eventhub/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-eventhub/setup.cfg | 1 - azure-mgmt-eventhub/setup.py | 17 +++--- azure-mgmt-hanaonazure/MANIFEST.in | 1 - azure-mgmt-hanaonazure/azure/__init__.py | 2 +- azure-mgmt-hanaonazure/azure/mgmt/__init__.py | 2 +- azure-mgmt-hanaonazure/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-hanaonazure/setup.cfg | 1 - azure-mgmt-hanaonazure/setup.py | 17 +++--- azure-mgmt-hdinsight/MANIFEST.in | 1 - azure-mgmt-hdinsight/azure/__init__.py | 2 +- azure-mgmt-hdinsight/azure/mgmt/__init__.py | 2 +- azure-mgmt-hdinsight/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-hdinsight/setup.cfg | 1 - azure-mgmt-hdinsight/setup.py | 17 +++--- azure-mgmt-iotcentral/MANIFEST.in | 1 - azure-mgmt-iotcentral/azure/__init__.py | 2 +- azure-mgmt-iotcentral/azure/mgmt/__init__.py | 2 +- azure-mgmt-iotcentral/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-iotcentral/setup.cfg | 1 - azure-mgmt-iotcentral/setup.py | 17 +++--- azure-mgmt-iothub/MANIFEST.in | 1 - 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 +++--- azure-mgmt-keyvault/MANIFEST.in | 1 - azure-mgmt-keyvault/README.rst | 5 +- azure-mgmt-keyvault/azure/__init__.py | 2 +- azure-mgmt-keyvault/azure/mgmt/__init__.py | 2 +- azure-mgmt-keyvault/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-keyvault/setup.cfg | 1 - azure-mgmt-keyvault/setup.py | 22 ++++---- azure-mgmt-kusto/MANIFEST.in | 1 - azure-mgmt-kusto/azure/__init__.py | 2 +- azure-mgmt-kusto/azure/mgmt/__init__.py | 2 +- azure-mgmt-kusto/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-kusto/setup.cfg | 1 - azure-mgmt-kusto/setup.py | 17 +++--- azure-mgmt-loganalytics/MANIFEST.in | 1 - azure-mgmt-loganalytics/README.rst | 2 +- azure-mgmt-loganalytics/azure/__init__.py | 2 +- .../azure/mgmt/__init__.py | 2 +- azure-mgmt-loganalytics/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-loganalytics/setup.cfg | 1 - azure-mgmt-loganalytics/setup.py | 21 ++++---- azure-mgmt-logic/MANIFEST.in | 1 - azure-mgmt-logic/README.rst | 2 +- azure-mgmt-logic/azure/__init__.py | 2 +- azure-mgmt-logic/azure/mgmt/__init__.py | 2 +- azure-mgmt-logic/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-logic/setup.cfg | 1 - azure-mgmt-logic/setup.py | 21 ++++---- azure-mgmt-machinelearningcompute/MANIFEST.in | 1 - azure-mgmt-machinelearningcompute/README.rst | 2 +- .../azure/__init__.py | 2 +- .../azure/mgmt/__init__.py | 2 +- .../azure_bdist_wheel.py | 54 ------------------- azure-mgmt-machinelearningcompute/setup.cfg | 1 - azure-mgmt-machinelearningcompute/setup.py | 21 ++++---- azure-mgmt-managementgroups/MANIFEST.in | 1 - azure-mgmt-managementgroups/README.rst | 2 +- azure-mgmt-managementgroups/azure/__init__.py | 2 +- .../azure/mgmt/__init__.py | 2 +- .../azure_bdist_wheel.py | 54 ------------------- azure-mgmt-managementgroups/setup.cfg | 1 - azure-mgmt-managementgroups/setup.py | 21 ++++---- azure-mgmt-media/MANIFEST.in | 1 - azure-mgmt-media/azure/__init__.py | 2 +- azure-mgmt-media/azure/mgmt/__init__.py | 2 +- azure-mgmt-media/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-media/setup.cfg | 1 - azure-mgmt-media/setup.py | 18 ++++--- azure-mgmt-monitor/MANIFEST.in | 1 - azure-mgmt-monitor/README.rst | 2 +- azure-mgmt-monitor/azure/__init__.py | 2 +- azure-mgmt-monitor/azure/mgmt/__init__.py | 2 +- azure-mgmt-monitor/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-monitor/setup.cfg | 1 - azure-mgmt-monitor/setup.py | 21 ++++---- azure-mgmt-msi/MANIFEST.in | 1 - azure-mgmt-msi/README.rst | 2 +- azure-mgmt-msi/azure/__init__.py | 2 +- azure-mgmt-msi/azure/mgmt/__init__.py | 2 +- azure-mgmt-msi/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-msi/setup.cfg | 1 - azure-mgmt-msi/setup.py | 21 ++++---- azure-mgmt-network/MANIFEST.in | 1 - azure-mgmt-network/azure/__init__.py | 2 +- azure-mgmt-network/azure/mgmt/__init__.py | 2 +- azure-mgmt-network/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-network/setup.cfg | 1 - azure-mgmt-network/setup.py | 17 +++--- azure-mgmt-notificationhubs/MANIFEST.in | 1 - azure-mgmt-notificationhubs/README.rst | 2 +- azure-mgmt-notificationhubs/azure/__init__.py | 2 +- .../azure/mgmt/__init__.py | 2 +- .../azure_bdist_wheel.py | 54 ------------------- azure-mgmt-notificationhubs/setup.cfg | 1 - azure-mgmt-notificationhubs/setup.py | 21 ++++---- azure-mgmt-powerbiembedded/MANIFEST.in | 1 - azure-mgmt-powerbiembedded/README.rst | 2 +- azure-mgmt-powerbiembedded/azure/__init__.py | 2 +- .../azure/mgmt/__init__.py | 2 +- .../azure_bdist_wheel.py | 54 ------------------- azure-mgmt-powerbiembedded/setup.cfg | 1 - azure-mgmt-powerbiembedded/setup.py | 21 ++++---- azure-mgmt-rdbms/MANIFEST.in | 1 - azure-mgmt-rdbms/azure/__init__.py | 2 +- azure-mgmt-rdbms/azure/mgmt/__init__.py | 2 +- azure-mgmt-rdbms/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-rdbms/setup.cfg | 1 - azure-mgmt-rdbms/setup.py | 17 +++--- azure-mgmt-recoveryservices/MANIFEST.in | 1 - azure-mgmt-recoveryservices/README.rst | 2 +- azure-mgmt-recoveryservices/azure/__init__.py | 2 +- .../azure/mgmt/__init__.py | 2 +- .../azure_bdist_wheel.py | 54 ------------------- azure-mgmt-recoveryservices/setup.cfg | 1 - azure-mgmt-recoveryservices/setup.py | 21 ++++---- azure-mgmt-recoveryservicesbackup/MANIFEST.in | 1 - azure-mgmt-recoveryservicesbackup/README.rst | 2 +- .../azure/__init__.py | 2 +- .../azure/mgmt/__init__.py | 2 +- .../azure_bdist_wheel.py | 54 ------------------- azure-mgmt-recoveryservicesbackup/setup.cfg | 1 - azure-mgmt-recoveryservicesbackup/setup.py | 21 ++++---- azure-mgmt-reservations/MANIFEST.in | 1 - azure-mgmt-reservations/azure/__init__.py | 2 +- .../azure/mgmt/__init__.py | 2 +- azure-mgmt-reservations/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-reservations/setup.cfg | 1 - azure-mgmt-reservations/setup.py | 17 +++--- azure-mgmt-resource/MANIFEST.in | 1 - azure-mgmt-resource/README.rst | 2 +- azure-mgmt-resource/azure/__init__.py | 2 +- azure-mgmt-resource/azure/mgmt/__init__.py | 2 +- azure-mgmt-resource/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-resource/setup.cfg | 1 - azure-mgmt-resource/setup.py | 23 ++++---- azure-mgmt-resourcegraph/MANIFEST.in | 1 - azure-mgmt-resourcegraph/azure/__init__.py | 2 +- .../azure/mgmt/__init__.py | 2 +- azure-mgmt-resourcegraph/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-resourcegraph/setup.cfg | 1 - azure-mgmt-resourcegraph/setup.py | 17 +++--- azure-mgmt-scheduler/MANIFEST.in | 1 - azure-mgmt-scheduler/README.rst | 2 +- azure-mgmt-scheduler/azure/__init__.py | 2 +- azure-mgmt-scheduler/azure/mgmt/__init__.py | 2 +- azure-mgmt-scheduler/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-scheduler/setup.cfg | 1 - azure-mgmt-scheduler/setup.py | 21 ++++---- azure-mgmt-servermanager/MANIFEST.in | 1 - azure-mgmt-servermanager/README.rst | 2 +- azure-mgmt-servermanager/azure/__init__.py | 2 +- .../azure/mgmt/__init__.py | 2 +- azure-mgmt-servermanager/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-servermanager/setup.cfg | 1 - azure-mgmt-servermanager/setup.py | 21 ++++---- azure-mgmt-servicebus/MANIFEST.in | 1 - azure-mgmt-servicebus/README.rst | 2 +- azure-mgmt-servicebus/azure/__init__.py | 2 +- azure-mgmt-servicebus/azure/mgmt/__init__.py | 2 +- azure-mgmt-servicebus/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-servicebus/setup.cfg | 1 - azure-mgmt-servicebus/setup.py | 20 +++---- azure-mgmt-servicefabric/MANIFEST.in | 1 - azure-mgmt-servicefabric/azure/__init__.py | 2 +- .../azure/mgmt/__init__.py | 2 +- azure-mgmt-servicefabric/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-servicefabric/setup.cfg | 1 - azure-mgmt-servicefabric/setup.py | 17 +++--- azure-mgmt-signalr/MANIFEST.in | 1 - azure-mgmt-signalr/azure/__init__.py | 2 +- azure-mgmt-signalr/azure/mgmt/__init__.py | 2 +- azure-mgmt-signalr/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-signalr/setup.cfg | 1 - azure-mgmt-signalr/setup.py | 17 +++--- azure-mgmt-sql/MANIFEST.in | 1 - azure-mgmt-sql/README.rst | 2 +- azure-mgmt-sql/azure/__init__.py | 2 +- azure-mgmt-sql/azure/mgmt/__init__.py | 2 +- azure-mgmt-sql/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-sql/setup.cfg | 1 - azure-mgmt-sql/setup.py | 21 ++++---- azure-mgmt-storage/MANIFEST.in | 1 - azure-mgmt-storage/azure/__init__.py | 2 +- azure-mgmt-storage/azure/mgmt/__init__.py | 2 +- azure-mgmt-storage/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-storage/setup.cfg | 1 - azure-mgmt-storage/setup.py | 20 +++---- azure-mgmt-trafficmanager/MANIFEST.in | 1 - azure-mgmt-trafficmanager/README.rst | 2 +- azure-mgmt-trafficmanager/azure/__init__.py | 2 +- .../azure/mgmt/__init__.py | 2 +- .../azure_bdist_wheel.py | 54 ------------------- azure-mgmt-trafficmanager/setup.cfg | 1 - azure-mgmt-trafficmanager/setup.py | 21 ++++---- azure-mgmt-web/MANIFEST.in | 1 - azure-mgmt-web/azure/__init__.py | 2 +- azure-mgmt-web/azure/mgmt/__init__.py | 2 +- azure-mgmt-web/azure_bdist_wheel.py | 54 ------------------- azure-mgmt-web/setup.cfg | 1 - azure-mgmt-web/setup.py | 17 +++--- 300 files changed, 617 insertions(+), 3089 deletions(-) delete mode 100644 azure-mgmt-alertsmanagement/azure_bdist_wheel.py delete mode 100644 azure-mgmt-authorization/azure_bdist_wheel.py delete mode 100644 azure-mgmt-batch/azure_bdist_wheel.py delete mode 100644 azure-mgmt-botservice/azure_bdist_wheel.py delete mode 100644 azure-mgmt-cdn/azure_bdist_wheel.py delete mode 100644 azure-mgmt-compute/azure_bdist_wheel.py delete mode 100644 azure-mgmt-containerinstance/azure_bdist_wheel.py delete mode 100644 azure-mgmt-containerregistry/azure_bdist_wheel.py delete mode 100644 azure-mgmt-containerservice/azure_bdist_wheel.py delete mode 100644 azure-mgmt-datalake-analytics/azure_bdist_wheel.py delete mode 100644 azure-mgmt-datalake-store/azure_bdist_wheel.py delete mode 100644 azure-mgmt-datamigration/azure_bdist_wheel.py delete mode 100644 azure-mgmt-devspaces/azure_bdist_wheel.py delete mode 100644 azure-mgmt-dns/azure_bdist_wheel.py delete mode 100644 azure-mgmt-eventhub/azure_bdist_wheel.py delete mode 100644 azure-mgmt-hanaonazure/azure_bdist_wheel.py delete mode 100644 azure-mgmt-hdinsight/azure_bdist_wheel.py delete mode 100644 azure-mgmt-iotcentral/azure_bdist_wheel.py delete mode 100644 azure-mgmt-iothub/azure_bdist_wheel.py delete mode 100644 azure-mgmt-keyvault/azure_bdist_wheel.py delete mode 100644 azure-mgmt-kusto/azure_bdist_wheel.py delete mode 100644 azure-mgmt-loganalytics/azure_bdist_wheel.py delete mode 100644 azure-mgmt-logic/azure_bdist_wheel.py delete mode 100644 azure-mgmt-machinelearningcompute/azure_bdist_wheel.py delete mode 100644 azure-mgmt-managementgroups/azure_bdist_wheel.py delete mode 100644 azure-mgmt-media/azure_bdist_wheel.py delete mode 100644 azure-mgmt-monitor/azure_bdist_wheel.py delete mode 100644 azure-mgmt-msi/azure_bdist_wheel.py delete mode 100644 azure-mgmt-network/azure_bdist_wheel.py delete mode 100644 azure-mgmt-notificationhubs/azure_bdist_wheel.py delete mode 100644 azure-mgmt-powerbiembedded/azure_bdist_wheel.py delete mode 100644 azure-mgmt-rdbms/azure_bdist_wheel.py delete mode 100644 azure-mgmt-recoveryservices/azure_bdist_wheel.py delete mode 100644 azure-mgmt-recoveryservicesbackup/azure_bdist_wheel.py delete mode 100644 azure-mgmt-reservations/azure_bdist_wheel.py delete mode 100644 azure-mgmt-resource/azure_bdist_wheel.py delete mode 100644 azure-mgmt-resourcegraph/azure_bdist_wheel.py delete mode 100644 azure-mgmt-scheduler/azure_bdist_wheel.py delete mode 100644 azure-mgmt-servermanager/azure_bdist_wheel.py delete mode 100644 azure-mgmt-servicebus/azure_bdist_wheel.py delete mode 100644 azure-mgmt-servicefabric/azure_bdist_wheel.py delete mode 100644 azure-mgmt-signalr/azure_bdist_wheel.py delete mode 100644 azure-mgmt-sql/azure_bdist_wheel.py delete mode 100644 azure-mgmt-storage/azure_bdist_wheel.py delete mode 100644 azure-mgmt-trafficmanager/azure_bdist_wheel.py delete mode 100644 azure-mgmt-web/azure_bdist_wheel.py diff --git a/azure-mgmt-alertsmanagement/MANIFEST.in b/azure-mgmt-alertsmanagement/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-alertsmanagement/MANIFEST.in +++ b/azure-mgmt-alertsmanagement/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-alertsmanagement/azure/__init__.py b/azure-mgmt-alertsmanagement/azure/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-mgmt-alertsmanagement/azure/__init__.py +++ b/azure-mgmt-alertsmanagement/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-alertsmanagement/azure/mgmt/__init__.py b/azure-mgmt-alertsmanagement/azure/mgmt/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-mgmt-alertsmanagement/azure/mgmt/__init__.py +++ b/azure-mgmt-alertsmanagement/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-alertsmanagement/azure_bdist_wheel.py b/azure-mgmt-alertsmanagement/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-alertsmanagement/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-alertsmanagement/setup.cfg b/azure-mgmt-alertsmanagement/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-alertsmanagement/setup.cfg +++ b/azure-mgmt-alertsmanagement/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-alertsmanagement/setup.py b/azure-mgmt-alertsmanagement/setup.py index 42249bcfcac55..129b94c14ea71 100644 --- a/azure-mgmt-alertsmanagement/setup.py +++ b/azure-mgmt-alertsmanagement/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-alertsmanagement" @@ -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'], + } ) diff --git a/azure-mgmt-authorization/MANIFEST.in b/azure-mgmt-authorization/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-authorization/MANIFEST.in +++ b/azure-mgmt-authorization/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-authorization/README.rst b/azure-mgmt-authorization/README.rst index efa1778dcf2c8..8c6bb060adbcb 100644 --- a/azure-mgmt-authorization/README.rst +++ b/azure-mgmt-authorization/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure Authorization Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. diff --git a/azure-mgmt-authorization/azure/__init__.py b/azure-mgmt-authorization/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-authorization/azure/__init__.py +++ b/azure-mgmt-authorization/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-authorization/azure/mgmt/__init__.py b/azure-mgmt-authorization/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-authorization/azure/mgmt/__init__.py +++ b/azure-mgmt-authorization/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-authorization/azure_bdist_wheel.py b/azure-mgmt-authorization/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-authorization/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-authorization/setup.cfg b/azure-mgmt-authorization/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-authorization/setup.cfg +++ b/azure-mgmt-authorization/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-authorization/setup.py b/azure-mgmt-authorization/setup.py index a53daab9138c3..2cf7b12ae953e 100644 --- a/azure-mgmt-authorization/setup.py +++ b/azure-mgmt-authorization/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-authorization" @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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=[ - 'msrestazure>=0.4.27,<2.0.0', - 'azure-common~=1.1,>=1.1.12', + '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'], + } ) diff --git a/azure-mgmt-batch/MANIFEST.in b/azure-mgmt-batch/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-batch/MANIFEST.in +++ b/azure-mgmt-batch/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-batch/README.rst b/azure-mgmt-batch/README.rst index ac09ede98675a..afb9cf4da8d38 100644 --- a/azure-mgmt-batch/README.rst +++ b/azure-mgmt-batch/README.rst @@ -3,7 +3,15 @@ Microsoft Azure SDK for Python This is the Microsoft Azure Batch Management Client Library. -This package has been tested with Python 2.7, 3.3, 3.4 and 3.5. +Azure Resource Manager (ARM) is the next generation of management APIs that +replace the old Azure Service Management (ASM). + +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. + +For the older Azure Service Management (ASM) libraries, see +`azure-servicemanagement-legacy `__ library. + +For a more complete set of Azure libraries, see the `azure `__ bundle package. Compatibility @@ -28,9 +36,9 @@ If you see azure==0.11.0 (or any version below 1.0), uninstall it first: Usage ===== -For code examples, see `the Batch samples repo -`__ -on GitHub. +For code examples, see `Batch Management +`__ +on docs.microsoft.com. Provide Feedback diff --git a/azure-mgmt-batch/azure/__init__.py b/azure-mgmt-batch/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-batch/azure/__init__.py +++ b/azure-mgmt-batch/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-batch/azure/mgmt/__init__.py b/azure-mgmt-batch/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-batch/azure/mgmt/__init__.py +++ b/azure-mgmt-batch/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-batch/azure_bdist_wheel.py b/azure-mgmt-batch/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-batch/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-batch/setup.cfg b/azure-mgmt-batch/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-batch/setup.cfg +++ b/azure-mgmt-batch/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-batch/setup.py b/azure-mgmt-batch/setup.py index 3498c2e0f75c7..b40cb2d0f5756 100644 --- a/azure-mgmt-batch/setup.py +++ b/azure-mgmt-batch/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-batch" @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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=[ - 'msrestazure>=0.4.27,<2.0.0', + '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'], + } ) diff --git a/azure-mgmt-botservice/MANIFEST.in b/azure-mgmt-botservice/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-botservice/MANIFEST.in +++ b/azure-mgmt-botservice/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-botservice/azure/__init__.py b/azure-mgmt-botservice/azure/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-mgmt-botservice/azure/__init__.py +++ b/azure-mgmt-botservice/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-botservice/azure/mgmt/__init__.py b/azure-mgmt-botservice/azure/mgmt/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-mgmt-botservice/azure/mgmt/__init__.py +++ b/azure-mgmt-botservice/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-botservice/azure_bdist_wheel.py b/azure-mgmt-botservice/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-botservice/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-botservice/setup.cfg b/azure-mgmt-botservice/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-botservice/setup.cfg +++ b/azure-mgmt-botservice/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-botservice/setup.py b/azure-mgmt-botservice/setup.py index 55d4f7b6312e6..872ed3e7cb2b9 100644 --- a/azure-mgmt-botservice/setup.py +++ b/azure-mgmt-botservice/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-botservice" @@ -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'], + } ) diff --git a/azure-mgmt-cdn/MANIFEST.in b/azure-mgmt-cdn/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-cdn/MANIFEST.in +++ b/azure-mgmt-cdn/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-cdn/README.rst b/azure-mgmt-cdn/README.rst index 3943e79785f4b..a5684161b0d19 100644 --- a/azure-mgmt-cdn/README.rst +++ b/azure-mgmt-cdn/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure CDN Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. diff --git a/azure-mgmt-cdn/azure/__init__.py b/azure-mgmt-cdn/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-cdn/azure/__init__.py +++ b/azure-mgmt-cdn/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-cdn/azure/mgmt/__init__.py b/azure-mgmt-cdn/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-cdn/azure/mgmt/__init__.py +++ b/azure-mgmt-cdn/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-cdn/azure_bdist_wheel.py b/azure-mgmt-cdn/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-cdn/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-cdn/setup.cfg b/azure-mgmt-cdn/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-cdn/setup.cfg +++ b/azure-mgmt-cdn/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-cdn/setup.py b/azure-mgmt-cdn/setup.py index e2b7e3b2b7120..c8d3a63ebfeed 100644 --- a/azure-mgmt-cdn/setup.py +++ b/azure-mgmt-cdn/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-cdn" @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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=[ - 'msrestazure>=0.4.27,<2.0.0', + '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'], + } ) diff --git a/azure-mgmt-compute/MANIFEST.in b/azure-mgmt-compute/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-compute/MANIFEST.in +++ b/azure-mgmt-compute/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-compute/azure/__init__.py b/azure-mgmt-compute/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-compute/azure/__init__.py +++ b/azure-mgmt-compute/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-compute/azure/mgmt/__init__.py b/azure-mgmt-compute/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-compute/azure/mgmt/__init__.py +++ b/azure-mgmt-compute/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-compute/azure_bdist_wheel.py b/azure-mgmt-compute/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-compute/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-compute/setup.cfg b/azure-mgmt-compute/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-compute/setup.cfg +++ b/azure-mgmt-compute/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-compute/setup.py b/azure-mgmt-compute/setup.py index 090ca2ca4a523..ca24ecb6904ab 100644 --- a/azure-mgmt-compute/setup.py +++ b/azure-mgmt-compute/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-compute" @@ -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'], + } ) diff --git a/azure-mgmt-containerinstance/MANIFEST.in b/azure-mgmt-containerinstance/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-containerinstance/MANIFEST.in +++ b/azure-mgmt-containerinstance/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-containerinstance/azure/__init__.py b/azure-mgmt-containerinstance/azure/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-mgmt-containerinstance/azure/__init__.py +++ b/azure-mgmt-containerinstance/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-containerinstance/azure/mgmt/__init__.py b/azure-mgmt-containerinstance/azure/mgmt/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-mgmt-containerinstance/azure/mgmt/__init__.py +++ b/azure-mgmt-containerinstance/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-containerinstance/azure_bdist_wheel.py b/azure-mgmt-containerinstance/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-containerinstance/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-containerinstance/setup.cfg b/azure-mgmt-containerinstance/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-containerinstance/setup.cfg +++ b/azure-mgmt-containerinstance/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-containerinstance/setup.py b/azure-mgmt-containerinstance/setup.py index 72097fec5cddc..5d32ceb7f0bc8 100644 --- a/azure-mgmt-containerinstance/setup.py +++ b/azure-mgmt-containerinstance/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-containerinstance" @@ -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'], + } ) diff --git a/azure-mgmt-containerregistry/MANIFEST.in b/azure-mgmt-containerregistry/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-containerregistry/MANIFEST.in +++ b/azure-mgmt-containerregistry/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-containerregistry/azure/__init__.py b/azure-mgmt-containerregistry/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-containerregistry/azure/__init__.py +++ b/azure-mgmt-containerregistry/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-containerregistry/azure/mgmt/__init__.py b/azure-mgmt-containerregistry/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/__init__.py +++ b/azure-mgmt-containerregistry/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-containerregistry/azure_bdist_wheel.py b/azure-mgmt-containerregistry/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-containerregistry/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-containerregistry/setup.cfg b/azure-mgmt-containerregistry/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-containerregistry/setup.cfg +++ b/azure-mgmt-containerregistry/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-containerregistry/setup.py b/azure-mgmt-containerregistry/setup.py index 4d7c29c7ba79e..188d56267ad05 100644 --- a/azure-mgmt-containerregistry/setup.py +++ b/azure-mgmt-containerregistry/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-containerregistry" @@ -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'], + } ) diff --git a/azure-mgmt-containerservice/MANIFEST.in b/azure-mgmt-containerservice/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-containerservice/MANIFEST.in +++ b/azure-mgmt-containerservice/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-containerservice/azure/__init__.py b/azure-mgmt-containerservice/azure/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-mgmt-containerservice/azure/__init__.py +++ b/azure-mgmt-containerservice/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-containerservice/azure/mgmt/__init__.py b/azure-mgmt-containerservice/azure/mgmt/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-mgmt-containerservice/azure/mgmt/__init__.py +++ b/azure-mgmt-containerservice/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-containerservice/azure_bdist_wheel.py b/azure-mgmt-containerservice/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-containerservice/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-containerservice/setup.cfg b/azure-mgmt-containerservice/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-containerservice/setup.cfg +++ b/azure-mgmt-containerservice/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-containerservice/setup.py b/azure-mgmt-containerservice/setup.py index eb48b95424f65..647197cde70e8 100644 --- a/azure-mgmt-containerservice/setup.py +++ b/azure-mgmt-containerservice/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-containerservice" @@ -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'], + } ) diff --git a/azure-mgmt-datalake-analytics/MANIFEST.in b/azure-mgmt-datalake-analytics/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-datalake-analytics/MANIFEST.in +++ b/azure-mgmt-datalake-analytics/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-datalake-analytics/README.rst b/azure-mgmt-datalake-analytics/README.rst index 692903b9d0725..54acd0daecf29 100644 --- a/azure-mgmt-datalake-analytics/README.rst +++ b/azure-mgmt-datalake-analytics/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure Data Lake Analytics Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. diff --git a/azure-mgmt-datalake-analytics/azure/__init__.py b/azure-mgmt-datalake-analytics/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-datalake-analytics/azure/__init__.py +++ b/azure-mgmt-datalake-analytics/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-datalake-analytics/azure/mgmt/__init__.py b/azure-mgmt-datalake-analytics/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-datalake-analytics/azure/mgmt/__init__.py +++ b/azure-mgmt-datalake-analytics/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-datalake-analytics/azure/mgmt/datalake/__init__.py b/azure-mgmt-datalake-analytics/azure/mgmt/datalake/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-datalake-analytics/azure/mgmt/datalake/__init__.py +++ b/azure-mgmt-datalake-analytics/azure/mgmt/datalake/__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-datalake-analytics/azure_bdist_wheel.py b/azure-mgmt-datalake-analytics/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-datalake-analytics/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-datalake-analytics/setup.cfg b/azure-mgmt-datalake-analytics/setup.cfg index e6761b2e25185..3c6e79cf31da1 100644 --- a/azure-mgmt-datalake-analytics/setup.cfg +++ b/azure-mgmt-datalake-analytics/setup.cfg @@ -1,3 +1,2 @@ [bdist_wheel] universal=1 -azure-namespace-package=azure-mgmt-datalake-nspkg \ No newline at end of file diff --git a/azure-mgmt-datalake-analytics/setup.py b/azure-mgmt-datalake-analytics/setup.py index c2cb4f55906d4..68f340388091b 100644 --- a/azure-mgmt-datalake-analytics/setup.py +++ b/azure-mgmt-datalake-analytics/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-datalake-analytics" @@ -72,13 +66,23 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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', + 'azure.mgmt.datalake', + ]), install_requires=[ - 'msrestazure>=0.4.27,<2.0.0', + '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-datalake-nspkg'], + } ) diff --git a/azure-mgmt-datalake-store/MANIFEST.in b/azure-mgmt-datalake-store/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-datalake-store/MANIFEST.in +++ b/azure-mgmt-datalake-store/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-datalake-store/README.rst b/azure-mgmt-datalake-store/README.rst index dd4607d585af0..6b24c7857dc9c 100644 --- a/azure-mgmt-datalake-store/README.rst +++ b/azure-mgmt-datalake-store/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure Data Lake Store Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. diff --git a/azure-mgmt-datalake-store/azure/__init__.py b/azure-mgmt-datalake-store/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-datalake-store/azure/__init__.py +++ b/azure-mgmt-datalake-store/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-datalake-store/azure/mgmt/__init__.py b/azure-mgmt-datalake-store/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-datalake-store/azure/mgmt/__init__.py +++ b/azure-mgmt-datalake-store/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-datalake-store/azure/mgmt/datalake/__init__.py b/azure-mgmt-datalake-store/azure/mgmt/datalake/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-datalake-store/azure/mgmt/datalake/__init__.py +++ b/azure-mgmt-datalake-store/azure/mgmt/datalake/__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-datalake-store/azure_bdist_wheel.py b/azure-mgmt-datalake-store/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-datalake-store/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-datalake-store/setup.cfg b/azure-mgmt-datalake-store/setup.cfg index e6761b2e25185..3c6e79cf31da1 100644 --- a/azure-mgmt-datalake-store/setup.cfg +++ b/azure-mgmt-datalake-store/setup.cfg @@ -1,3 +1,2 @@ [bdist_wheel] universal=1 -azure-namespace-package=azure-mgmt-datalake-nspkg \ No newline at end of file diff --git a/azure-mgmt-datalake-store/setup.py b/azure-mgmt-datalake-store/setup.py index b60626b64aefe..fe17d91a300bc 100644 --- a/azure-mgmt-datalake-store/setup.py +++ b/azure-mgmt-datalake-store/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-datalake-store" @@ -72,13 +66,23 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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', + 'azure.mgmt.datalake', + ]), install_requires=[ - 'msrestazure>=0.4.27,<2.0.0', + '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-datalake-nspkg'], + } ) diff --git a/azure-mgmt-datamigration/MANIFEST.in b/azure-mgmt-datamigration/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-datamigration/MANIFEST.in +++ b/azure-mgmt-datamigration/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-datamigration/azure/__init__.py b/azure-mgmt-datamigration/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-datamigration/azure/__init__.py +++ b/azure-mgmt-datamigration/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-datamigration/azure/mgmt/__init__.py b/azure-mgmt-datamigration/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-datamigration/azure/mgmt/__init__.py +++ b/azure-mgmt-datamigration/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-datamigration/azure_bdist_wheel.py b/azure-mgmt-datamigration/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-datamigration/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-datamigration/setup.cfg b/azure-mgmt-datamigration/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-datamigration/setup.cfg +++ b/azure-mgmt-datamigration/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-datamigration/setup.py b/azure-mgmt-datamigration/setup.py index 6ea65fd1db4f3..135749ea6bc36 100644 --- a/azure-mgmt-datamigration/setup.py +++ b/azure-mgmt-datamigration/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-datamigration" @@ -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'], + } ) diff --git a/azure-mgmt-devspaces/MANIFEST.in b/azure-mgmt-devspaces/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-devspaces/MANIFEST.in +++ b/azure-mgmt-devspaces/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-devspaces/azure/__init__.py b/azure-mgmt-devspaces/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-devspaces/azure/__init__.py +++ b/azure-mgmt-devspaces/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-devspaces/azure/mgmt/__init__.py b/azure-mgmt-devspaces/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-devspaces/azure/mgmt/__init__.py +++ b/azure-mgmt-devspaces/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-devspaces/azure_bdist_wheel.py b/azure-mgmt-devspaces/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-devspaces/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-devspaces/setup.cfg b/azure-mgmt-devspaces/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-devspaces/setup.cfg +++ b/azure-mgmt-devspaces/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-devspaces/setup.py b/azure-mgmt-devspaces/setup.py index 3fad3248177bb..e14033a3af4b2 100644 --- a/azure-mgmt-devspaces/setup.py +++ b/azure-mgmt-devspaces/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-devspaces" @@ -76,10 +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'], + } ) diff --git a/azure-mgmt-dns/MANIFEST.in b/azure-mgmt-dns/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-dns/MANIFEST.in +++ b/azure-mgmt-dns/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-dns/azure/__init__.py b/azure-mgmt-dns/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-dns/azure/__init__.py +++ b/azure-mgmt-dns/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-dns/azure/mgmt/__init__.py b/azure-mgmt-dns/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-dns/azure/mgmt/__init__.py +++ b/azure-mgmt-dns/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-dns/azure_bdist_wheel.py b/azure-mgmt-dns/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-dns/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-dns/setup.cfg b/azure-mgmt-dns/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-dns/setup.cfg +++ b/azure-mgmt-dns/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-dns/setup.py b/azure-mgmt-dns/setup.py index 7f52550571f4a..d292c8aaacff6 100644 --- a/azure-mgmt-dns/setup.py +++ b/azure-mgmt-dns/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-dns" @@ -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'], + } ) diff --git a/azure-mgmt-eventhub/MANIFEST.in b/azure-mgmt-eventhub/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-eventhub/MANIFEST.in +++ b/azure-mgmt-eventhub/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-eventhub/azure/__init__.py b/azure-mgmt-eventhub/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-eventhub/azure/__init__.py +++ b/azure-mgmt-eventhub/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-eventhub/azure/mgmt/__init__.py b/azure-mgmt-eventhub/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-eventhub/azure/mgmt/__init__.py +++ b/azure-mgmt-eventhub/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-eventhub/azure_bdist_wheel.py b/azure-mgmt-eventhub/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-eventhub/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-eventhub/setup.cfg b/azure-mgmt-eventhub/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-eventhub/setup.cfg +++ b/azure-mgmt-eventhub/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-eventhub/setup.py b/azure-mgmt-eventhub/setup.py index 08d1540be5391..c816b44375be3 100644 --- a/azure-mgmt-eventhub/setup.py +++ b/azure-mgmt-eventhub/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-eventhub" @@ -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'], + } ) diff --git a/azure-mgmt-hanaonazure/MANIFEST.in b/azure-mgmt-hanaonazure/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-hanaonazure/MANIFEST.in +++ b/azure-mgmt-hanaonazure/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-hanaonazure/azure/__init__.py b/azure-mgmt-hanaonazure/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-hanaonazure/azure/__init__.py +++ b/azure-mgmt-hanaonazure/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-hanaonazure/azure/mgmt/__init__.py b/azure-mgmt-hanaonazure/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-hanaonazure/azure/mgmt/__init__.py +++ b/azure-mgmt-hanaonazure/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-hanaonazure/azure_bdist_wheel.py b/azure-mgmt-hanaonazure/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-hanaonazure/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-hanaonazure/setup.cfg b/azure-mgmt-hanaonazure/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-hanaonazure/setup.cfg +++ b/azure-mgmt-hanaonazure/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-hanaonazure/setup.py b/azure-mgmt-hanaonazure/setup.py index 54224fd5fc366..9f44001ba520a 100644 --- a/azure-mgmt-hanaonazure/setup.py +++ b/azure-mgmt-hanaonazure/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-hanaonazure" @@ -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'], + } ) diff --git a/azure-mgmt-hdinsight/MANIFEST.in b/azure-mgmt-hdinsight/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-hdinsight/MANIFEST.in +++ b/azure-mgmt-hdinsight/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-hdinsight/azure/__init__.py b/azure-mgmt-hdinsight/azure/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-mgmt-hdinsight/azure/__init__.py +++ b/azure-mgmt-hdinsight/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-hdinsight/azure/mgmt/__init__.py b/azure-mgmt-hdinsight/azure/mgmt/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-mgmt-hdinsight/azure/mgmt/__init__.py +++ b/azure-mgmt-hdinsight/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-hdinsight/azure_bdist_wheel.py b/azure-mgmt-hdinsight/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-hdinsight/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-hdinsight/setup.cfg b/azure-mgmt-hdinsight/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-hdinsight/setup.cfg +++ b/azure-mgmt-hdinsight/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-hdinsight/setup.py b/azure-mgmt-hdinsight/setup.py index feee8754877bc..2f83fd18f2710 100644 --- a/azure-mgmt-hdinsight/setup.py +++ b/azure-mgmt-hdinsight/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-hdinsight" @@ -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'], + } ) diff --git a/azure-mgmt-iotcentral/MANIFEST.in b/azure-mgmt-iotcentral/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-iotcentral/MANIFEST.in +++ b/azure-mgmt-iotcentral/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-iotcentral/azure/__init__.py b/azure-mgmt-iotcentral/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-iotcentral/azure/__init__.py +++ b/azure-mgmt-iotcentral/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-iotcentral/azure/mgmt/__init__.py b/azure-mgmt-iotcentral/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-iotcentral/azure/mgmt/__init__.py +++ b/azure-mgmt-iotcentral/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-iotcentral/azure_bdist_wheel.py b/azure-mgmt-iotcentral/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-iotcentral/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-iotcentral/setup.cfg b/azure-mgmt-iotcentral/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-iotcentral/setup.cfg +++ b/azure-mgmt-iotcentral/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-iotcentral/setup.py b/azure-mgmt-iotcentral/setup.py index 2bab09e942b98..632e3aab0ccb5 100644 --- a/azure-mgmt-iotcentral/setup.py +++ b/azure-mgmt-iotcentral/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-iotcentral" @@ -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'], + } ) diff --git a/azure-mgmt-iothub/MANIFEST.in b/azure-mgmt-iothub/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-iothub/MANIFEST.in +++ b/azure-mgmt-iothub/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-iothub/azure/__init__.py b/azure-mgmt-iothub/azure/__init__.py index 849489fca33cc..0260537a02bb9 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 849489fca33cc..0260537a02bb9 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 8a81d1b617759..0000000000000 --- 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 856f4164982c5..3c6e79cf31da1 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 e37489b5355f2..b74fae46b4b5f 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'], + } ) diff --git a/azure-mgmt-keyvault/MANIFEST.in b/azure-mgmt-keyvault/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-keyvault/MANIFEST.in +++ b/azure-mgmt-keyvault/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-keyvault/README.rst b/azure-mgmt-keyvault/README.rst index ae12064e473d6..b7ee4573a02a0 100644 --- a/azure-mgmt-keyvault/README.rst +++ b/azure-mgmt-keyvault/README.rst @@ -6,7 +6,10 @@ This is the Microsoft Azure Key Vault Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. + +For the older Azure Service Management (ASM) libraries, see +`azure-servicemanagement-legacy `__ library. For a more complete set of Azure libraries, see the `azure `__ bundle package. diff --git a/azure-mgmt-keyvault/azure/__init__.py b/azure-mgmt-keyvault/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-keyvault/azure/__init__.py +++ b/azure-mgmt-keyvault/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-keyvault/azure/mgmt/__init__.py b/azure-mgmt-keyvault/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-keyvault/azure/mgmt/__init__.py +++ b/azure-mgmt-keyvault/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-keyvault/azure_bdist_wheel.py b/azure-mgmt-keyvault/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-keyvault/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-keyvault/setup.cfg b/azure-mgmt-keyvault/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-keyvault/setup.cfg +++ b/azure-mgmt-keyvault/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-keyvault/setup.py b/azure-mgmt-keyvault/setup.py index 32d32dd760d33..68ca6c9980c4d 100644 --- a/azure-mgmt-keyvault/setup.py +++ b/azure-mgmt-keyvault/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-keyvault" @@ -61,10 +55,10 @@ long_description=readme + '\n\n' + history, license='MIT License', author='Microsoft Corporation', - author_email='azurekeyvault@microsoft.com', + author_email='azpysdkhelp@microsoft.com', url='https://github.com/Azure/azure-sdk-for-python', classifiers=[ - 'Development Status :: 5 - Production/Stable', + 'Development Status :: 4 - Beta', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', @@ -72,14 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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'], + } ) diff --git a/azure-mgmt-kusto/MANIFEST.in b/azure-mgmt-kusto/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-kusto/MANIFEST.in +++ b/azure-mgmt-kusto/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-kusto/azure/__init__.py b/azure-mgmt-kusto/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-kusto/azure/__init__.py +++ b/azure-mgmt-kusto/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-kusto/azure/mgmt/__init__.py b/azure-mgmt-kusto/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-kusto/azure/mgmt/__init__.py +++ b/azure-mgmt-kusto/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-kusto/azure_bdist_wheel.py b/azure-mgmt-kusto/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-kusto/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-kusto/setup.cfg b/azure-mgmt-kusto/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-kusto/setup.cfg +++ b/azure-mgmt-kusto/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-kusto/setup.py b/azure-mgmt-kusto/setup.py index 2fd9420d8af12..112eab2cff1bc 100644 --- a/azure-mgmt-kusto/setup.py +++ b/azure-mgmt-kusto/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-kusto" @@ -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'], + } ) diff --git a/azure-mgmt-loganalytics/MANIFEST.in b/azure-mgmt-loganalytics/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-loganalytics/MANIFEST.in +++ b/azure-mgmt-loganalytics/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-loganalytics/README.rst b/azure-mgmt-loganalytics/README.rst index b2a999cb07a13..1dfa343cdad71 100644 --- a/azure-mgmt-loganalytics/README.rst +++ b/azure-mgmt-loganalytics/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure Log Analytics Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. diff --git a/azure-mgmt-loganalytics/azure/__init__.py b/azure-mgmt-loganalytics/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-loganalytics/azure/__init__.py +++ b/azure-mgmt-loganalytics/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-loganalytics/azure/mgmt/__init__.py b/azure-mgmt-loganalytics/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-loganalytics/azure/mgmt/__init__.py +++ b/azure-mgmt-loganalytics/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-loganalytics/azure_bdist_wheel.py b/azure-mgmt-loganalytics/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-loganalytics/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-loganalytics/setup.cfg b/azure-mgmt-loganalytics/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-loganalytics/setup.cfg +++ b/azure-mgmt-loganalytics/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-loganalytics/setup.py b/azure-mgmt-loganalytics/setup.py index 96f4ca887a061..1b9006391b222 100644 --- a/azure-mgmt-loganalytics/setup.py +++ b/azure-mgmt-loganalytics/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-loganalytics" @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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=[ - 'msrestazure>=0.4.27,<2.0.0', + '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'], + } ) diff --git a/azure-mgmt-logic/MANIFEST.in b/azure-mgmt-logic/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-logic/MANIFEST.in +++ b/azure-mgmt-logic/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-logic/README.rst b/azure-mgmt-logic/README.rst index 095902143154a..c380cdb9816da 100644 --- a/azure-mgmt-logic/README.rst +++ b/azure-mgmt-logic/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure Logic Apps Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. diff --git a/azure-mgmt-logic/azure/__init__.py b/azure-mgmt-logic/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-logic/azure/__init__.py +++ b/azure-mgmt-logic/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-logic/azure/mgmt/__init__.py b/azure-mgmt-logic/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-logic/azure/mgmt/__init__.py +++ b/azure-mgmt-logic/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-logic/azure_bdist_wheel.py b/azure-mgmt-logic/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-logic/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-logic/setup.cfg b/azure-mgmt-logic/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-logic/setup.cfg +++ b/azure-mgmt-logic/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-logic/setup.py b/azure-mgmt-logic/setup.py index 17ac0d37f0d35..760812b2cf0b6 100644 --- a/azure-mgmt-logic/setup.py +++ b/azure-mgmt-logic/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-logic" @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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=[ - 'msrestazure>=0.4.27,<2.0.0', + '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'], + } ) diff --git a/azure-mgmt-machinelearningcompute/MANIFEST.in b/azure-mgmt-machinelearningcompute/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-machinelearningcompute/MANIFEST.in +++ b/azure-mgmt-machinelearningcompute/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-machinelearningcompute/README.rst b/azure-mgmt-machinelearningcompute/README.rst index 2faf43ef630d8..dc9bdb64b8908 100644 --- a/azure-mgmt-machinelearningcompute/README.rst +++ b/azure-mgmt-machinelearningcompute/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure Machine Learning Compute Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. diff --git a/azure-mgmt-machinelearningcompute/azure/__init__.py b/azure-mgmt-machinelearningcompute/azure/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-mgmt-machinelearningcompute/azure/__init__.py +++ b/azure-mgmt-machinelearningcompute/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-machinelearningcompute/azure/mgmt/__init__.py b/azure-mgmt-machinelearningcompute/azure/mgmt/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-mgmt-machinelearningcompute/azure/mgmt/__init__.py +++ b/azure-mgmt-machinelearningcompute/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-machinelearningcompute/azure_bdist_wheel.py b/azure-mgmt-machinelearningcompute/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-machinelearningcompute/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-machinelearningcompute/setup.cfg b/azure-mgmt-machinelearningcompute/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-machinelearningcompute/setup.cfg +++ b/azure-mgmt-machinelearningcompute/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-machinelearningcompute/setup.py b/azure-mgmt-machinelearningcompute/setup.py index dd0ec4d9388ee..3c98c5242388f 100644 --- a/azure-mgmt-machinelearningcompute/setup.py +++ b/azure-mgmt-machinelearningcompute/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-machinelearningcompute" @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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=[ - 'msrestazure>=0.4.27,<2.0.0', + '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'], + } ) diff --git a/azure-mgmt-managementgroups/MANIFEST.in b/azure-mgmt-managementgroups/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-managementgroups/MANIFEST.in +++ b/azure-mgmt-managementgroups/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-managementgroups/README.rst b/azure-mgmt-managementgroups/README.rst index 972b9e4942b3c..706430e52cfce 100644 --- a/azure-mgmt-managementgroups/README.rst +++ b/azure-mgmt-managementgroups/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure Management Groups Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. diff --git a/azure-mgmt-managementgroups/azure/__init__.py b/azure-mgmt-managementgroups/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-managementgroups/azure/__init__.py +++ b/azure-mgmt-managementgroups/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-managementgroups/azure/mgmt/__init__.py b/azure-mgmt-managementgroups/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-managementgroups/azure/mgmt/__init__.py +++ b/azure-mgmt-managementgroups/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-managementgroups/azure_bdist_wheel.py b/azure-mgmt-managementgroups/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-managementgroups/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-managementgroups/setup.cfg b/azure-mgmt-managementgroups/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-managementgroups/setup.cfg +++ b/azure-mgmt-managementgroups/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-managementgroups/setup.py b/azure-mgmt-managementgroups/setup.py index 0149e4864dfad..1c1d1caa92009 100644 --- a/azure-mgmt-managementgroups/setup.py +++ b/azure-mgmt-managementgroups/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-managementgroups" @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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=[ - 'msrestazure>=0.4.27,<2.0.0', + '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'], + } ) diff --git a/azure-mgmt-media/MANIFEST.in b/azure-mgmt-media/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-media/MANIFEST.in +++ b/azure-mgmt-media/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-media/azure/__init__.py b/azure-mgmt-media/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-media/azure/__init__.py +++ b/azure-mgmt-media/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-media/azure/mgmt/__init__.py b/azure-mgmt-media/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-media/azure/mgmt/__init__.py +++ b/azure-mgmt-media/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-media/azure_bdist_wheel.py b/azure-mgmt-media/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-media/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-media/setup.cfg b/azure-mgmt-media/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-media/setup.cfg +++ b/azure-mgmt-media/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-media/setup.py b/azure-mgmt-media/setup.py index 49be05b7b104e..63b9945fed948 100644 --- a/azure-mgmt-media/setup.py +++ b/azure-mgmt-media/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-media" @@ -76,10 +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'], + } ) diff --git a/azure-mgmt-monitor/MANIFEST.in b/azure-mgmt-monitor/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-monitor/MANIFEST.in +++ b/azure-mgmt-monitor/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-monitor/README.rst b/azure-mgmt-monitor/README.rst index dbfab2bfccfb5..04af85e3ba61c 100644 --- a/azure-mgmt-monitor/README.rst +++ b/azure-mgmt-monitor/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure Monitor Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. diff --git a/azure-mgmt-monitor/azure/__init__.py b/azure-mgmt-monitor/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-monitor/azure/__init__.py +++ b/azure-mgmt-monitor/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-monitor/azure/mgmt/__init__.py b/azure-mgmt-monitor/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-monitor/azure/mgmt/__init__.py +++ b/azure-mgmt-monitor/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-monitor/azure_bdist_wheel.py b/azure-mgmt-monitor/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-monitor/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-monitor/setup.cfg b/azure-mgmt-monitor/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-monitor/setup.cfg +++ b/azure-mgmt-monitor/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-monitor/setup.py b/azure-mgmt-monitor/setup.py index 6c95e69612cd9..e26e0db3cc39a 100644 --- a/azure-mgmt-monitor/setup.py +++ b/azure-mgmt-monitor/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-monitor" @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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=[ - 'msrestazure>=0.4.27,<2.0.0', + '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'], + } ) diff --git a/azure-mgmt-msi/MANIFEST.in b/azure-mgmt-msi/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-msi/MANIFEST.in +++ b/azure-mgmt-msi/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-msi/README.rst b/azure-mgmt-msi/README.rst index 6d2ecf1dd4b2c..5ffcdf2d16fa2 100644 --- a/azure-mgmt-msi/README.rst +++ b/azure-mgmt-msi/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure MSI Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. diff --git a/azure-mgmt-msi/azure/__init__.py b/azure-mgmt-msi/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-msi/azure/__init__.py +++ b/azure-mgmt-msi/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-msi/azure/mgmt/__init__.py b/azure-mgmt-msi/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-msi/azure/mgmt/__init__.py +++ b/azure-mgmt-msi/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-msi/azure_bdist_wheel.py b/azure-mgmt-msi/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-msi/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-msi/setup.cfg b/azure-mgmt-msi/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-msi/setup.cfg +++ b/azure-mgmt-msi/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-msi/setup.py b/azure-mgmt-msi/setup.py index 54211cbc9f6b4..9cb911bb28bb6 100644 --- a/azure-mgmt-msi/setup.py +++ b/azure-mgmt-msi/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-msi" @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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=[ - 'msrestazure>=0.4.27,<2.0.0', + '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'], + } ) diff --git a/azure-mgmt-network/MANIFEST.in b/azure-mgmt-network/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-network/MANIFEST.in +++ b/azure-mgmt-network/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-network/azure/__init__.py b/azure-mgmt-network/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-network/azure/__init__.py +++ b/azure-mgmt-network/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-network/azure/mgmt/__init__.py b/azure-mgmt-network/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-network/azure/mgmt/__init__.py +++ b/azure-mgmt-network/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-network/azure_bdist_wheel.py b/azure-mgmt-network/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-network/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-network/setup.cfg b/azure-mgmt-network/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-network/setup.cfg +++ b/azure-mgmt-network/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-network/setup.py b/azure-mgmt-network/setup.py index 6148dcdc02128..90b9416272f16 100644 --- a/azure-mgmt-network/setup.py +++ b/azure-mgmt-network/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-network" @@ -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'], + } ) diff --git a/azure-mgmt-notificationhubs/MANIFEST.in b/azure-mgmt-notificationhubs/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-notificationhubs/MANIFEST.in +++ b/azure-mgmt-notificationhubs/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-notificationhubs/README.rst b/azure-mgmt-notificationhubs/README.rst index c2993d6f867c4..d9d406e03c225 100644 --- a/azure-mgmt-notificationhubs/README.rst +++ b/azure-mgmt-notificationhubs/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure Notification Hubs Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. diff --git a/azure-mgmt-notificationhubs/azure/__init__.py b/azure-mgmt-notificationhubs/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-notificationhubs/azure/__init__.py +++ b/azure-mgmt-notificationhubs/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-notificationhubs/azure/mgmt/__init__.py b/azure-mgmt-notificationhubs/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-notificationhubs/azure/mgmt/__init__.py +++ b/azure-mgmt-notificationhubs/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-notificationhubs/azure_bdist_wheel.py b/azure-mgmt-notificationhubs/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-notificationhubs/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-notificationhubs/setup.cfg b/azure-mgmt-notificationhubs/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-notificationhubs/setup.cfg +++ b/azure-mgmt-notificationhubs/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-notificationhubs/setup.py b/azure-mgmt-notificationhubs/setup.py index ddd7cd1693b1a..605d8a7bc9059 100644 --- a/azure-mgmt-notificationhubs/setup.py +++ b/azure-mgmt-notificationhubs/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-notificationhubs" @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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=[ - 'msrestazure>=0.4.27,<2.0.0', + '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'], + } ) diff --git a/azure-mgmt-powerbiembedded/MANIFEST.in b/azure-mgmt-powerbiembedded/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-powerbiembedded/MANIFEST.in +++ b/azure-mgmt-powerbiembedded/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-powerbiembedded/README.rst b/azure-mgmt-powerbiembedded/README.rst index f75a904d0183c..b896fa1385d3f 100644 --- a/azure-mgmt-powerbiembedded/README.rst +++ b/azure-mgmt-powerbiembedded/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure Power BI Embedded Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. diff --git a/azure-mgmt-powerbiembedded/azure/__init__.py b/azure-mgmt-powerbiembedded/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-powerbiembedded/azure/__init__.py +++ b/azure-mgmt-powerbiembedded/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-powerbiembedded/azure/mgmt/__init__.py b/azure-mgmt-powerbiembedded/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-powerbiembedded/azure/mgmt/__init__.py +++ b/azure-mgmt-powerbiembedded/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-powerbiembedded/azure_bdist_wheel.py b/azure-mgmt-powerbiembedded/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-powerbiembedded/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-powerbiembedded/setup.cfg b/azure-mgmt-powerbiembedded/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-powerbiembedded/setup.cfg +++ b/azure-mgmt-powerbiembedded/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-powerbiembedded/setup.py b/azure-mgmt-powerbiembedded/setup.py index 90d75208fd7e7..15725453bd9f6 100644 --- a/azure-mgmt-powerbiembedded/setup.py +++ b/azure-mgmt-powerbiembedded/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-powerbiembedded" @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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=[ - 'msrestazure>=0.4.27,<2.0.0', + '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'], + } ) diff --git a/azure-mgmt-rdbms/MANIFEST.in b/azure-mgmt-rdbms/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-rdbms/MANIFEST.in +++ b/azure-mgmt-rdbms/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-rdbms/azure/__init__.py b/azure-mgmt-rdbms/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-rdbms/azure/__init__.py +++ b/azure-mgmt-rdbms/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-rdbms/azure/mgmt/__init__.py b/azure-mgmt-rdbms/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-rdbms/azure/mgmt/__init__.py +++ b/azure-mgmt-rdbms/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-rdbms/azure_bdist_wheel.py b/azure-mgmt-rdbms/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-rdbms/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-rdbms/setup.cfg b/azure-mgmt-rdbms/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-rdbms/setup.cfg +++ b/azure-mgmt-rdbms/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-rdbms/setup.py b/azure-mgmt-rdbms/setup.py index 8dd6109a94ffe..5c6360c76ff95 100644 --- a/azure-mgmt-rdbms/setup.py +++ b/azure-mgmt-rdbms/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-rdbms" @@ -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'], + } ) diff --git a/azure-mgmt-recoveryservices/MANIFEST.in b/azure-mgmt-recoveryservices/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-recoveryservices/MANIFEST.in +++ b/azure-mgmt-recoveryservices/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-recoveryservices/README.rst b/azure-mgmt-recoveryservices/README.rst index 469de038ba8d6..1b3fbc27f7fba 100644 --- a/azure-mgmt-recoveryservices/README.rst +++ b/azure-mgmt-recoveryservices/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure Recovery Services Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. diff --git a/azure-mgmt-recoveryservices/azure/__init__.py b/azure-mgmt-recoveryservices/azure/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-mgmt-recoveryservices/azure/__init__.py +++ b/azure-mgmt-recoveryservices/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-recoveryservices/azure/mgmt/__init__.py b/azure-mgmt-recoveryservices/azure/mgmt/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-mgmt-recoveryservices/azure/mgmt/__init__.py +++ b/azure-mgmt-recoveryservices/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-recoveryservices/azure_bdist_wheel.py b/azure-mgmt-recoveryservices/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-recoveryservices/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-recoveryservices/setup.cfg b/azure-mgmt-recoveryservices/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-recoveryservices/setup.cfg +++ b/azure-mgmt-recoveryservices/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-recoveryservices/setup.py b/azure-mgmt-recoveryservices/setup.py index 3b8c97efed35b..6e4d331da6a3f 100644 --- a/azure-mgmt-recoveryservices/setup.py +++ b/azure-mgmt-recoveryservices/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-recoveryservices" @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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=[ - 'msrestazure>=0.4.27,<2.0.0', + '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'], + } ) diff --git a/azure-mgmt-recoveryservicesbackup/MANIFEST.in b/azure-mgmt-recoveryservicesbackup/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-recoveryservicesbackup/MANIFEST.in +++ b/azure-mgmt-recoveryservicesbackup/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-recoveryservicesbackup/README.rst b/azure-mgmt-recoveryservicesbackup/README.rst index 940d0af77f118..5594cc03800df 100644 --- a/azure-mgmt-recoveryservicesbackup/README.rst +++ b/azure-mgmt-recoveryservicesbackup/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure Recovery Services Backup Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. diff --git a/azure-mgmt-recoveryservicesbackup/azure/__init__.py b/azure-mgmt-recoveryservicesbackup/azure/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-mgmt-recoveryservicesbackup/azure/__init__.py +++ b/azure-mgmt-recoveryservicesbackup/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-recoveryservicesbackup/azure/mgmt/__init__.py b/azure-mgmt-recoveryservicesbackup/azure/mgmt/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-mgmt-recoveryservicesbackup/azure/mgmt/__init__.py +++ b/azure-mgmt-recoveryservicesbackup/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-recoveryservicesbackup/azure_bdist_wheel.py b/azure-mgmt-recoveryservicesbackup/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-recoveryservicesbackup/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-recoveryservicesbackup/setup.cfg b/azure-mgmt-recoveryservicesbackup/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-recoveryservicesbackup/setup.cfg +++ b/azure-mgmt-recoveryservicesbackup/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-recoveryservicesbackup/setup.py b/azure-mgmt-recoveryservicesbackup/setup.py index e375e8a291f56..e6d4f870be26a 100644 --- a/azure-mgmt-recoveryservicesbackup/setup.py +++ b/azure-mgmt-recoveryservicesbackup/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-recoveryservicesbackup" @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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=[ - 'msrestazure>=0.4.27,<2.0.0', + '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'], + } ) diff --git a/azure-mgmt-reservations/MANIFEST.in b/azure-mgmt-reservations/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-reservations/MANIFEST.in +++ b/azure-mgmt-reservations/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-reservations/azure/__init__.py b/azure-mgmt-reservations/azure/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-mgmt-reservations/azure/__init__.py +++ b/azure-mgmt-reservations/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-reservations/azure/mgmt/__init__.py b/azure-mgmt-reservations/azure/mgmt/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-mgmt-reservations/azure/mgmt/__init__.py +++ b/azure-mgmt-reservations/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-reservations/azure_bdist_wheel.py b/azure-mgmt-reservations/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-reservations/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-reservations/setup.cfg b/azure-mgmt-reservations/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-reservations/setup.cfg +++ b/azure-mgmt-reservations/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-reservations/setup.py b/azure-mgmt-reservations/setup.py index f6a88ee8d4225..99195938af801 100644 --- a/azure-mgmt-reservations/setup.py +++ b/azure-mgmt-reservations/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-reservations" @@ -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'], + } ) diff --git a/azure-mgmt-resource/MANIFEST.in b/azure-mgmt-resource/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-resource/MANIFEST.in +++ b/azure-mgmt-resource/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-resource/README.rst b/azure-mgmt-resource/README.rst index 93b3aeb0ff3ed..82592b0b66741 100644 --- a/azure-mgmt-resource/README.rst +++ b/azure-mgmt-resource/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure Resource Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. diff --git a/azure-mgmt-resource/azure/__init__.py b/azure-mgmt-resource/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-resource/azure/__init__.py +++ b/azure-mgmt-resource/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-resource/azure/mgmt/__init__.py b/azure-mgmt-resource/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-resource/azure/mgmt/__init__.py +++ b/azure-mgmt-resource/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-resource/azure_bdist_wheel.py b/azure-mgmt-resource/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-resource/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-resource/setup.cfg b/azure-mgmt-resource/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-resource/setup.cfg +++ b/azure-mgmt-resource/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-resource/setup.py b/azure-mgmt-resource/setup.py index 39abbc5af67c9..0b6289c9ebdac 100644 --- a/azure-mgmt-resource/setup.py +++ b/azure-mgmt-resource/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-resource" @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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=[ - 'msrestazure>=0.4.27,<2.0.0', - 'azure-common~=1.1,>=1.1.9', + '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'], + } ) diff --git a/azure-mgmt-resourcegraph/MANIFEST.in b/azure-mgmt-resourcegraph/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-resourcegraph/MANIFEST.in +++ b/azure-mgmt-resourcegraph/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-resourcegraph/azure/__init__.py b/azure-mgmt-resourcegraph/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-resourcegraph/azure/__init__.py +++ b/azure-mgmt-resourcegraph/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-resourcegraph/azure/mgmt/__init__.py b/azure-mgmt-resourcegraph/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-resourcegraph/azure/mgmt/__init__.py +++ b/azure-mgmt-resourcegraph/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-resourcegraph/azure_bdist_wheel.py b/azure-mgmt-resourcegraph/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-resourcegraph/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-resourcegraph/setup.cfg b/azure-mgmt-resourcegraph/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-resourcegraph/setup.cfg +++ b/azure-mgmt-resourcegraph/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-resourcegraph/setup.py b/azure-mgmt-resourcegraph/setup.py index 74d0986297030..8670749de7298 100644 --- a/azure-mgmt-resourcegraph/setup.py +++ b/azure-mgmt-resourcegraph/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-resourcegraph" @@ -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'], + } ) diff --git a/azure-mgmt-scheduler/MANIFEST.in b/azure-mgmt-scheduler/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-scheduler/MANIFEST.in +++ b/azure-mgmt-scheduler/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-scheduler/README.rst b/azure-mgmt-scheduler/README.rst index af814a0021395..f7eafff0aff64 100644 --- a/azure-mgmt-scheduler/README.rst +++ b/azure-mgmt-scheduler/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure Scheduler Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. diff --git a/azure-mgmt-scheduler/azure/__init__.py b/azure-mgmt-scheduler/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-scheduler/azure/__init__.py +++ b/azure-mgmt-scheduler/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-scheduler/azure/mgmt/__init__.py b/azure-mgmt-scheduler/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-scheduler/azure/mgmt/__init__.py +++ b/azure-mgmt-scheduler/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-scheduler/azure_bdist_wheel.py b/azure-mgmt-scheduler/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-scheduler/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-scheduler/setup.cfg b/azure-mgmt-scheduler/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-scheduler/setup.cfg +++ b/azure-mgmt-scheduler/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-scheduler/setup.py b/azure-mgmt-scheduler/setup.py index da4e8c3223d37..878bb1ec36355 100644 --- a/azure-mgmt-scheduler/setup.py +++ b/azure-mgmt-scheduler/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-scheduler" @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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=[ - 'msrestazure>=0.4.27,<2.0.0', + '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'], + } ) diff --git a/azure-mgmt-servermanager/MANIFEST.in b/azure-mgmt-servermanager/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-servermanager/MANIFEST.in +++ b/azure-mgmt-servermanager/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-servermanager/README.rst b/azure-mgmt-servermanager/README.rst index c898ad31f4daa..2d88769cf9a59 100644 --- a/azure-mgmt-servermanager/README.rst +++ b/azure-mgmt-servermanager/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure Server Manager Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. diff --git a/azure-mgmt-servermanager/azure/__init__.py b/azure-mgmt-servermanager/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-servermanager/azure/__init__.py +++ b/azure-mgmt-servermanager/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-servermanager/azure/mgmt/__init__.py b/azure-mgmt-servermanager/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-servermanager/azure/mgmt/__init__.py +++ b/azure-mgmt-servermanager/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-servermanager/azure_bdist_wheel.py b/azure-mgmt-servermanager/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-servermanager/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-servermanager/setup.cfg b/azure-mgmt-servermanager/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-servermanager/setup.cfg +++ b/azure-mgmt-servermanager/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-servermanager/setup.py b/azure-mgmt-servermanager/setup.py index 0e4332d6a2b1a..02913d1a459b1 100644 --- a/azure-mgmt-servermanager/setup.py +++ b/azure-mgmt-servermanager/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-servermanager" @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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=[ - 'msrestazure>=0.4.27,<2.0.0', + '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'], + } ) diff --git a/azure-mgmt-servicebus/MANIFEST.in b/azure-mgmt-servicebus/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-servicebus/MANIFEST.in +++ b/azure-mgmt-servicebus/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-servicebus/README.rst b/azure-mgmt-servicebus/README.rst index 928e43f1d77fe..cdfd9e5bab7fe 100644 --- a/azure-mgmt-servicebus/README.rst +++ b/azure-mgmt-servicebus/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure Service Bus Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. diff --git a/azure-mgmt-servicebus/azure/__init__.py b/azure-mgmt-servicebus/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-servicebus/azure/__init__.py +++ b/azure-mgmt-servicebus/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-servicebus/azure/mgmt/__init__.py b/azure-mgmt-servicebus/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-servicebus/azure/mgmt/__init__.py +++ b/azure-mgmt-servicebus/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-servicebus/azure_bdist_wheel.py b/azure-mgmt-servicebus/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-servicebus/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-servicebus/setup.cfg b/azure-mgmt-servicebus/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-servicebus/setup.cfg +++ b/azure-mgmt-servicebus/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-servicebus/setup.py b/azure-mgmt-servicebus/setup.py index f644ec4bbccd0..01b3263504891 100644 --- a/azure-mgmt-servicebus/setup.py +++ b/azure-mgmt-servicebus/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-servicebus" @@ -76,10 +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=[ - 'msrestazure>=0.4.27,<2.0.0', + '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'], + } ) diff --git a/azure-mgmt-servicefabric/MANIFEST.in b/azure-mgmt-servicefabric/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-servicefabric/MANIFEST.in +++ b/azure-mgmt-servicefabric/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-servicefabric/azure/__init__.py b/azure-mgmt-servicefabric/azure/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-mgmt-servicefabric/azure/__init__.py +++ b/azure-mgmt-servicefabric/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-servicefabric/azure/mgmt/__init__.py b/azure-mgmt-servicefabric/azure/mgmt/__init__.py index de40ea7ca058e..0260537a02bb9 100644 --- a/azure-mgmt-servicefabric/azure/mgmt/__init__.py +++ b/azure-mgmt-servicefabric/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-servicefabric/azure_bdist_wheel.py b/azure-mgmt-servicefabric/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-servicefabric/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-servicefabric/setup.cfg b/azure-mgmt-servicefabric/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-servicefabric/setup.cfg +++ b/azure-mgmt-servicefabric/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-servicefabric/setup.py b/azure-mgmt-servicefabric/setup.py index 8be8b72dd098f..16470da78edcf 100644 --- a/azure-mgmt-servicefabric/setup.py +++ b/azure-mgmt-servicefabric/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-servicefabric" @@ -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'], + } ) diff --git a/azure-mgmt-signalr/MANIFEST.in b/azure-mgmt-signalr/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-signalr/MANIFEST.in +++ b/azure-mgmt-signalr/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-signalr/azure/__init__.py b/azure-mgmt-signalr/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-signalr/azure/__init__.py +++ b/azure-mgmt-signalr/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-signalr/azure/mgmt/__init__.py b/azure-mgmt-signalr/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-signalr/azure/mgmt/__init__.py +++ b/azure-mgmt-signalr/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-signalr/azure_bdist_wheel.py b/azure-mgmt-signalr/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-signalr/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-signalr/setup.cfg b/azure-mgmt-signalr/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-signalr/setup.cfg +++ b/azure-mgmt-signalr/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-signalr/setup.py b/azure-mgmt-signalr/setup.py index 26d7dc6369964..9d0098a3cc8e8 100644 --- a/azure-mgmt-signalr/setup.py +++ b/azure-mgmt-signalr/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-signalr" @@ -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'], + } ) diff --git a/azure-mgmt-sql/MANIFEST.in b/azure-mgmt-sql/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-sql/MANIFEST.in +++ b/azure-mgmt-sql/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-sql/README.rst b/azure-mgmt-sql/README.rst index be2356da21f0d..ba4322ebd16e5 100644 --- a/azure-mgmt-sql/README.rst +++ b/azure-mgmt-sql/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure SQL Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. diff --git a/azure-mgmt-sql/azure/__init__.py b/azure-mgmt-sql/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-sql/azure/__init__.py +++ b/azure-mgmt-sql/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-sql/azure/mgmt/__init__.py b/azure-mgmt-sql/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-sql/azure/mgmt/__init__.py +++ b/azure-mgmt-sql/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-sql/azure_bdist_wheel.py b/azure-mgmt-sql/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-sql/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-sql/setup.cfg b/azure-mgmt-sql/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-sql/setup.cfg +++ b/azure-mgmt-sql/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-sql/setup.py b/azure-mgmt-sql/setup.py index c4492c11a4a07..16c6c1db50a87 100644 --- a/azure-mgmt-sql/setup.py +++ b/azure-mgmt-sql/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-sql" @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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=[ - 'msrestazure>=0.4.27,<2.0.0', + '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'], + } ) diff --git a/azure-mgmt-storage/MANIFEST.in b/azure-mgmt-storage/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-storage/MANIFEST.in +++ b/azure-mgmt-storage/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-storage/azure/__init__.py b/azure-mgmt-storage/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-storage/azure/__init__.py +++ b/azure-mgmt-storage/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-storage/azure/mgmt/__init__.py b/azure-mgmt-storage/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-storage/azure/mgmt/__init__.py +++ b/azure-mgmt-storage/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-storage/azure_bdist_wheel.py b/azure-mgmt-storage/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-storage/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-storage/setup.cfg b/azure-mgmt-storage/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-storage/setup.cfg +++ b/azure-mgmt-storage/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-storage/setup.py b/azure-mgmt-storage/setup.py index 67df7c1540bd6..09b444b48d6c6 100644 --- a/azure-mgmt-storage/setup.py +++ b/azure-mgmt-storage/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-storage" @@ -76,10 +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,>=1.1.10', + 'azure-common~=1.1', ], - cmdclass=cmdclass + extras_require={ + ":python_version<'3.0'": ['azure-mgmt-nspkg'], + } ) diff --git a/azure-mgmt-trafficmanager/MANIFEST.in b/azure-mgmt-trafficmanager/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-trafficmanager/MANIFEST.in +++ b/azure-mgmt-trafficmanager/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-trafficmanager/README.rst b/azure-mgmt-trafficmanager/README.rst index 947b56fed25dd..f88aa0a76dbde 100644 --- a/azure-mgmt-trafficmanager/README.rst +++ b/azure-mgmt-trafficmanager/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure Traffic Manager Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. diff --git a/azure-mgmt-trafficmanager/azure/__init__.py b/azure-mgmt-trafficmanager/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-trafficmanager/azure/__init__.py +++ b/azure-mgmt-trafficmanager/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-trafficmanager/azure/mgmt/__init__.py b/azure-mgmt-trafficmanager/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-trafficmanager/azure/mgmt/__init__.py +++ b/azure-mgmt-trafficmanager/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-trafficmanager/azure_bdist_wheel.py b/azure-mgmt-trafficmanager/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-trafficmanager/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-trafficmanager/setup.cfg b/azure-mgmt-trafficmanager/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-trafficmanager/setup.cfg +++ b/azure-mgmt-trafficmanager/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-trafficmanager/setup.py b/azure-mgmt-trafficmanager/setup.py index c126f5565201c..d063a2765fa8d 100644 --- a/azure-mgmt-trafficmanager/setup.py +++ b/azure-mgmt-trafficmanager/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-trafficmanager" @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', '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=[ - 'msrestazure>=0.4.27,<2.0.0', + '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'], + } ) diff --git a/azure-mgmt-web/MANIFEST.in b/azure-mgmt-web/MANIFEST.in index 9ecaeb15de50b..bb37a2723dae0 100644 --- a/azure-mgmt-web/MANIFEST.in +++ b/azure-mgmt-web/MANIFEST.in @@ -1,2 +1 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-web/azure/__init__.py b/azure-mgmt-web/azure/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-web/azure/__init__.py +++ b/azure-mgmt-web/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-web/azure/mgmt/__init__.py b/azure-mgmt-web/azure/mgmt/__init__.py index 849489fca33cc..0260537a02bb9 100644 --- a/azure-mgmt-web/azure/mgmt/__init__.py +++ b/azure-mgmt-web/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-web/azure_bdist_wheel.py b/azure-mgmt-web/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b617759..0000000000000 --- a/azure-mgmt-web/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-web/setup.cfg b/azure-mgmt-web/setup.cfg index 856f4164982c5..3c6e79cf31da1 100644 --- a/azure-mgmt-web/setup.cfg +++ b/azure-mgmt-web/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-web/setup.py b/azure-mgmt-web/setup.py index 03617fe25f5bd..66576ec324112 100644 --- a/azure-mgmt-web/setup.py +++ b/azure-mgmt-web/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-web" @@ -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'], + } ) From 9ed3d30a95bcbe9cf008c63ed7a1e64adcadf5a7 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Mon, 24 Sep 2018 16:20:38 -0700 Subject: [PATCH 16/23] azure-nspkg 3.0.0 and dev_setup for easy backward compat --- scripts/dev_setup.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/dev_setup.py b/scripts/dev_setup.py index 1604bf9afacdc..f79b765e2bd0a 100644 --- a/scripts/dev_setup.py +++ b/scripts/dev_setup.py @@ -51,6 +51,10 @@ def pip_command(command): if sys.version_info < (3, ): for package_name in nspkg_packages: pip_command('install -e {}'.format(package_name)) +else: + # We need the azure-nspkg, at least until storage is gone with the new system + # Will be removed later + pip_command('install -e azure-nspkg') # install packages for package_name in content_packages: From 4af93b950d062f270f80e40f92f65173b1733fcb Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Mon, 24 Sep 2018 16:24:08 -0700 Subject: [PATCH 17/23] Python ignore requires on Py3 --- scripts/dev_setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/dev_setup.py b/scripts/dev_setup.py index f79b765e2bd0a..18ca5b39fd206 100644 --- a/scripts/dev_setup.py +++ b/scripts/dev_setup.py @@ -54,7 +54,7 @@ def pip_command(command): else: # We need the azure-nspkg, at least until storage is gone with the new system # Will be removed later - pip_command('install -e azure-nspkg') + pip_command('install --ignore-requires-python -e azure-nspkg') # install packages for package_name in content_packages: From 184e71f07d3be5ab6f2686a757a25d31e0afe2cb Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Mon, 24 Sep 2018 16:32:52 -0700 Subject: [PATCH 18/23] Ignore required for all packages --- scripts/dev_setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/dev_setup.py b/scripts/dev_setup.py index 18ca5b39fd206..eb4c643fd1ac0 100644 --- a/scripts/dev_setup.py +++ b/scripts/dev_setup.py @@ -58,6 +58,6 @@ def pip_command(command): # install packages for package_name in content_packages: - pip_command('install -e {}'.format(package_name)) + pip_command('install --ignore-requires-python -e {}'.format(package_name)) print('Finished dev setup.') From ee56e1eff9940b99a12a38b9c1279188b2290011 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Mon, 24 Sep 2018 16:43:30 -0700 Subject: [PATCH 19/23] Uninstall azure-nspkg --- scripts/dev_setup.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/scripts/dev_setup.py b/scripts/dev_setup.py index eb4c643fd1ac0..390f6c587cc3c 100644 --- a/scripts/dev_setup.py +++ b/scripts/dev_setup.py @@ -15,14 +15,15 @@ root_dir = os.path.abspath(os.path.join(os.path.abspath(__file__), '..', '..')) -def pip_command(command): +def pip_command(command, error_ok=False): try: print('Executing: ' + command) check_call([sys.executable, '-m', 'pip'] + command.split(), cwd=root_dir) print() except CalledProcessError as err: print(err, file=sys.stderr) - sys.exit(1) + if not error_ok: + sys.exit(1) packages = [os.path.dirname(p) for p in glob.glob('azure*/setup.py')] @@ -51,13 +52,14 @@ def pip_command(command): if sys.version_info < (3, ): for package_name in nspkg_packages: pip_command('install -e {}'.format(package_name)) -else: - # We need the azure-nspkg, at least until storage is gone with the new system - # Will be removed later - pip_command('install --ignore-requires-python -e azure-nspkg') # install packages for package_name in content_packages: pip_command('install --ignore-requires-python -e {}'.format(package_name)) +# On Python 3, uninstall azure-nspkg if he got installed +if sys.version_info >= (3, ): + pip_command('uninstall -y azure-nspkg', error_ok=True) + + print('Finished dev setup.') From 268e5dd3a0f1d475934daef4f9279f53c47913cb Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Mon, 24 Sep 2018 17:06:06 -0700 Subject: [PATCH 20/23] Install nspkg in wheel mode, not editable --- scripts/dev_setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/dev_setup.py b/scripts/dev_setup.py index 390f6c587cc3c..df018002b9025 100644 --- a/scripts/dev_setup.py +++ b/scripts/dev_setup.py @@ -48,10 +48,10 @@ def pip_command(command, error_ok=False): whl_list = ' '.join([os.path.join(privates_dir, f) for f in os.listdir(privates_dir)]) pip_command('install {}'.format(whl_list)) -# install nspkg only on py2 +# install nspkg only on py2, but in wheel mode (not editable mode) if sys.version_info < (3, ): for package_name in nspkg_packages: - pip_command('install -e {}'.format(package_name)) + pip_command('install ./{}/'.format(package_name)) # install packages for package_name in content_packages: From abddc4f6c2ea3edc9cba72b07b7f24c9419543b9 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Tue, 25 Sep 2018 09:25:47 -0700 Subject: [PATCH 21/23] Improve gitignore --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index aeac92c5b51b7..4ef924506f5c1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,8 @@ __pycache__/ *.pyc .pytest_cache +.mypy_cache +.cache # Virtual environment env*/ @@ -26,7 +28,7 @@ build/ # Test results TestResults/ -# Credentials +# Credentials credentials_real.json testsettings_local.json testsettings_local.cfg From b9e19b4f0f1842ae1171073755810856523b1961 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Tue, 25 Sep 2018 09:35:13 -0700 Subject: [PATCH 22/23] Cognitive Services new nspkg --- azure-cognitiveservices-language-nspkg/README.rst | 3 +++ .../azure/__init__.py | 1 + .../azure/cognitiveservices/__init__.py | 1 + .../azure/cognitiveservices/language/__init__.py | 1 + azure-cognitiveservices-language-nspkg/setup.py | 11 +++-------- azure-cognitiveservices-nspkg/README.rst | 3 +++ azure-cognitiveservices-nspkg/azure/__init__.py | 1 + .../azure/cognitiveservices/__init__.py | 1 + azure-cognitiveservices-nspkg/setup.py | 10 +++------- azure-cognitiveservices-search-nspkg/README.rst | 3 +++ .../azure/__init__.py | 1 + .../azure/cognitiveservices/__init__.py | 1 + .../azure/cognitiveservices/search/__init__.py | 1 + azure-cognitiveservices-search-nspkg/setup.py | 11 +++-------- azure-cognitiveservices-vision-nspkg/README.rst | 3 +++ .../azure/__init__.py | 1 + .../azure/cognitiveservices/__init__.py | 1 + .../azure/cognitiveservices/vision/__init__.py | 1 + azure-cognitiveservices-vision-nspkg/setup.py | 11 +++-------- 19 files changed, 35 insertions(+), 31 deletions(-) create mode 100644 azure-cognitiveservices-language-nspkg/azure/__init__.py create mode 100644 azure-cognitiveservices-language-nspkg/azure/cognitiveservices/__init__.py create mode 100644 azure-cognitiveservices-nspkg/azure/__init__.py create mode 100644 azure-cognitiveservices-search-nspkg/azure/__init__.py create mode 100644 azure-cognitiveservices-search-nspkg/azure/cognitiveservices/__init__.py create mode 100644 azure-cognitiveservices-vision-nspkg/azure/__init__.py create mode 100644 azure-cognitiveservices-vision-nspkg/azure/cognitiveservices/__init__.py diff --git a/azure-cognitiveservices-language-nspkg/README.rst b/azure-cognitiveservices-language-nspkg/README.rst index d31aed0f9ae6a..5dea106b65bb6 100644 --- a/azure-cognitiveservices-language-nspkg/README.rst +++ b/azure-cognitiveservices-language-nspkg/README.rst @@ -5,6 +5,9 @@ This is the Microsoft Azure Cognitive Services Language namespace package. This package is not intended to be installed directly by the end user. +Since version 3.0, this is Python 2 package only, Python 3.x SDKs will use `PEP420 ` as namespace package strategy. +This package will use `python_requires` to enforce Python 2 installation. This implies that you might see this package on Python 3 environment if you have pip < 9.0 or setuptools < 24.2.0. + It provides the necessary files for other packages to extend the azure.cognitiveservices.language namespace. If you are looking to install the Azure client libraries, see the diff --git a/azure-cognitiveservices-language-nspkg/azure/__init__.py b/azure-cognitiveservices-language-nspkg/azure/__init__.py new file mode 100644 index 0000000000000..0260537a02bb9 --- /dev/null +++ b/azure-cognitiveservices-language-nspkg/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-cognitiveservices-language-nspkg/azure/cognitiveservices/__init__.py b/azure-cognitiveservices-language-nspkg/azure/cognitiveservices/__init__.py new file mode 100644 index 0000000000000..0260537a02bb9 --- /dev/null +++ b/azure-cognitiveservices-language-nspkg/azure/cognitiveservices/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-cognitiveservices-language-nspkg/azure/cognitiveservices/language/__init__.py b/azure-cognitiveservices-language-nspkg/azure/cognitiveservices/language/__init__.py index e69de29bb2d1d..0260537a02bb9 100644 --- a/azure-cognitiveservices-language-nspkg/azure/cognitiveservices/language/__init__.py +++ b/azure-cognitiveservices-language-nspkg/azure/cognitiveservices/language/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-cognitiveservices-language-nspkg/setup.py b/azure-cognitiveservices-language-nspkg/setup.py index 999d83b53703b..93fb63183266c 100644 --- a/azure-cognitiveservices-language-nspkg/setup.py +++ b/azure-cognitiveservices-language-nspkg/setup.py @@ -25,7 +25,7 @@ setup( name='azure-cognitiveservices-language-nspkg', - version='2.0.0', + version='3.0.0', description='Microsoft Azure Cognitive Services Language Namespace Package [Internal]', long_description=open('README.rst', 'r').read(), license='MIT License', @@ -37,19 +37,14 @@ 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', 'License :: OSI Approved :: MIT License', ], zip_safe=False, packages=[ - 'azure', - 'azure.cognitiveservices', 'azure.cognitiveservices.language', ], + python_requires='<3', install_requires=[ - 'azure-cognitiveservices-nspkg>=2.0.0', + 'azure-cognitiveservices-nspkg>=3.0.0', ] ) diff --git a/azure-cognitiveservices-nspkg/README.rst b/azure-cognitiveservices-nspkg/README.rst index ad7c260bffb34..cee9edfb04fd5 100644 --- a/azure-cognitiveservices-nspkg/README.rst +++ b/azure-cognitiveservices-nspkg/README.rst @@ -5,6 +5,9 @@ This is the Microsoft Azure Cognitive Services namespace package. This package is not intended to be installed directly by the end user. +Since version 3.0, this is Python 2 package only, Python 3.x SDKs will use `PEP420 ` as namespace package strategy. +This package will use `python_requires` to enforce Python 2 installation. This implies that you might see this package on Python 3 environment if you have pip < 9.0 or setuptools < 24.2.0. + It provides the necessary files for other packages to extend the azure.cognitiveservices namespace. If you are looking to install the Azure client libraries, see the diff --git a/azure-cognitiveservices-nspkg/azure/__init__.py b/azure-cognitiveservices-nspkg/azure/__init__.py new file mode 100644 index 0000000000000..0260537a02bb9 --- /dev/null +++ b/azure-cognitiveservices-nspkg/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-cognitiveservices-nspkg/azure/cognitiveservices/__init__.py b/azure-cognitiveservices-nspkg/azure/cognitiveservices/__init__.py index e69de29bb2d1d..0260537a02bb9 100644 --- a/azure-cognitiveservices-nspkg/azure/cognitiveservices/__init__.py +++ b/azure-cognitiveservices-nspkg/azure/cognitiveservices/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-cognitiveservices-nspkg/setup.py b/azure-cognitiveservices-nspkg/setup.py index 854dc5a95143f..ca45bfb2ebf32 100644 --- a/azure-cognitiveservices-nspkg/setup.py +++ b/azure-cognitiveservices-nspkg/setup.py @@ -25,7 +25,7 @@ setup( name='azure-cognitiveservices-nspkg', - version='2.0.0', + version='3.0.0', description='Microsoft Azure Cognitive Services Namespace Package [Internal]', long_description=open('README.rst', 'r').read(), license='MIT License', @@ -37,18 +37,14 @@ 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', 'License :: OSI Approved :: MIT License', ], zip_safe=False, packages=[ - 'azure', 'azure.cognitiveservices', ], + python_requires='<3', install_requires=[ - 'azure-nspkg>=2.0.0', + 'azure-nspkg>=3.0.0', ] ) diff --git a/azure-cognitiveservices-search-nspkg/README.rst b/azure-cognitiveservices-search-nspkg/README.rst index 3e2199a6bbbe8..8250270c5bbc8 100644 --- a/azure-cognitiveservices-search-nspkg/README.rst +++ b/azure-cognitiveservices-search-nspkg/README.rst @@ -5,6 +5,9 @@ This is the Microsoft Azure Cognitive Services Search namespace package. This package is not intended to be installed directly by the end user. +Since version 3.0, this is Python 2 package only, Python 3.x SDKs will use `PEP420 ` as namespace package strategy. +This package will use `python_requires` to enforce Python 2 installation. This implies that you might see this package on Python 3 environment if you have pip < 9.0 or setuptools < 24.2.0. + It provides the necessary files for other packages to extend the azure.cognitiveservices.search namespace. If you are looking to install the Azure client libraries, see the diff --git a/azure-cognitiveservices-search-nspkg/azure/__init__.py b/azure-cognitiveservices-search-nspkg/azure/__init__.py new file mode 100644 index 0000000000000..0260537a02bb9 --- /dev/null +++ b/azure-cognitiveservices-search-nspkg/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-cognitiveservices-search-nspkg/azure/cognitiveservices/__init__.py b/azure-cognitiveservices-search-nspkg/azure/cognitiveservices/__init__.py new file mode 100644 index 0000000000000..0260537a02bb9 --- /dev/null +++ b/azure-cognitiveservices-search-nspkg/azure/cognitiveservices/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-cognitiveservices-search-nspkg/azure/cognitiveservices/search/__init__.py b/azure-cognitiveservices-search-nspkg/azure/cognitiveservices/search/__init__.py index e69de29bb2d1d..0260537a02bb9 100644 --- a/azure-cognitiveservices-search-nspkg/azure/cognitiveservices/search/__init__.py +++ b/azure-cognitiveservices-search-nspkg/azure/cognitiveservices/search/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-cognitiveservices-search-nspkg/setup.py b/azure-cognitiveservices-search-nspkg/setup.py index 561b8f86c3481..115c48a6dde01 100644 --- a/azure-cognitiveservices-search-nspkg/setup.py +++ b/azure-cognitiveservices-search-nspkg/setup.py @@ -25,7 +25,7 @@ setup( name='azure-cognitiveservices-search-nspkg', - version='2.0.0', + version='3.0.0', description='Microsoft Azure Cognitive Services Search Namespace Package [Internal]', long_description=open('README.rst', 'r').read(), license='MIT License', @@ -37,19 +37,14 @@ 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', 'License :: OSI Approved :: MIT License', ], zip_safe=False, packages=[ - 'azure', - 'azure.cognitiveservices', 'azure.cognitiveservices.search', ], + python_requires='<3', install_requires=[ - 'azure-cognitiveservices-nspkg>=2.0.0', + 'azure-cognitiveservices-nspkg>=3.0.0', ] ) diff --git a/azure-cognitiveservices-vision-nspkg/README.rst b/azure-cognitiveservices-vision-nspkg/README.rst index c879ffe500c38..1d12e0a19abc5 100644 --- a/azure-cognitiveservices-vision-nspkg/README.rst +++ b/azure-cognitiveservices-vision-nspkg/README.rst @@ -5,6 +5,9 @@ This is the Microsoft Azure Cognitive Services Vision namespace package. This package is not intended to be installed directly by the end user. +Since version 3.0, this is Python 2 package only, Python 3.x SDKs will use `PEP420 ` as namespace package strategy. +This package will use `python_requires` to enforce Python 2 installation. This implies that you might see this package on Python 3 environment if you have pip < 9.0 or setuptools < 24.2.0. + It provides the necessary files for other packages to extend the azure.cognitiveservices.vision namespace. If you are looking to install the Azure client libraries, see the diff --git a/azure-cognitiveservices-vision-nspkg/azure/__init__.py b/azure-cognitiveservices-vision-nspkg/azure/__init__.py new file mode 100644 index 0000000000000..0260537a02bb9 --- /dev/null +++ b/azure-cognitiveservices-vision-nspkg/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-cognitiveservices-vision-nspkg/azure/cognitiveservices/__init__.py b/azure-cognitiveservices-vision-nspkg/azure/cognitiveservices/__init__.py new file mode 100644 index 0000000000000..0260537a02bb9 --- /dev/null +++ b/azure-cognitiveservices-vision-nspkg/azure/cognitiveservices/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-cognitiveservices-vision-nspkg/azure/cognitiveservices/vision/__init__.py b/azure-cognitiveservices-vision-nspkg/azure/cognitiveservices/vision/__init__.py index e69de29bb2d1d..0260537a02bb9 100644 --- a/azure-cognitiveservices-vision-nspkg/azure/cognitiveservices/vision/__init__.py +++ b/azure-cognitiveservices-vision-nspkg/azure/cognitiveservices/vision/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-cognitiveservices-vision-nspkg/setup.py b/azure-cognitiveservices-vision-nspkg/setup.py index 4b8a51fec2c3b..0e81a91d639d4 100644 --- a/azure-cognitiveservices-vision-nspkg/setup.py +++ b/azure-cognitiveservices-vision-nspkg/setup.py @@ -25,7 +25,7 @@ setup( name='azure-cognitiveservices-vision-nspkg', - version='2.0.0', + version='3.0.0', description='Microsoft Azure Cognitive Services Vision Namespace Package [Internal]', long_description=open('README.rst', 'r').read(), license='MIT License', @@ -37,19 +37,14 @@ 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', 'License :: OSI Approved :: MIT License', ], zip_safe=False, packages=[ - 'azure', - 'azure.cognitiveservices', 'azure.cognitiveservices.vision', ], + python_requires='<3', install_requires=[ - 'azure-cognitiveservices-nspkg>=2.0.0', + 'azure-cognitiveservices-nspkg>=3.0.0', ] ) From 0e82ec8de3ed54d962475a4875739676f72776fb Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Tue, 25 Sep 2018 09:36:16 -0700 Subject: [PATCH 23/23] Improve azure-mgmt-nspkg --- azure-mgmt-nspkg/azure/__init__.py | 1 + azure-mgmt-nspkg/setup.py | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 azure-mgmt-nspkg/azure/__init__.py diff --git a/azure-mgmt-nspkg/azure/__init__.py b/azure-mgmt-nspkg/azure/__init__.py new file mode 100644 index 0000000000000..0260537a02bb9 --- /dev/null +++ b/azure-mgmt-nspkg/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-nspkg/setup.py b/azure-mgmt-nspkg/setup.py index 7c91d90fb5955..b1e5221c88b81 100644 --- a/azure-mgmt-nspkg/setup.py +++ b/azure-mgmt-nspkg/setup.py @@ -41,7 +41,6 @@ ], zip_safe=False, packages=[ - 'azure', 'azure.mgmt', ], python_requires='<3',