Skip to content

Commit

Permalink
Generate instrumentation packages setup.py files
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 committed Apr 27, 2021
1 parent f2311dd commit d47e628
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 templaes/aiohttp_client.
# Run `python scripts/generate_setuppy.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 templaes/aiopg.
# Run `python scripts/generate_setuppy.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 templaes/asgi.
# Run `python scripts/generate_setuppy.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 templaes/asyncpg.
# Run `python scripts/generate_setuppy.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 templaes/boto.
# Run `python scripts/generate_setuppy.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 templaes/botocore.
# Run `python scripts/generate_setuppy.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 templaes/celery.
# Run `python scripts/generate_setuppy.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 templaes/dbapi.
# Run `python scripts/generate_setuppy.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 templaes/django.
# Run `python scripts/generate_setuppy.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 templaes/elasticsearch.
# Run `python scripts/generate_setuppy.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 templaes/falcon.
# Run `python scripts/generate_setuppy.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 templaes/fastapi.
# Run `python scripts/generate_setuppy.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 templaes/flask.
# Run `python scripts/generate_setuppy.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 templaes/grpc.
# Run `python scripts/generate_setuppy.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 templaes/jinja2.
# Run `python scripts/generate_setuppy.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 templaes/logging.
# Run `python scripts/generate_setuppy.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 templaes/mysql.
# Run `python scripts/generate_setuppy.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 templaes/psycopg2.
# Run `python scripts/generate_setuppy.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 templaes/pymemcache.
# Run `python scripts/generate_setuppy.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 templaes/pymongo.
# Run `python scripts/generate_setuppy.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 templaes/pymysql.
# Run `python scripts/generate_setuppy.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 templaes/pyramid.
# Run `python scripts/generate_setuppy.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 templaes/redis.
# Run `python scripts/generate_setuppy.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 templaes/requests.
# Run `python scripts/generate_setuppy.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 templaes/sklearn.
# Run `python scripts/generate_setuppy.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 templaes/sqlalchemy.
# Run `python scripts/generate_setuppy.py` to regenerate.


import os

import setuptools
Expand Down
Loading

0 comments on commit d47e628

Please sign in to comment.