зеркало из https://github.com/microsoft/azure-cli.git
Migrating azure-cli-search to the azure-cli package.
This commit is contained in:
Родитель
c31c748e3d
Коммит
a483aa94dc
|
@ -62,7 +62,7 @@
|
|||
"servicefabric": "src/command_modules/azure-cli-servicefabric/azure/cli/command_modules/servicefabric/_help.py",
|
||||
"eventhubs": "src/azure-cli/azure/cli/command_modules/eventhubs/_help.py",
|
||||
"servicebus": "src/command_modules/azure-cli-servicebus/azure/cli/command_modules/servicebus/_help.py",
|
||||
"search": "src/command_modules/azure-cli-search/azure/cli/command_modules/search/_help.py",
|
||||
"search": "src/azure-cli/azure/cli/command_modules/search/_help.py",
|
||||
"managedapp": "src/azure-cli/azure/cli/command_modules/resource/_help.py",
|
||||
"aks": "src/azure-cli/azure/cli/command_modules/acs/_help.py",
|
||||
"deployment": "src/azure-cli/azure/cli/command_modules/resource/_help.py",
|
||||
|
|
|
@ -52,7 +52,6 @@ CLASSIFIERS = [
|
|||
]
|
||||
|
||||
COMMAND_MODULES = [
|
||||
'azure-cli-search',
|
||||
'azure-cli-security',
|
||||
'azure-cli-servicebus',
|
||||
'azure-cli-servicefabric',
|
||||
|
@ -117,6 +116,7 @@ DEPENDENCIES = [
|
|||
'azure-mgmt-relay~=0.1.0',
|
||||
'azure-mgmt-reservations~=0.3.1',
|
||||
'azure-mgmt-resource~=2.1',
|
||||
'azure-mgmt-search~=2.0',
|
||||
'azure-mgmt-sql~=0.12',
|
||||
'azure-mgmt-storage~=3.3',
|
||||
'azure-mgmt-trafficmanager~=0.51.0',
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
.. :changelog:
|
||||
|
||||
Release History
|
||||
===============
|
||||
|
||||
0.1.1
|
||||
+++++
|
||||
* Minor fixes
|
||||
|
||||
0.1.0
|
||||
+++++
|
||||
* Initial release of module.
|
|
@ -1 +0,0 @@
|
|||
include *.rst
|
|
@ -1,3 +0,0 @@
|
|||
Microsoft Azure CLI 'search' Command Module
|
||||
===========================================
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
# --------------------------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
# --------------------------------------------------------------------------------------------
|
||||
import pkg_resources
|
||||
pkg_resources.declare_namespace(__name__)
|
|
@ -1,6 +0,0 @@
|
|||
# --------------------------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
# --------------------------------------------------------------------------------------------
|
||||
import pkg_resources
|
||||
pkg_resources.declare_namespace(__name__)
|
|
@ -1,6 +0,0 @@
|
|||
# --------------------------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
# --------------------------------------------------------------------------------------------
|
||||
import pkg_resources
|
||||
pkg_resources.declare_namespace(__name__)
|
|
@ -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,
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
[bdist_wheel]
|
||||
universal=1
|
||||
azure-namespace-package=azure-cli-command_modules-nspkg
|
|
@ -1,62 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
# --------------------------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
# --------------------------------------------------------------------------------------------
|
||||
|
||||
from codecs import open
|
||||
from setuptools import 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 = {}
|
||||
|
||||
VERSION = "0.1.1"
|
||||
|
||||
# The full list of classifiers is available at
|
||||
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
|
||||
CLASSIFIERS = [
|
||||
'Development Status :: 4 - Beta',
|
||||
'Intended Audience :: Developers',
|
||||
'Intended Audience :: System Administrators',
|
||||
'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',
|
||||
]
|
||||
|
||||
DEPENDENCIES = [
|
||||
'azure-cli-core',
|
||||
'azure-mgmt-search==2.0.0',
|
||||
]
|
||||
|
||||
with open('README.rst', 'r', encoding='utf-8') as f:
|
||||
README = f.read()
|
||||
with open('HISTORY.rst', 'r', encoding='utf-8') as f:
|
||||
HISTORY = f.read()
|
||||
|
||||
setup(
|
||||
name='azure-cli-search',
|
||||
version=VERSION,
|
||||
description='Microsoft Azure Command-Line Tools Search Command Module',
|
||||
long_description=README + '\n\n' + HISTORY,
|
||||
license='MIT',
|
||||
author='Microsoft Corporation',
|
||||
author_email='azpycli@microsoft.com',
|
||||
url='https://github.com/Azure/azure-cli',
|
||||
classifiers=CLASSIFIERS,
|
||||
packages=[
|
||||
'azure',
|
||||
'azure.cli',
|
||||
'azure.cli.command_modules',
|
||||
'azure.cli.command_modules.search',
|
||||
],
|
||||
install_requires=DEPENDENCIES,
|
||||
cmdclass=cmdclass
|
||||
)
|
Загрузка…
Ссылка в новой задаче