File tree Expand file tree Collapse file tree 5 files changed +26
-8
lines changed
opentelemetry-instrumentation
src/opentelemetry/instrumentation Expand file tree Collapse file tree 5 files changed +26
-8
lines changed Original file line number Diff line number Diff line change 1515import argparse
1616import logging
1717import sys
18- from importlib .metadata import PackageNotFoundError , version
18+ from opentelemetry .util ._importlib_metadata import (
19+ PackageNotFoundError , version
20+ )
1921from subprocess import (
2022 PIPE ,
2123 CalledProcessError ,
Original file line number Diff line number Diff line change 1- from importlib .metadata import Distribution , PackageNotFoundError , version
1+ # Copyright The OpenTelemetry Authors
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+
15+ from opentelemetry .util ._importlib_metadata import (
16+ Distribution , PackageNotFoundError , version
17+ )
218from logging import getLogger
319from typing import Collection , Optional , Union
420
Original file line number Diff line number Diff line change 1818"""
1919
2020from abc import ABC , abstractmethod
21- from importlib . metadata import EntryPoint
21+ from opentelemetry . util . _importlib_metadata import EntryPoint
2222from logging import getLogger
2323
2424from opentelemetry .instrumentation .instrumentor import BaseInstrumentor
Original file line number Diff line number Diff line change 1414
1515# pylint: disable=protected-access
1616
17- from importlib . metadata import Distribution , requires
18- from packaging .requirements import Requirement , InvalidRequirement
17+ from opentelemetry . util . _importlib_metadata import Distribution , requires
18+ from packaging .requirements import Requirement
1919import pytest
2020
2121from opentelemetry .instrumentation .dependencies import (
@@ -69,8 +69,8 @@ def test_get_dist_dependency_conflicts(self):
6969 def mock_requires (extras = ()):
7070 if "instruments" in extras :
7171 return requires (
72- 'test-pkg ~= 1.0; extra == "instruments"'
73- )
72+ 'test-pkg ~= 1.0; extra == "instruments"'
73+ )
7474 return []
7575
7676 dist = Distribution ()
Original file line number Diff line number Diff line change 1515
1616from unittest import TestCase
1717
18- from importlib . metadata import EntryPoint
18+ from opentelemerty . util . _importlib_metadata import EntryPoint
1919
2020from opentelemetry .instrumentation .distro import BaseDistro
2121from opentelemetry .instrumentation .instrumentor import BaseInstrumentor
You can’t perform that action at this time.
0 commit comments