|
1 | 1 | #!/usr/bin/env python |
2 | 2 |
|
3 | | -#------------------------------------------------------------------------- |
| 3 | +# ------------------------------------------------------------------------- |
4 | 4 | # Copyright (c) Microsoft Corporation. All rights reserved. |
5 | 5 | # Licensed under the MIT License. See License.txt in the project root for |
6 | 6 | # license information. |
7 | | -#-------------------------------------------------------------------------- |
| 7 | +# -------------------------------------------------------------------------- |
8 | 8 |
|
9 | 9 | import re |
10 | 10 | import os.path |
|
16 | 16 | PACKAGE_PPRINT_NAME = "Azure Monitor Ingestion" |
17 | 17 |
|
18 | 18 | # a-b-c => a/b/c |
19 | | -package_folder_path = PACKAGE_NAME.replace('-', '/') |
| 19 | +package_folder_path = PACKAGE_NAME.replace("-", "/") |
20 | 20 | # a-b-c => a.b.c |
21 | | -namespace_name = PACKAGE_NAME.replace('-', '.') |
| 21 | +namespace_name = PACKAGE_NAME.replace("-", ".") |
22 | 22 |
|
23 | 23 | # azure v0.x is not compatible with this package |
24 | 24 | # azure v0.x used to have a __version__ attribute (newer versions don't) |
25 | 25 | try: |
26 | 26 | import azure |
| 27 | + |
27 | 28 | try: |
28 | 29 | ver = azure.__version__ |
29 | 30 | raise Exception( |
30 | | - 'This package is incompatible with azure=={}. '.format(ver) + |
31 | | - 'Uninstall it with "pip uninstall azure".' |
| 31 | + "This package is incompatible with azure=={}. ".format(ver) + 'Uninstall it with "pip uninstall azure".' |
32 | 32 | ) |
33 | 33 | except AttributeError: |
34 | 34 | pass |
35 | 35 | except ImportError: |
36 | 36 | pass |
37 | 37 |
|
38 | 38 | # Version extraction inspired from 'requests' |
39 | | -with open(os.path.join(package_folder_path, 'version.py') |
40 | | - if os.path.exists(os.path.join(package_folder_path, 'version.py')) |
41 | | - else os.path.join(package_folder_path, '_version.py'), 'r') as fd: |
42 | | - version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', |
43 | | - fd.read(), re.MULTILINE).group(1) |
| 39 | +with open( |
| 40 | + ( |
| 41 | + os.path.join(package_folder_path, "version.py") |
| 42 | + if os.path.exists(os.path.join(package_folder_path, "version.py")) |
| 43 | + else os.path.join(package_folder_path, "_version.py") |
| 44 | + ), |
| 45 | + "r", |
| 46 | +) as fd: |
| 47 | + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) |
44 | 48 |
|
45 | 49 | if not version: |
46 | | - raise RuntimeError('Cannot find version information') |
| 50 | + raise RuntimeError("Cannot find version information") |
47 | 51 |
|
48 | | -with open('README.md', encoding='utf-8') as f: |
| 52 | +with open("README.md", encoding="utf-8") as f: |
49 | 53 | readme = f.read() |
50 | | -with open('CHANGELOG.md', encoding='utf-8') as f: |
| 54 | +with open("CHANGELOG.md", encoding="utf-8") as f: |
51 | 55 | changelog = f.read() |
52 | 56 |
|
53 | 57 | setup( |
54 | 58 | name=PACKAGE_NAME, |
55 | 59 | version=version, |
56 | | - description='Microsoft {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), |
57 | | - long_description=readme + '\n\n' + changelog, |
58 | | - long_description_content_type='text/markdown', |
59 | | - license='MIT License', |
60 | | - author='Microsoft Corporation', |
61 | | - author_email='azpysdkhelp@microsoft.com', |
62 | | - url='https://github.com/Azure/azure-sdk-for-python', |
| 60 | + description="Microsoft {} Client Library for Python".format(PACKAGE_PPRINT_NAME), |
| 61 | + long_description=readme + "\n\n" + changelog, |
| 62 | + long_description_content_type="text/markdown", |
| 63 | + license="MIT License", |
| 64 | + author="Microsoft Corporation", |
| 65 | + author_email="azpysdkhelp@microsoft.com", |
| 66 | + url="https://github.com/Azure/azure-sdk-for-python", |
63 | 67 | keywords="azure, azure sdk", |
64 | 68 | classifiers=[ |
65 | 69 | "Development Status :: 5 - Production/Stable", |
66 | | - 'Programming Language :: Python', |
67 | | - 'Programming Language :: Python :: 3 :: Only', |
68 | | - 'Programming Language :: Python :: 3', |
69 | | - 'Programming Language :: Python :: 3.8', |
70 | | - 'Programming Language :: Python :: 3.9', |
71 | | - 'Programming Language :: Python :: 3.10', |
72 | | - 'Programming Language :: Python :: 3.11', |
73 | | - 'Programming Language :: Python :: 3.12', |
74 | | - 'License :: OSI Approved :: MIT License', |
| 70 | + "Programming Language :: Python", |
| 71 | + "Programming Language :: Python :: 3 :: Only", |
| 72 | + "Programming Language :: Python :: 3", |
| 73 | + "Programming Language :: Python :: 3.8", |
| 74 | + "Programming Language :: Python :: 3.9", |
| 75 | + "Programming Language :: Python :: 3.10", |
| 76 | + "Programming Language :: Python :: 3.11", |
| 77 | + "Programming Language :: Python :: 3.12", |
| 78 | + "License :: OSI Approved :: MIT License", |
75 | 79 | ], |
76 | 80 | python_requires=">=3.8", |
77 | 81 | zip_safe=False, |
78 | | - packages=find_packages(exclude=[ |
79 | | - 'tests', |
80 | | - 'samples', |
81 | | - # Exclude packages that will be covered by PEP420 or nspkg |
82 | | - 'azure', |
83 | | - 'azure.monitor', |
84 | | - ]), |
| 82 | + packages=find_packages( |
| 83 | + exclude=[ |
| 84 | + "tests", |
| 85 | + "samples", |
| 86 | + # Exclude packages that will be covered by PEP420 or nspkg |
| 87 | + "azure", |
| 88 | + "azure.monitor", |
| 89 | + ] |
| 90 | + ), |
85 | 91 | include_package_data=True, |
86 | | - install_requires=[ |
87 | | - 'azure-core>=1.28.0', |
88 | | - 'isodate>=0.6.0', |
89 | | - "typing-extensions>=4.0.1" |
90 | | - ] |
| 92 | + install_requires=["azure-core>=1.28.0", "isodate>=0.6.0", "typing-extensions>=4.0.1"], |
91 | 93 | ) |
0 commit comments