Skip to content

Commit

Permalink
Several fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ocelotl committed Feb 17, 2020
1 parent 8f5c68c commit 2665fb6
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 102 deletions.
7 changes: 0 additions & 7 deletions opentelemetry-api/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,6 @@
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
],
entry_points={
"console_scripts": [
"opentelemetry-auto-instrument = "
"opentelemetry.auto_instrument.auto_instrument:run"
],
"opentelemetry_patcher": [],
},
description="OpenTelemetry Python API",
include_package_data=True,
long_description=open("README.rst").read(),
Expand Down
78 changes: 0 additions & 78 deletions opentelemetry-api/src/opentelemetry/patcher/__init__.py

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 4 additions & 11 deletions opentelemetry-auto-instrumentation/setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2020, OpenTelemetry Authors
# Copyright 2019, OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -18,7 +18,7 @@

BASE_DIR = os.path.dirname(__file__)
VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", , "version.py"
BASE_DIR, "src", "opentelemetry", "auto_instrumentation", "version.py"
)
PACKAGE_INFO = {}
with open(VERSION_FILENAME) as f:
Expand All @@ -40,23 +40,16 @@
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
],
entry_points={
"console_scripts": [
"opentelemetry-auto-instrument = "
"opentelemetry.auto_instrument.auto_instrument:run"
],
"opentelemetry_patcher": [],
},
description="OpenTelemetry Python Auto Instrumentation",
include_package_data=True,
long_description=open("README.rst").read(),
long_description_content_type="text/x-rst",
install_requires=["typing; python_version<'3.5'"],
install_requires=["opentelemetry-api==0.4.dev0"],
extras_require={},
license="Apache-2.0",
package_dir={"": "src"},
packages=setuptools.find_namespace_packages(
where="src", include="opentelemetry.*"
where="src", include="opentelemetry.auto_instrumentation.*"
),
url=(
"https:/open-telemetry/opentelemetry-python"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,10 @@ def run() -> None:
bootstrap_dir = dirname(__file__)
python_path = environ.get("PYTHONPATH", None)

# Add our bootstrap directory to the head of $PYTHONPATH to ensure
# it is loaded before program code
if python_path is not None:
environ["PYTHONPATH"] = join(bootstrap_dir, python_path)
else:
if python_path is None:
environ["PYTHONPATH"] = bootstrap_dir
else:
environ["PYTHONPATH"] = join(bootstrap_dir, python_path)

python3 = which(argv[1])
execl(python3, python3, *argv[2:]) # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,17 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# type: ignore

from unittest import TestCase
from unittest.mock import patch
import sys

from opentelemetry.auto_instrumentation.auto_instrument import run


class TestAutoInstrumentation(TestCase):
def test_auto_instrumentation(self):

with patch.object(sys, "argv", ["python3", "hello.py"]):
auto_instrument.run()
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from logging import WARNING
from unittest import TestCase

from opentelemetry.patcher import BasePatcher
from opentelemetry.auto_instrumentation.patcher import BasePatcher


class TestPatcher(TestCase):
Expand Down

0 comments on commit 2665fb6

Please sign in to comment.