Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introducing tox-uv #2667

Draft
wants to merge 20 commits into
base: main
Choose a base branch
from
16 changes: 14 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,18 @@ See
[`tox.ini`](https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/tox.ini)
for more detail on available tox commands.

### Run tests with tox-uv (experimental)

You can speedup the tests by run tox with `uv` support using the following commands:
```sh
$ pip install tox-uv
```

```sh
# Will use uv
$ TOX_ENV="uv" tox -e py312-test-instrumentation-aiopg
emdneto marked this conversation as resolved.
Show resolved Hide resolved
```

### 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.
Expand Down Expand Up @@ -141,7 +153,7 @@ Run tests:

```sh
# make sure you have all supported versions of Python installed
$ pip install tox # only first time.
$ pip install tox tox-uv # only first time.
$ tox # execute in the root of the repository
```

Expand Down Expand Up @@ -213,7 +225,7 @@ For a deeper discussion, see: https://github.com/open-telemetry/opentelemetry-sp
## Running Tests Locally

1. Go to your Contrib repo directory. `git clone git@github.com:open-telemetry/opentelemetry-python-contrib.git && cd opentelemetry-python-contrib`.
2. Make sure you have `tox` installed. `pip install tox`.
2. Make sure you have `tox` installed. `pip install tox tox-uv`.
3. Run `tox` without any arguments to run tests for all the packages. Read more about [tox](https://tox.readthedocs.io/en/latest/).

Some tests can be slow due to pre-steps that do dependencies installs. To help with that, you can run tox a first time, and after that run the tests using previous installed dependencies in toxdir as following:
Expand Down
Loading
Loading