Skip to content

Commit

Permalink
Generate instrumentation packages setup.py files (#474)
Browse files Browse the repository at this point in the history
All instrumentations packages have almost exactly same setup.py files.
This commit adds a python script that generates it from a source
template. This dramatically reduces the time and effort required to
update all instrumentation setup.py files, and also reduces chances of
making manual mistakes.
  • Loading branch information
owais authored Apr 30, 2021
1 parent a89d7a6 commit cb35cc4
Show file tree
Hide file tree
Showing 36 changed files with 323 additions and 37 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2020, OpenTelemetry Authors
# 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.
Expand All @@ -11,6 +11,12 @@
# 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.


# DO NOT EDIT. THIS FILE WAS AUTOGENERATED FROM templates/instrumentation_setup.py.txt.
# RUN `python scripts/generate_setup.py` TO REGENERATE.


import os

import setuptools
Expand Down
6 changes: 6 additions & 0 deletions instrumentation/opentelemetry-instrumentation-aiopg/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
# 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.


# DO NOT EDIT. THIS FILE WAS AUTOGENERATED FROM templates/instrumentation_setup.py.txt.
# RUN `python scripts/generate_setup.py` TO REGENERATE.


import os

import setuptools
Expand Down
6 changes: 6 additions & 0 deletions instrumentation/opentelemetry-instrumentation-asgi/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
# 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.


# DO NOT EDIT. THIS FILE WAS AUTOGENERATED FROM templates/instrumentation_setup.py.txt.
# RUN `python scripts/generate_setup.py` TO REGENERATE.


import os

import setuptools
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
# 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.


# DO NOT EDIT. THIS FILE WAS AUTOGENERATED FROM templates/instrumentation_setup.py.txt.
# RUN `python scripts/generate_setup.py` TO REGENERATE.


import os

import setuptools
Expand Down
6 changes: 6 additions & 0 deletions instrumentation/opentelemetry-instrumentation-boto/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
# 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.


# DO NOT EDIT. THIS FILE WAS AUTOGENERATED FROM templates/instrumentation_setup.py.txt.
# RUN `python scripts/generate_setup.py` TO REGENERATE.


import os

import setuptools
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
# 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.


# DO NOT EDIT. THIS FILE WAS AUTOGENERATED FROM templates/instrumentation_setup.py.txt.
# RUN `python scripts/generate_setup.py` TO REGENERATE.


import os

import setuptools
Expand Down
6 changes: 6 additions & 0 deletions instrumentation/opentelemetry-instrumentation-celery/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
# 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.


# DO NOT EDIT. THIS FILE WAS AUTOGENERATED FROM templates/instrumentation_setup.py.txt.
# RUN `python scripts/generate_setup.py` TO REGENERATE.


import os

import setuptools
Expand Down
6 changes: 6 additions & 0 deletions instrumentation/opentelemetry-instrumentation-dbapi/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
# 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.


# DO NOT EDIT. THIS FILE WAS AUTOGENERATED FROM templates/instrumentation_setup.py.txt.
# RUN `python scripts/generate_setup.py` TO REGENERATE.


import os

import setuptools
Expand Down
26 changes: 13 additions & 13 deletions instrumentation/opentelemetry-instrumentation-django/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from os.path import dirname, join

from setuptools import setup
# DO NOT EDIT. THIS FILE WAS AUTOGENERATED FROM templates/instrumentation_setup.py.txt.
# RUN `python scripts/generate_setup.py` TO REGENERATE.


import os

import setuptools

BASE_DIR = os.path.dirname(__file__)
VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "django", "version.py"
)
PACKAGE_INFO = {}
with open(
join(
dirname(__file__),
"src",
"opentelemetry",
"instrumentation",
"django",
"version.py",
)
) as f:
with open(VERSION_FILENAME) as f:
exec(f.read(), PACKAGE_INFO)

setup(version=PACKAGE_INFO["__version__"])
setuptools.setup(version=PACKAGE_INFO["__version__"])
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
# 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.


# DO NOT EDIT. THIS FILE WAS AUTOGENERATED FROM templates/instrumentation_setup.py.txt.
# RUN `python scripts/generate_setup.py` TO REGENERATE.


import os

import setuptools
Expand Down
6 changes: 6 additions & 0 deletions instrumentation/opentelemetry-instrumentation-falcon/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
# 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.


# DO NOT EDIT. THIS FILE WAS AUTOGENERATED FROM templates/instrumentation_setup.py.txt.
# RUN `python scripts/generate_setup.py` TO REGENERATE.


import os

import setuptools
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
# 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.


# DO NOT EDIT. THIS FILE WAS AUTOGENERATED FROM templates/instrumentation_setup.py.txt.
# RUN `python scripts/generate_setup.py` TO REGENERATE.


