From a9c0f495de8c206d982113d97abfe3eef1b0d7c2 Mon Sep 17 00:00:00 2001 From: Ofek Lev Date: Tue, 13 Sep 2022 15:04:58 -0400 Subject: [PATCH] Update package metadata opentelemetry-instrumentation-falcon (#1277) --- .../MANIFEST.in | 9 -- .../pyproject.toml | 61 +++++++++++++ .../setup.cfg | 59 ------------ .../setup.py | 89 ------------------- 4 files changed, 61 insertions(+), 157 deletions(-) delete mode 100644 instrumentation/opentelemetry-instrumentation-falcon/MANIFEST.in create mode 100644 instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml delete mode 100644 instrumentation/opentelemetry-instrumentation-falcon/setup.cfg delete mode 100644 instrumentation/opentelemetry-instrumentation-falcon/setup.py diff --git a/instrumentation/opentelemetry-instrumentation-falcon/MANIFEST.in b/instrumentation/opentelemetry-instrumentation-falcon/MANIFEST.in deleted file mode 100644 index aed3e33273b8..000000000000 --- a/instrumentation/opentelemetry-instrumentation-falcon/MANIFEST.in +++ /dev/null @@ -1,9 +0,0 @@ -graft src -graft tests -global-exclude *.pyc -global-exclude *.pyo -global-exclude __pycache__/* -include CHANGELOG.md -include MANIFEST.in -include README.rst -include LICENSE diff --git a/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml b/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml new file mode 100644 index 000000000000..8aed8b9a1cbb --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml @@ -0,0 +1,61 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "opentelemetry-instrumentation-falcon" +dynamic = ["version"] +description = "Falcon instrumentation for OpenTelemetry" +readme = "README.rst" +license = "Apache-2.0" +requires-python = ">=3.7" +authors = [ + { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, +] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", +] +dependencies = [ + "opentelemetry-api ~= 1.12", + "opentelemetry-instrumentation == 0.33b0", + "opentelemetry-instrumentation-wsgi == 0.33b0", + "opentelemetry-semantic-conventions == 0.33b0", + "opentelemetry-util-http == 0.33b0", + "packaging >= 20.0", +] + +[project.optional-dependencies] +instruments = [ + "falcon >= 1.4.1, < 4.0.0", +] +test = [ + "opentelemetry-instrumentation-falcon[instruments]", + "opentelemetry-test-utils == 0.33b0", + "parameterized == 0.7.4", +] + +[project.entry-points.opentelemetry_instrumentor] +falcon = "opentelemetry.instrumentation.falcon:FalconInstrumentor" + +[project.urls] +Homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-falcon" + +[tool.hatch.version] +path = "src/opentelemetry/instrumentation/falcon/version.py" + +[tool.hatch.build.targets.sdist] +include = [ + "/src", + "/tests", +] + +[tool.hatch.build.targets.wheel] +packages = ["src/opentelemetry"] diff --git a/instrumentation/opentelemetry-instrumentation-falcon/setup.cfg b/instrumentation/opentelemetry-instrumentation-falcon/setup.cfg deleted file mode 100644 index d21231010c4b..000000000000 --- a/instrumentation/opentelemetry-instrumentation-falcon/setup.cfg +++ /dev/null @@ -1,59 +0,0 @@ -# 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. -# 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. -# -[metadata] -name = opentelemetry-instrumentation-falcon -description = Falcon instrumentation for OpenTelemetry -long_description = file: README.rst -long_description_content_type = text/x-rst -author = OpenTelemetry Authors -author_email = cncf-opentelemetry-contributors@lists.cncf.io -url = https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-falcon -platforms = any -license = Apache-2.0 -classifiers = - Development Status :: 4 - Beta - Intended Audience :: Developers - License :: OSI Approved :: Apache Software License - Programming Language :: Python - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - -[options] -python_requires = >=3.7 -package_dir= - =src -packages=find_namespace: -install_requires = - opentelemetry-instrumentation-wsgi == 0.33b0 - opentelemetry-util-http == 0.33b0 - opentelemetry-instrumentation == 0.33b0 - opentelemetry-api ~= 1.12 - opentelemetry-semantic-conventions == 0.33b0 - packaging >= 20.0 - -[options.extras_require] -test = - opentelemetry-test-utils == 0.33b0 - parameterized == 0.7.4 - -[options.packages.find] -where = src - -[options.entry_points] -opentelemetry_instrumentor = - falcon = opentelemetry.instrumentation.falcon:FalconInstrumentor diff --git a/instrumentation/opentelemetry-instrumentation-falcon/setup.py b/instrumentation/opentelemetry-instrumentation-falcon/setup.py deleted file mode 100644 index b319ce4ca126..000000000000 --- a/instrumentation/opentelemetry-instrumentation-falcon/setup.py +++ /dev/null @@ -1,89 +0,0 @@ -# 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. -# 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. - - -# DO NOT EDIT. THIS FILE WAS AUTOGENERATED FROM templates/instrumentation_setup.py.txt. -# RUN `python scripts/generate_setup.py` TO REGENERATE. - - -import distutils.cmd -import json -import os -from configparser import ConfigParser - -import setuptools - -config = ConfigParser() -config.read("setup.cfg") - -# We provide extras_require parameter to setuptools.setup later which -# overwrites the extras_require section from setup.cfg. To support extras_require -# section in setup.cfg, we load it here and merge it with the extras_require param. -extras_require = {} -if "options.extras_require" in config: - for key, value in config["options.extras_require"].items(): - extras_require[key] = [v for v in value.split("\n") if v.strip()] - -BASE_DIR = os.path.dirname(__file__) -PACKAGE_INFO = {} - -VERSION_FILENAME = os.path.join( - BASE_DIR, "src", "opentelemetry", "instrumentation", "falcon", "version.py" -) -with open(VERSION_FILENAME, encoding="utf-8") as f: - exec(f.read(), PACKAGE_INFO) - -PACKAGE_FILENAME = os.path.join( - BASE_DIR, "src", "opentelemetry", "instrumentation", "falcon", "package.py" -) -with open(PACKAGE_FILENAME, encoding="utf-8") as f: - exec(f.read(), PACKAGE_INFO) - -# Mark any instruments/runtime dependencies as test dependencies as well. -extras_require["instruments"] = PACKAGE_INFO["_instruments"] -test_deps = extras_require.get("test", []) -for dep in extras_require["instruments"]: - test_deps.append(dep) - -extras_require["test"] = test_deps - - -class JSONMetadataCommand(distutils.cmd.Command): - - description = ( - "print out package metadata as JSON. This is used by OpenTelemetry dev scripts to ", - "auto-generate code in other places", - ) - user_options = [] - - def initialize_options(self): - pass - - def finalize_options(self): - pass - - def run(self): - metadata = { - "name": config["metadata"]["name"], - "version": PACKAGE_INFO["__version__"], - "instruments": PACKAGE_INFO["_instruments"], - } - print(json.dumps(metadata)) - - -setuptools.setup( - cmdclass={"meta": JSONMetadataCommand}, - version=PACKAGE_INFO["__version__"], - extras_require=extras_require, -)