diff --git a/.coveragerc b/.coveragerc index a7e0d6a78..8c1787b3b 100644 --- a/.coveragerc +++ b/.coveragerc @@ -4,4 +4,3 @@ omit = */setup.py */gen/* reference/* - opentelemetry-python-core/* diff --git a/.pylintrc b/.pylintrc index 6635fabbd..4aca6dcb4 100644 --- a/.pylintrc +++ b/.pylintrc @@ -7,7 +7,7 @@ extension-pkg-whitelist= # Add list of files or directories to be excluded. They should be base names, not # paths. -ignore=CVS,gen,opentelemetry-python-core +ignore=CVS,gen # Add files or directories matching the regex patterns to be excluded. The # regex matches against base names, not paths. diff --git a/dev-requirements.txt b/dev-requirements.txt index 6ce547930..fa13178c2 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,4 +1,4 @@ -pylint~=2.3 +pylint==2.4.4 flake8~=3.7 isort~=4.3 black>=19.3b0,==19.* diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/tests/__init__.py b/instrumentation/opentelemetry-instrumentation-wsgi/tests/__init__.py index e69de29bb..8a3124243 100644 --- a/instrumentation/opentelemetry-instrumentation-wsgi/tests/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-wsgi/tests/__init__.py @@ -0,0 +1,23 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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. +import pkg_resources + +# IMPORTANT: Only the wsgi module needs this because it is always the first +# package that uses the `{rootdir}/*/tests/` path and gets installed by +# `eachdist.py` and according to `eachdist.ini`. + +# Naming the tests module as a namespace package ensures that +# relative imports will resolve properly for subsequent test packages, +# as it enables searching for a composite of multiple test modules. +pkg_resources.declare_namespace(__name__) diff --git a/pyproject.toml b/pyproject.toml index c222549a2..35bd19509 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,8 +3,7 @@ line-length = 79 exclude = ''' ( /( - reference| # original files from DataDog - opentelemetry-python-core + reference # original files from DataDog )/ ) ''' diff --git a/tox.ini b/tox.ini index 2fa8a0485..27d521eab 100644 --- a/tox.ini +++ b/tox.ini @@ -262,16 +262,6 @@ commands = basepython: python3.8 recreate = True deps = - -e {toxinidir}/opentelemetry-python-core/opentelemetry-proto - -e {toxinidir}/opentelemetry-python-core/opentelemetry-api - -e {toxinidir}/opentelemetry-python-core/opentelemetry-sdk - -e {toxinidir}/opentelemetry-python-core/opentelemetry-instrumentation - -e {toxinidir}/opentelemetry-python-core/opentelemetry-proto - -e {toxinidir}/opentelemetry-python-core/tests/util - -e {toxinidir}/opentelemetry-python-core/exporter/opentelemetry-exporter-jaeger - -e {toxinidir}/opentelemetry-python-core/exporter/opentelemetry-exporter-zipkin - -e {toxinidir}/opentelemetry-python-core/exporter/opentelemetry-exporter-prometheus - -e {toxinidir}/opentelemetry-python-core/exporter/opentelemetry-exporter-otlp -c dev-requirements.txt pylint flake8 @@ -282,6 +272,10 @@ deps = httpretty commands_pre = + python -m pip install {toxinidir}/opentelemetry-python-core/opentelemetry-api + python -m pip install {toxinidir}/opentelemetry-python-core/opentelemetry-sdk + python -m pip install {toxinidir}/opentelemetry-python-core/tests/util + python -m pip install {toxinidir}/opentelemetry-python-core/opentelemetry-instrumentation python scripts/eachdist.py install --editable --with-test-deps commands =