Use UV to install all needed packages locally (#3124)

* Use UV to install all needed packages locally

* Add opentelemetry-test-utils

* Add asgi and fastapi

* Add more projects, since it helped me

* add urllib

* Add system metrics

* Add dbapi and sqlite3

* Add sqlalchemy

* add pyramid

* Add pymongo

* Add jinja2

* add lock file

* add falcon as well

* Add uv lock to the pre-commit

* Update uv.lock

* Update lockfile

* remove xray test dependencies

* Add otel-sdk to xray

* Update uv version

* Drop xray from the list of packages

---------

Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
This commit is contained in:
Marcelo Trylesinski
2025-02-20 19:04:31 -03:00
committed by GitHub
parent 8644630e7f
commit 6245fb833c
4 changed files with 5375 additions and 30 deletions

View File

@ -1,10 +1,15 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.6.9
hooks:
# Run the linter.
- id: ruff
args: ["--fix", "--show-fixes"]
# Run the formatter.
- id: ruff-format
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.6.9
hooks:
# Run the linter.
- id: ruff
args: ["--fix", "--show-fixes"]
# Run the formatter.
- id: ruff-format
- repo: https://github.com/astral-sh/uv-pre-commit
# uv version.
rev: 0.6.0
hooks:
- id: uv-lock

View File

@ -19,23 +19,31 @@ Please also read the [OpenTelemetry Contributor Guide](https://github.com/open-t
## Index
* [Find a Buddy and get Started Quickly](#find-a-buddy-and-get-started-quickly)
* [Development](#development)
* [Troubleshooting](#troubleshooting)
* [Benchmarks](#benchmarks)
* [Pull requests](#pull-requests)
* [How to Send Pull Requests](#how-to-send-pull-requests)
* [How to Receive Comments](#how-to-receive-comments)
* [How to Get PRs Reviewed](#how-to-get-prs-reviewed)
* [How to Get PRs Merged](#how-to-get-prs-merged)
* [Design Choices](#design-choices)
* [Focus on Capabilities, Not Structure Compliance](#focus-on-capabilities-not-structure-compliance)
* [Running Tests Locally](#running-tests-locally)
* [Testing against a different Core repo branch/commit](#testing-against-a-different-core-repo-branchcommit)
* [Style Guide](#style-guide)
* [Guideline for instrumentations](#guideline-for-instrumentations)
* [Guideline for GenAI instrumentations](#guideline-for-genai-instrumentations)
* [Expectations from contributors](#expectations-from-contributors)
- [Contributing to opentelemetry-python-contrib](#contributing-to-opentelemetry-python-contrib)
- [Index](#index)
- [Find a Buddy and get Started Quickly](#find-a-buddy-and-get-started-quickly)
- [Development](#development)
- [Virtual Environment](#virtual-environment)
- [Troubleshooting](#troubleshooting)
- [Benchmarks](#benchmarks)
- [Pull Requests](#pull-requests)
- [How to Send Pull Requests](#how-to-send-pull-requests)
- [How to Receive Comments](#how-to-receive-comments)
- [How to Get PRs Reviewed](#how-to-get-prs-reviewed)
- [How to Get PRs Merged](#how-to-get-prs-merged)
- [Design Choices](#design-choices)
- [Focus on Capabilities, Not Structure Compliance](#focus-on-capabilities-not-structure-compliance)
- [Running Tests Locally](#running-tests-locally)
- [Testing against a different Core repo branch/commit](#testing-against-a-different-core-repo-branchcommit)
- [Style Guide](#style-guide)
- [Guideline for instrumentations](#guideline-for-instrumentations)
- [Update supported instrumentation package versions](#update-supported-instrumentation-package-versions)
- [Guideline for GenAI instrumentations](#guideline-for-genai-instrumentations)
- [Get Involved](#get-involved)
- [Expectations from contributors](#expectations-from-contributors)
- [Updating supported Python versions](#updating-supported-python-versions)
- [Bumping the Python baseline](#bumping-the-python-baseline)
- [Adding support for a new Python release](#adding-support-for-a-new-python-release)
## Find a Buddy and get Started Quickly
@ -93,6 +101,20 @@ See
[`tox.ini`](https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/tox.ini)
for more detail on available tox commands.
### Virtual Environment
You can also create a single virtual environment to make it easier to run local tests.
For that, you'll need to install [`uv`](https://docs.astral.sh/uv/getting-started/installation/).
After installing `uv`, you can run the following command:
```sh
uv sync
```
This will create a virtual environment in the `.venv` directory and install all the necessary dependencies.
### Troubleshooting
Some packages may require additional system-wide dependencies to be installed. For example, you may need to install `libpq-dev` to run the postgresql client libraries instrumentation tests or `libsnappy-dev` to run the prometheus exporter tests. If you encounter a build error, please check the installation instructions for the package you are trying to run tests for.

View File

@ -1,11 +1,148 @@
# Used for local development, not to be published.
[project]
name = "opentelemetry-python-contrib"
version = "0.0.0" # This is not used.
requires-python = ">=3.8"
dependencies = [
"opentelemetry-api",
"opentelemetry-sdk",
"opentelemetry-semantic-conventions",
"opentelemetry-test-utils",
"opentelemetry-exporter-prometheus-remote-write",
"opentelemetry-exporter-richconsole",
"opentelemetry-instrumentation",
"opentelemetry-instrumentation-aio-pika[instruments]",
"opentelemetry-instrumentation-aiohttp-client[instruments]",
"opentelemetry-instrumentation-aiohttp-server[instruments]",
"opentelemetry-instrumentation-aiokafka[instruments]",
"opentelemetry-instrumentation-aiopg[instruments]",
"opentelemetry-instrumentation-asgi[instruments]",
"opentelemetry-instrumentation-asyncio",
"opentelemetry-instrumentation-asyncpg[instruments]",
"opentelemetry-instrumentation-aws-lambda[instruments]",
"opentelemetry-instrumentation-boto[instruments]",
"opentelemetry-instrumentation-boto3sqs[instruments]",
"opentelemetry-instrumentation-botocore[instruments]",
"opentelemetry-instrumentation-cassandra[instruments]",
"opentelemetry-instrumentation-celery[instruments]",
"opentelemetry-instrumentation-click[instruments]",
"opentelemetry-instrumentation-confluent-kafka[instruments]",
"opentelemetry-instrumentation-dbapi",
"opentelemetry-instrumentation-django[instruments]",
"opentelemetry-instrumentation-elasticsearch[instruments]",
"opentelemetry-instrumentation-falcon[instruments]",
"opentelemetry-instrumentation-fastapi[instruments]",
"opentelemetry-instrumentation-flask[instruments]",
"opentelemetry-instrumentation-grpc[instruments]",
"opentelemetry-instrumentation-httpx[instruments]",
"opentelemetry-instrumentation-jinja2[instruments]",
"opentelemetry-instrumentation-kafka-python[instruments]",
"opentelemetry-instrumentation-logging",
"opentelemetry-instrumentation-mysql[instruments]",
"opentelemetry-instrumentation-mysqlclient[instruments]",
"opentelemetry-instrumentation-pika[instruments]",
"opentelemetry-instrumentation-psycopg[instruments]",
"opentelemetry-instrumentation-psycopg2[instruments]",
"opentelemetry-instrumentation-pymemcache[instruments]",
"opentelemetry-instrumentation-pymongo[instruments]",
"opentelemetry-instrumentation-pymysql[instruments]",
"opentelemetry-instrumentation-pyramid[instruments]",
"opentelemetry-instrumentation-redis[instruments]",
"opentelemetry-instrumentation-remoulade[instruments]",
"opentelemetry-instrumentation-requests[instruments]",
"opentelemetry-instrumentation-sqlalchemy[instruments]",
"opentelemetry-instrumentation-sqlite3",
"opentelemetry-instrumentation-system-metrics",
"opentelemetry-instrumentation-threading",
"opentelemetry-instrumentation-tornado",
"opentelemetry-instrumentation-tortoiseorm",
"opentelemetry-instrumentation-urllib",
"opentelemetry-instrumentation-urllib3[instruments]",
"opentelemetry-instrumentation-wsgi",
"opentelemetry-propagator-ot-trace",
"opentelemetry-util-http",
]
# https://docs.astral.sh/uv/reference/settings/
[tool.uv]
package = false # https://docs.astral.sh/uv/reference/settings/#package
required-version = ">=0.6.0"
# https://docs.astral.sh/uv/reference/settings/#sources
[tool.uv.sources]
opentelemetry-api = { git = "https://github.com/open-telemetry/opentelemetry-python", branch = "main", subdirectory = "opentelemetry-api" }
opentelemetry-sdk = { git = "https://github.com/open-telemetry/opentelemetry-python", branch = "main", subdirectory = "opentelemetry-sdk" }
opentelemetry-semantic-conventions = { git = "https://github.com/open-telemetry/opentelemetry-python", branch = "main", subdirectory = "opentelemetry-semantic-conventions" }
opentelemetry-test-utils = { git = "https://github.com/open-telemetry/opentelemetry-python", branch = "main", subdirectory = "tests/opentelemetry-test-utils" }
opentelemetry-exporter-prometheus-remote-write = { workspace = true }
opentelemetry-exporter-richconsole = { workspace = true }
opentelemetry-instrumentation = { workspace = true }
opentelemetry-instrumentation-aio-pika = { workspace = true }
opentelemetry-instrumentation-aiohttp-client = { workspace = true }
opentelemetry-instrumentation-aiohttp-server = { workspace = true }
opentelemetry-instrumentation-aiokafka = { workspace = true }
opentelemetry-instrumentation-aiopg = { workspace = true }
opentelemetry-instrumentation-asgi = { workspace = true }
opentelemetry-instrumentation-asyncio = { workspace = true }
opentelemetry-instrumentation-asyncpg = { workspace = true }
opentelemetry-instrumentation-aws-lambda = { workspace = true }
opentelemetry-instrumentation-boto = { workspace = true }
opentelemetry-instrumentation-boto3sqs = { workspace = true }
opentelemetry-instrumentation-botocore = { workspace = true }
opentelemetry-instrumentation-cassandra = { workspace = true }
opentelemetry-instrumentation-celery = { workspace = true }
opentelemetry-instrumentation-click = { workspace = true }
opentelemetry-instrumentation-confluent-kafka = { workspace = true }
opentelemetry-instrumentation-dbapi = { workspace = true }
opentelemetry-instrumentation-django = { workspace = true }
opentelemetry-instrumentation-elasticsearch = { workspace = true }
opentelemetry-instrumentation-falcon = { workspace = true }
opentelemetry-instrumentation-fastapi = { workspace = true }
opentelemetry-instrumentation-flask = { workspace = true }
opentelemetry-instrumentation-grpc = { workspace = true }
opentelemetry-instrumentation-httpx = { workspace = true }
opentelemetry-instrumentation-jinja2 = { workspace = true }
opentelemetry-instrumentation-kafka-python = { workspace = true }
opentelemetry-instrumentation-logging = { workspace = true }
opentelemetry-instrumentation-mysql = { workspace = true }
opentelemetry-instrumentation-mysqlclient = { workspace = true }
opentelemetry-instrumentation-pika = { workspace = true }
opentelemetry-instrumentation-psycopg = { workspace = true }
opentelemetry-instrumentation-psycopg2 = { workspace = true }
opentelemetry-instrumentation-pymemcache = { workspace = true }
opentelemetry-instrumentation-pymongo = { workspace = true }
opentelemetry-instrumentation-pymysql = { workspace = true }
opentelemetry-instrumentation-pyramid = { workspace = true }
opentelemetry-instrumentation-redis = { workspace = true }
opentelemetry-instrumentation-remoulade = { workspace = true }
opentelemetry-instrumentation-requests = { workspace = true }
opentelemetry-instrumentation-sqlalchemy = { workspace = true }
opentelemetry-instrumentation-sqlite3 = { workspace = true }
opentelemetry-instrumentation-system-metrics = { workspace = true }
opentelemetry-instrumentation-threading = { workspace = true }
opentelemetry-instrumentation-tornado = { workspace = true }
opentelemetry-instrumentation-tortoiseorm = { workspace = true }
opentelemetry-instrumentation-urllib = { workspace = true }
opentelemetry-instrumentation-urllib3 = { workspace = true }
opentelemetry-instrumentation-wsgi = { workspace = true }
opentelemetry-propagator-ot-trace = { workspace = true }
opentelemetry-util-http = { workspace = true }
# https://docs.astral.sh/uv/reference/settings/#workspace
[tool.uv.workspace]
members = [
"instrumentation/*",
"exporter/*",
"opentelemetry-instrumentation",
"propagator/opentelemetry-propagator-ot-trace",
"util/opentelemetry-util-http",
]
[tool.ruff]
# https://docs.astral.sh/ruff/configuration/
target-version = "py38"
line-length = 79
extend-exclude = [
"_template",
"*_pb2*.py*",
]
extend-exclude = ["_template", "*_pb2*.py*"]
output-format = "concise"
[tool.ruff.lint]

5181
uv.lock generated Normal file

File diff suppressed because it is too large Load Diff