Skip to content

Commit eb53012

Browse files
authored
Fix lint by making pkg tests folders namespace pkgs (open-telemetry#131)
1 parent 28c1331 commit eb53012

File tree

6 files changed

+30
-15
lines changed

6 files changed

+30
-15
lines changed

.coveragerc

-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ omit =
44
*/setup.py
55
*/gen/*
66
reference/*
7-
opentelemetry-python-core/*

.pylintrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ extension-pkg-whitelist=
77

88
# Add list of files or directories to be excluded. They should be base names, not
99
# paths.
10-
ignore=CVS,gen,opentelemetry-python-core
10+
ignore=CVS,gen
1111

1212
# Add files or directories matching the regex patterns to be excluded. The
1313
# regex matches against base names, not paths.

dev-requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pylint~=2.3
1+
pylint==2.4.4
22
flake8~=3.7
33
isort~=4.3
44
black>=19.3b0,==19.*
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
import pkg_resources
15+
16+
# IMPORTANT: Only the wsgi module needs this because it is always the first
17+
# package that uses the `{rootdir}/*/tests/` path and gets installed by
18+
# `eachdist.py` and according to `eachdist.ini`.
19+
20+
# Naming the tests module as a namespace package ensures that
21+
# relative imports will resolve properly for subsequent test packages,
22+
# as it enables searching for a composite of multiple test modules.
23+
pkg_resources.declare_namespace(__name__)

pyproject.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ line-length = 79
33
exclude = '''
44
(
55
/(
6-
reference| # original files from DataDog
7-
opentelemetry-python-core
6+
reference # original files from DataDog
87
)/
98
)
109
'''

tox.ini

+4-10
Original file line numberDiff line numberDiff line change
@@ -262,16 +262,6 @@ commands =
262262
basepython: python3.8
263263
recreate = True
264264
deps =
265-
-e {toxinidir}/opentelemetry-python-core/opentelemetry-proto
266-
-e {toxinidir}/opentelemetry-python-core/opentelemetry-api
267-
-e {toxinidir}/opentelemetry-python-core/opentelemetry-sdk
268-
-e {toxinidir}/opentelemetry-python-core/opentelemetry-instrumentation
269-
-e {toxinidir}/opentelemetry-python-core/opentelemetry-proto
270-
-e {toxinidir}/opentelemetry-python-core/tests/util
271-
-e {toxinidir}/opentelemetry-python-core/exporter/opentelemetry-exporter-jaeger
272-
-e {toxinidir}/opentelemetry-python-core/exporter/opentelemetry-exporter-zipkin
273-
-e {toxinidir}/opentelemetry-python-core/exporter/opentelemetry-exporter-prometheus
274-
-e {toxinidir}/opentelemetry-python-core/exporter/opentelemetry-exporter-otlp
275265
-c dev-requirements.txt
276266
pylint
277267
flake8
@@ -282,6 +272,10 @@ deps =
282272
httpretty
283273

284274
commands_pre =
275+
python -m pip install {toxinidir}/opentelemetry-python-core/opentelemetry-api
276+
python -m pip install {toxinidir}/opentelemetry-python-core/opentelemetry-sdk
277+
python -m pip install {toxinidir}/opentelemetry-python-core/tests/util
278+
python -m pip install {toxinidir}/opentelemetry-python-core/opentelemetry-instrumentation
285279
python scripts/eachdist.py install --editable --with-test-deps
286280

287281
commands =

0 commit comments

Comments
 (0)