Skip to content

Commit 746ce90

Browse files
authored
Improve package layout (#26)
Auto discover namespace packages.
1 parent 132ef43 commit 746ce90

File tree

8 files changed

+78
-15
lines changed

8 files changed

+78
-15
lines changed

opentelemetry-api/opentelemetry/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
1-
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
1+
# Copyright 2019, 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.
Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
1-
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
1+
# Copyright 2019, 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.

opentelemetry-api/opentelemetry/internal/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
__version__ = "0.1.0"
15+
__version__ = "0.1.dev0"
Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
1-
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
1+
# Copyright 2019, 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.
Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
1-
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
1+
# Copyright 2019, 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.
Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
1-
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
1+
# Copyright 2019, 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.

opentelemetry-api/setup.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,18 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from setuptools import find_packages
16-
from setuptools import setup
17-
from opentelemetry.internal import __version__
15+
import os
16+
import setuptools
1817

19-
setup(
18+
base_dir = os.path.dirname(__file__)
19+
20+
package_info = {}
21+
with open(os.path.join(base_dir, "opentelemetry", "internal", "version.py")) as f:
22+
exec(f.read(), package_info)
23+
24+
setuptools.setup(
2025
name="opentelemetry-api",
21-
version=__version__, # noqa
26+
version=package_info["__version__"], # noqa
2227
author="OpenTelemetry Authors",
2328
author_email="[email protected]",
2429
classifiers=[
@@ -39,8 +44,7 @@
3944
],
4045
extras_require={},
4146
license="Apache-2.0",
42-
packages=find_packages(exclude=("examples", "tests",)),
43-
namespace_packages=[],
44-
url="https://github.com/open-telemetry/opentelemetry-python/opentelemetry-api",
47+
packages=setuptools.find_namespace_packages(include=["opentelemetry.*"]),
48+
url="https://github.com/open-telemetry/opentelemetry-python/tree/master/opentelemetry-api",
4549
zip_safe=False,
4650
)

0 commit comments

Comments
 (0)