Skip to content

Commit

Permalink
Improve package layout (open-telemetry#26)
Browse files Browse the repository at this point in the history
Auto discover namespace packages.
  • Loading branch information
reyang authored Jun 26, 2019
1 parent 132ef43 commit 746ce90
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 15 deletions.
1 change: 0 additions & 1 deletion opentelemetry-api/opentelemetry/__init__.py

This file was deleted.

14 changes: 13 additions & 1 deletion opentelemetry-api/opentelemetry/context/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
# Copyright 2019, 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.
14 changes: 13 additions & 1 deletion opentelemetry-api/opentelemetry/distributedcontext/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
# Copyright 2019, 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.
2 changes: 1 addition & 1 deletion opentelemetry-api/opentelemetry/internal/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__version__ = "0.1.0"
__version__ = "0.1.dev0"
14 changes: 13 additions & 1 deletion opentelemetry-api/opentelemetry/logs/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
# Copyright 2019, 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.
14 changes: 13 additions & 1 deletion opentelemetry-api/opentelemetry/metrics/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
# Copyright 2019, 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.
14 changes: 13 additions & 1 deletion opentelemetry-api/opentelemetry/resources/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
# Copyright 2019, 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.
20 changes: 12 additions & 8 deletions opentelemetry-api/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from setuptools import find_packages
from setuptools import setup
from opentelemetry.internal import __version__
import os
import setuptools

setup(
base_dir = os.path.dirname(__file__)

package_info = {}
with open(os.path.join(base_dir, "opentelemetry", "internal", "version.py")) as f:
exec(f.read(), package_info)

setuptools.setup(
name="opentelemetry-api",
version=__version__, # noqa
version=package_info["__version__"], # noqa
author="OpenTelemetry Authors",
author_email="cncf-opentelemetry-contributors@lists.cncf.io",
classifiers=[
Expand All @@ -39,8 +44,7 @@
],
extras_require={},
license="Apache-2.0",
packages=find_packages(exclude=("examples", "tests",)),
namespace_packages=[],
url="https://github.com/open-telemetry/opentelemetry-python/opentelemetry-api",
packages=setuptools.find_namespace_packages(include=["opentelemetry.*"]),
url="https://github.com/open-telemetry/opentelemetry-python/tree/master/opentelemetry-api",
zip_safe=False,
)

0 comments on commit 746ce90

Please sign in to comment.