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

Improve tox.ini testing commands for local development #4237

Closed
emdneto opened this issue Oct 24, 2024 · 0 comments · Fixed by #4238
Closed

Improve tox.ini testing commands for local development #4237

emdneto opened this issue Oct 24, 2024 · 0 comments · Fixed by #4238
Assignees
Labels
build & infra Issues related to build & infrastructure.

Comments

@emdneto
Copy link
Member

emdneto commented Oct 24, 2024

Description

Currently, in our tox.ini files, we install the required packages for each command using pip install in the commands_pre section. This leads to unnecessary re-installation of packages every time tox -e py312-test... is run, which increases the overall execution time of tests and creates inefficiencies in the testing process while locally developing.

So, the idea is to move the package installation commands from the commands_pre section to the deps section in the tox.ini file. The deps section is designed to handle package dependencies efficiently, ensuring:

  • Caching and reuse: Dependencies will only be installed once when necessary, such as when there are changes in the environment or the dependencies themselves.
  • Optimized tox runs: Reduces test run times by avoiding redundant package installations (which is excellent for local development, especially in contrib-repo)

A key advantage of this approach is that it allows the use of tox-uv (a tox plugin that optimizes package installation - very fast) without requiring any additional changes to our tox.ini file. See open-telemetry/opentelemetry-python-contrib#2667

@emdneto emdneto added the build & infra Issues related to build & infrastructure. label Oct 24, 2024
@emdneto emdneto self-assigned this Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build & infra Issues related to build & infrastructure.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant