-
Notifications
You must be signed in to change notification settings - Fork 78
Update project structure, switch to use setup.py #214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| [settings] | ||
| include_trailing_comma=True | ||
| force_grid_wrap=0 | ||
| use_parentheses=True | ||
| line_length=79 | ||
| profile=black | ||
|
|
||
| ; 3 stands for Vertical Hanging Indent, e.g. | ||
| ; from third_party import ( | ||
| ; lib1, | ||
| ; lib2, | ||
| ; lib3, | ||
| ; ) | ||
| ; docs: https://github.com/timothycrosley/isort#multi-line-output-modes | ||
| multi_line_output=3 | ||
| skip=target | ||
| skip_glob=**/gen/*,.venv*/*,venv*/*,**/proto/*,.tox/* | ||
| known_third_party=opentelemetry,psutil,pytest,redis,redis_opentracing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
Empty file.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # ------------------------------------------------------------------------- | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See License in the project root for | ||
| # license information. | ||
| # -------------------------------------------------------------------------- | ||
|
|
||
| from azure.monitor.opentelemetry.distro.distro import AzureMonitorDistro | ||
|
|
||
| distro = AzureMonitorDistro() | ||
| distro.configure() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,49 +1,2 @@ | ||
| # ------------------------------------------------------------------------- | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See License in the project root for | ||
| # license information. | ||
| # -------------------------------------------------------------------------- | ||
| [metadata] | ||
| name = azure-monitor-opentelemetry-distro | ||
| description = Azure Monitor Distro for OpenTelemetry Python | ||
| long_description = file: README.md | ||
| long_description_content_type = text/markdown | ||
| author = Microsoft Corporation | ||
| url = https://github.com/microsoft/ApplicationInsights-Python | ||
| platforms = any | ||
jeremydvoss marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| license = MIT License | ||
| classifiers = | ||
| Development Status :: 4 - Beta | ||
| Programming Language :: Python | ||
| Programming Language :: Python :: 3 | ||
| Programming Language :: Python :: 3.7 | ||
| Programming Language :: Python :: 3.8 | ||
| Programming Language :: Python :: 3.9 | ||
| Programming Language :: Python :: 3.10 | ||
| Programming Language :: Python :: 3.11 | ||
| License :: OSI Approved :: MIT License | ||
| Typing :: Typed | ||
|
|
||
| [options] | ||
| python_requires = >=3.7 | ||
| package_dir= | ||
| =src | ||
| packages=find_namespace: | ||
| zip_safe = False | ||
| include_package_data = True | ||
| install_requires = | ||
| azure-monitor-opentelemetry-exporter == 1.0.0b8 | ||
| opentelemetry-instrumentation ~= 0.35b0 | ||
| opentelemetry-instrumentation-django ~= 0.35b0 | ||
| opentelemetry-instrumentation-requests ~= 0.35b0 | ||
| opentelemetry-instrumentation-flask ~= 0.35b0 | ||
| opentelemetry-instrumentation-psycopg2 ~= 0.35b0 | ||
|
|
||
| [options.packages.find] | ||
| where = src | ||
|
|
||
| [options.entry_points] | ||
| opentelemetry_distro = | ||
| azure_monitor_opentelemetry_distro = azure.monitor.opentelemetry.distro.distro:AzureMonitorDistro | ||
| opentelemetry_configurator = | ||
| azure_monitor_opentelemetry_configurator = azure.monitor.opentelemetry.distro.configurator:AzureMonitorConfigurator | ||
| [bdist_wheel] | ||
| universal=1 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,103 @@ | ||
| #!/usr/bin/env python | ||
|
|
||
| # ------------------------------------------------------------------------- | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See License in the project root for | ||
| # Licensed under the MIT License. See License.txt in the project root for | ||
| # license information. | ||
| # -------------------------------------------------------------------------- | ||
|
|
||
|
|
||
| import os | ||
| import re | ||
|
|
||
| import setuptools | ||
| from setuptools import find_packages, setup | ||
|
|
||
| BASE_DIR = os.path.dirname(__file__) | ||
| VERSION_FILENAME = os.path.join( | ||
| BASE_DIR, "src", "azure", "monitor", "opentelemetry", "distro", "version.py" | ||
| ) | ||
| PACKAGE_INFO = {} | ||
| with open(VERSION_FILENAME, encoding="utf-8") as f: | ||
| exec(f.read(), PACKAGE_INFO) | ||
| # Change the PACKAGE_NAME only to change folder and different name | ||
| PACKAGE_NAME = "azure-monitor-opentelemetry-distro" | ||
| PACKAGE_PPRINT_NAME = "Azure Monitor Opentelemetry Distro" | ||
jeremydvoss marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| # a-b-c => a/b/c | ||
| package_folder_path = 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) | ||
| try: | ||
| import azure | ||
|
|
||
| try: | ||
| ver = azure.__version__ | ||
| raise Exception( | ||
| "This package is incompatible with azure=={}. ".format(ver) | ||
| + 'Uninstall it with "pip uninstall azure".' | ||
| ) | ||
| except AttributeError: | ||
| pass | ||
| except ImportError: | ||
| pass | ||
|
|
||
| # Version extraction inspired from 'requests' | ||
| with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: | ||
jeremydvoss marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| version = re.search( | ||
| r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE | ||
| ).group(1) | ||
|
|
||
| if not version: | ||
| raise RuntimeError("Cannot find version information") | ||
|
|
||
| setuptools.setup( | ||
| version=PACKAGE_INFO["VERSION"], | ||
| setup( | ||
| name=PACKAGE_NAME, | ||
| version=version, | ||
| description="Microsoft {} Client Library for Python".format( | ||
| PACKAGE_PPRINT_NAME | ||
| ), | ||
| long_description=open("README.md", "r").read(), | ||
| long_description_content_type="text/markdown", | ||
| license="MIT License", | ||
| author="Microsoft Corporation", | ||
| author_email="ascl@microsoft.com", | ||
| url="https://github.com/microsoft/ApplicationInsights-Python/tree/main/azure-monitor-opentelemetry-distro", | ||
| classifiers=[ | ||
| "Development Status :: 4 - Beta", | ||
| "Programming Language :: Python", | ||
| "Programming Language :: Python :: 3", | ||
| "Programming Language :: Python :: 3.7", | ||
| "Programming Language :: Python :: 3.8", | ||
| "Programming Language :: Python :: 3.9", | ||
| "Programming Language :: Python :: 3.10", | ||
| "Programming Language :: Python :: 3.11", | ||
| "License :: OSI Approved :: MIT License", | ||
| ], | ||
| zip_safe=False, | ||
| packages=find_packages( | ||
| exclude=[ | ||
| "tests", | ||
| "samples", | ||
| # Exclude packages that will be covered by PEP420 or nspkg | ||
| "azure", | ||
| "azure.monitor", | ||
| "azure.monitor.opentelemetry", | ||
| ] | ||
| ), | ||
| include_package_data=True, | ||
| package_data={ | ||
| "pytyped": ["py.typed"], | ||
| }, | ||
| python_requires=">=3.7", | ||
| install_requires=[ | ||
| "azure-monitor-opentelemetry-exporter>=1.0.0b11", | ||
| "opentelemetry-instrumentation~=0.35b0", | ||
| "opentelemetry-instrumentation-django~=0.35b0", | ||
| "opentelemetry-instrumentation-requests~=0.35b0", | ||
| "opentelemetry-instrumentation-flask~=0.35b0", | ||
| "opentelemetry-instrumentation-psycopg2~=0.35b0", | ||
| ], | ||
| entry_points={ | ||
| "opentelemetry_distro": [ | ||
| "azure_monitor_opentelemetry_distro = azure.monitor.opentelemetry.distro.distro:AzureMonitorDistro" | ||
| ], | ||
| "opentelemetry_configurator": [ | ||
| "azure_monitor_opentelemetry_configurator = azure.monitor.opentelemetry.distro.configurator:AzureMonitorConfigurator" | ||
| ], | ||
| }, | ||
| ) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| [tool.black] | ||
| line-length = 79 | ||
| exclude = ''' | ||
| ( | ||
| /( # generated files | ||
| .github| | ||
| .tox| | ||
| .vscode| | ||
| venv| | ||
| .*/build/lib/.*| | ||
| scripts | ||
| )/ | ||
| ) | ||
| ''' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.