Skip to content
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

Separated attach. Need to include new test location for repo auto tests #286

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
100 changes: 100 additions & 0 deletions azure-monitor-opentelemetry-autoinstrumentation/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
#!/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"
],
},
)