Fix lint by making pkg tests folders namespace pkgs (#131)

This commit is contained in:
(Eliseo) Nathaniel Ruiz Nowell
2020-11-06 13:11:51 -08:00
committed by GitHub
parent 28c1331e57
commit eb53012a8c
6 changed files with 30 additions and 15 deletions

View File

@ -4,4 +4,3 @@ omit =
*/setup.py
*/gen/*
reference/*
opentelemetry-python-core/*

View File

@ -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.

View File

@ -1,4 +1,4 @@
pylint~=2.3
pylint==2.4.4
flake8~=3.7
isort~=4.3
black>=19.3b0,==19.*

View File

@ -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__)

View File

@ -3,8 +3,7 @@ line-length = 79
exclude = '''
(
/(
reference| # original files from DataDog
opentelemetry-python-core
reference # original files from DataDog
)/
)
'''

14
tox.ini
View File

@ -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 =