import os

import setuptools
Expand Down
4 changes: 4 additions & 0 deletions instrumentation/opentelemetry-instrumentation-flask/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,9 @@ test =
flask~=1.0
opentelemetry-test == 0.21.dev0

[options.entry_points]
opentelemetry_instrumentor =
flask = opentelemetry.instrumentation.flask:FlaskInstrumentor

[options.packages.find]
where = src
15 changes: 7 additions & 8 deletions instrumentation/opentelemetry-instrumentation-flask/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
# 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.


# DO NOT EDIT. THIS FILE WAS AUTOGENERATED FROM templates/instrumentation_setup.py.txt.
# RUN `python scripts/generate_setup.py` TO REGENERATE.


import os

import setuptools
Expand All @@ -23,11 +29,4 @@
with open(VERSION_FILENAME) as f:
exec(f.read(), PACKAGE_INFO)

setuptools.setup(
version=PACKAGE_INFO["__version__"],
entry_points={
"opentelemetry_instrumentor": [
"flask = opentelemetry.instrumentation.flask:FlaskInstrumentor"
]
},
)
setuptools.setup(version=PACKAGE_INFO["__version__"])
5 changes: 5 additions & 0 deletions instrumentation/opentelemetry-instrumentation-grpc/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.


# DO NOT EDIT. THIS FILE WAS AUTOGENERATED FROM templates/instrumentation_setup.py.txt.
# RUN `python scripts/generate_setup.py` TO REGENERATE.


import os

import setuptools
Expand Down
6 changes: 6 additions & 0 deletions instrumentation/opentelemetry-instrumentation-jinja2/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
# 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.


# DO NOT EDIT. THIS FILE WAS AUTOGENERATED FROM templates/instrumentation_setup.py.txt.
# RUN `python scripts/generate_setup.py` TO REGENERATE.


import os

import setuptools
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
# 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.


# DO NOT EDIT. THIS FILE WAS AUTOGENERATED FROM templates/instrumentation_setup.py.txt.
# RUN `python scripts/generate_setup.py` TO REGENERATE.


import os

import setuptools
Expand Down
6 changes: 6 additions & 0 deletions instrumentation/opentelemetry-instrumentation-mysql/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
# 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.


# DO NOT EDIT. THIS FILE WAS AUTOGENERATED FROM templates/instrumentation_setup.py.txt.
# RUN `python scripts/generate_setup.py` TO REGENERATE.


import os

import setuptools
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
# 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.


# DO NOT EDIT. THIS FILE WAS AUTOGENERATED FROM templates/instrumentation_setup.py.txt.
# RUN `python scripts/generate_setup.py` TO REGENERATE.


import os

import setuptools
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@
# 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.
#


# DO NOT EDIT. THIS FILE WAS AUTOGENERATED FROM templates/instrumentation_setup.py.txt.
# RUN `python scripts/generate_setup.py` TO REGENERATE.


import os

import setuptools
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
# 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.


# DO NOT EDIT. THIS FILE WAS AUTOGENERATED FROM templates/instrumentation_setup.py.txt.
# RUN `python scripts/generate_setup.py` TO REGENERATE.


import os

import setuptools
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
# 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.


# DO NOT EDIT. THIS FILE WAS AUTOGENERATED FROM templates/instrumentation_setup.py.txt.
# RUN `python scripts/generate_setup.py` TO REGENERATE.


import os

import setuptools
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
# 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.


# DO NOT EDIT. THIS FILE WAS AUTOGENERATED FROM templates/instrumentation_setup.py.txt.
# RUN `python scripts/generate_setup.py` TO REGENERATE.


import os

import setuptools
Expand Down
6 changes: 6 additions & 0 deletions instrumentation/opentelemetry-instrumentation-redis/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
# 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.


# DO NOT EDIT. THIS FILE WAS AUTOGENERATED FROM templates/instrumentation_setup.py.txt.
# RUN `python scripts/generate_setup.py` TO REGENERATE.


import os

import setuptools
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
# 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.


# DO NOT EDIT. THIS FILE WAS AUTOGENERATED FROM templates/instrumentation_setup.py.txt.
# RUN `python scripts/generate_setup.py` TO REGENERATE.


import os

import setuptools
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
# 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.


# DO NOT EDIT. THIS FILE WAS AUTOGENERATED FROM templates/instrumentation_setup.py.txt.
# RUN `python scripts/generate_setup.py` TO REGENERATE.


import os

import setuptools
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
# 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.


# DO NOT EDIT. THIS FILE WAS AUTOGENERATED FROM templates/instrumentation_setup.py.txt.
# RUN `python scripts/generate_setup.py` TO REGENERATE.


import os

import setuptools
Expand Down
Loading

0 comments on commit cb35cc4

Please sign in to comment.