mirror of
https://github.com/open-telemetry/opentelemetry-python-contrib.git
synced 2025-07-29 21:23:55 +08:00
Generate instrumentation packages setup.py files (#474)
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.
This commit is contained in:
@ -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__"])
|
||||
|
Reference in New Issue
Block a user