Skip to content

Commit

Permalink
Separated attach. Need to include new test location for repo auto tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremydvoss committed May 22, 2023
1 parent 5a53e49 commit 4804f5a
Show file tree
Hide file tree
Showing 8 changed files with 111 additions and 8 deletions.
6 changes: 6 additions & 0 deletions azure-monitor-opentelemetry-autoinstrumentation/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog

## 1.0.0b1 (Unreleased)

- Separate from distro
([#286](https://github.com/microsoft/ApplicationInsights-Python/pull/286))
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License in the project root for
# license information.
# --------------------------------------------------------------------------

VERSION = "1.0.0b1"
98 changes: 98 additions & 0 deletions azure-monitor-opentelemetry-autoinstrumentation/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
#!/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.
# --------------------------------------------------------------------------


import os
import re

from setuptools import find_packages, setup

# Change the PACKAGE_NAME only to change folder and different name
PACKAGE_NAME = "azure-monitor-opentelemetry-autoinstrumentation"
PACKAGE_PPRINT_NAME = "Azure Monitor Opentelemetry Distro for Auto-Instrumentation"

# 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:
version = re.search(
r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE
).group(1)

if not version:
raise RuntimeError("Cannot find version information")

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="[email protected]",
url="https://github.com/microsoft/ApplicationInsights-Python/tree/main/azure-monitor-opentelemetry",
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>=1.0.0b12",
],
entry_points={
"opentelemetry_distro": [
"azure_monitor_opentelemetry_distro = azure.monitor.opentelemetry.autoinstrumentation._distro:AzureMonitorDistro"
],
"opentelemetry_configurator": [
"azure_monitor_opentelemetry_configurator = azure.monitor.opentelemetry.autoinstrumentation._configurator:AzureMonitorConfigurator"
],
},
)
8 changes: 0 additions & 8 deletions azure-monitor-opentelemetry/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,4 @@
"opentelemetry-api==1.17.0",
"opentelemetry-sdk==1.17.0",
],
entry_points={
"opentelemetry_distro": [
"azure_monitor_opentelemetry_distro = azure.monitor.opentelemetry.autoinstrumentation._distro:AzureMonitorDistro"
],
"opentelemetry_configurator": [
"azure_monitor_opentelemetry_configurator = azure.monitor.opentelemetry.autoinstrumentation._configurator:AzureMonitorConfigurator"
],
},
)

0 comments on commit 4804f5a

Please sign in to comment.