diff --git a/scripts/release/pypi/build.sh b/scripts/release/pypi/build.sh index 7d8447554ec..96fcde1e7c4 100755 --- a/scripts/release/pypi/build.sh +++ b/scripts/release/pypi/build.sh @@ -17,7 +17,7 @@ echo "Branch $branch" echo "Search setup files from `pwd`." python --version -pip install -U pip setuptools wheel +pip install -U pip setuptools wheel build pip list script_dir=`cd $(dirname $BASH_SOURCE[0]); pwd` @@ -28,7 +28,6 @@ fi for setup_file in $(find src -name 'setup.py' | grep -v azure-cli-testsdk); do pushd `dirname $setup_file` - python setup.py bdist_wheel -d $BUILD_STAGINGDIRECTORY - python setup.py sdist -d $BUILD_STAGINGDIRECTORY + python -m build . -o $BUILD_STAGINGDIRECTORY popd done diff --git a/src/azure-cli-core/azure/__init__.py b/src/azure-cli-core/azure/__init__.py deleted file mode 100644 index 2ae78104e94..00000000000 --- a/src/azure-cli-core/azure/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/src/azure-cli-core/azure/cli/__init__.py b/src/azure-cli-core/azure/cli/__init__.py deleted file mode 100644 index 2ae78104e94..00000000000 --- a/src/azure-cli-core/azure/cli/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/src/azure-cli-core/setup.py b/src/azure-cli-core/setup.py index 3382499dbc9..ba7256188b8 100644 --- a/src/azure-cli-core/setup.py +++ b/src/azure-cli-core/setup.py @@ -6,7 +6,7 @@ # -------------------------------------------------------------------------------------------- from codecs import open -from setuptools import setup, find_packages +from setuptools import setup, find_namespace_packages VERSION = "2.69.0" @@ -80,7 +80,7 @@ url='https://github.com/Azure/azure-cli', zip_safe=False, classifiers=CLASSIFIERS, - packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests", "azure", "azure.cli"]), + packages=find_namespace_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]), install_requires=DEPENDENCIES, python_requires='>=3.9.0', package_data={'azure.cli.core': ['auth/landing_pages/*.html']} diff --git a/src/azure-cli/azure/__init__.py b/src/azure-cli/azure/__init__.py deleted file mode 100644 index 2ae78104e94..00000000000 --- a/src/azure-cli/azure/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/src/azure-cli/azure/cli/__init__.py b/src/azure-cli/azure/cli/__init__.py deleted file mode 100644 index 2ae78104e94..00000000000 --- a/src/azure-cli/azure/cli/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/src/azure-cli/azure/cli/command_modules/__init__.py b/src/azure-cli/azure/cli/command_modules/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/azure-cli/azure_cli_bdist_wheel.py b/src/azure-cli/azure_cli_bdist_wheel.py deleted file mode 100644 index 51db8cc5491..00000000000 --- a/src/azure-cli/azure_cli_bdist_wheel.py +++ /dev/null @@ -1,25 +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 setuptools.command.build_py import build_py - - -class azure_cli_build_py(build_py): - - def initialize_options(self): - super().initialize_options() - self.extra_build_source_files = None - - def build_packages(self): - super().build_packages() - if self.extra_build_source_files: - package, module, module_file = self.extra_build_source_files.split(',') - self.build_module(module, module_file, package) - - -cmdclass = { - 'build_py': azure_cli_build_py, -} diff --git a/src/azure-cli/setup.cfg b/src/azure-cli/setup.cfg deleted file mode 100644 index d1880740e37..00000000000 --- a/src/azure-cli/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[build_py] -extra_build_source_files=azure.cli,__main__,azure/cli/__main__.py diff --git a/src/azure-cli/setup.py b/src/azure-cli/setup.py index 23f6dcf5fa4..891160726cb 100644 --- a/src/azure-cli/setup.py +++ b/src/azure-cli/setup.py @@ -6,17 +6,9 @@ # -------------------------------------------------------------------------------------------- from codecs import open -from setuptools import setup, find_packages +from setuptools import setup, find_namespace_packages import sys -try: - from azure_cli_bdist_wheel import cmdclass -except ImportError: - import logging - - logging.warning("Wheel is not available, disabling bdist_wheel hook") - cmdclass = {} - VERSION = "2.69.0" # If we have source, validate that our version numbers match # This should prevent uploading releases with mismatched versions. @@ -157,6 +149,7 @@ with open('README.rst', 'r', encoding='utf-8') as f: README = f.read() + setup( name='azure-cli', version=VERSION, @@ -174,7 +167,7 @@ 'az.bat', 'azps.ps1' ], - packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests", "azure", "azure.cli"]), + packages=find_namespace_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]), install_requires=DEPENDENCIES, python_requires='>=3.9.0', package_data={ @@ -204,6 +197,5 @@ 'random/adjectives.txt', 'random/nouns.txt' ] - }, - cmdclass=cmdclass + } )