Skip to content

Commit 1ddba1b

Browse files
emdnetoxrmx
andauthored
contributing: add guidance on how to update package versions support (open-telemetry#3090)
* contributing: add guidance for update package versions support Signed-off-by: emdneto <[email protected]> * update the guide Signed-off-by: emdneto <[email protected]> * Update CONTRIBUTING.md * Update CONTRIBUTING.md Co-authored-by: Riccardo Magliocchetti <[email protected]> * Update CONTRIBUTING.md Co-authored-by: Riccardo Magliocchetti <[email protected]> * Update CONTRIBUTING.md to add docs instructions * Update CONTRIBUTING.md * Update CONTRIBUTING.md --------- Signed-off-by: emdneto <[email protected]> Co-authored-by: Riccardo Magliocchetti <[email protected]>
1 parent 52ff7bd commit 1ddba1b

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

CONTRIBUTING.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ You can run `tox` with the following arguments:
6363

6464
* `tox` to run all existing tox commands, including unit tests for all packages
6565
under multiple Python versions
66-
* `tox -e docs` to regenerate the API docs
66+
* `tox -e docs` to regenerate all docs
6767
* `tox -e py312-test-instrumentation-aiopg` to e.g. run the aiopg instrumentation unit tests under a specific
6868
Python version
6969
* `tox -e spellcheck` to run a spellcheck on all the code
@@ -89,7 +89,9 @@ for more detail on available tox commands.
8989

9090
### Troubleshooting
9191

92-
> 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.
92+
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.
93+
94+
For `docs` building, you may need to install `mysql-client` and other required dependencies as necessary. Ensure the Python version used in your local setup matches the version used in the [CI](./.github/workflows/) to maintain compatibility when building the documentation.
9395

9496
### Benchmarks
9597

@@ -278,6 +280,20 @@ Below is a checklist of things to be mindful of when implementing a new instrume
278280
- Testing
279281
- When adding a new instrumentation remember to update `tox.ini` adding appropriate rules in `envlist`, `command_pre` and `commands` sections
280282

283+
### Update supported instrumentation package versions
284+
285+
- Navigate to the **instrumentation package directory:**
286+
- Update **`pyproject.toml`** file by modifying _instruments_ entry in the `[project.optional-dependencies]` section with the new version constraint
287+
- Update `_instruments` variable in instrumentation **`package.py`** file with the new version constraint
288+
- At the **root of the project directory**, run `tox -e generate` to regenerate necessary files
289+
290+
If you're adding support for a new version of the instrumentation package, follow these additional steps:
291+
292+
- At the **instrumentation package directory:** Add new test-requirements.txt file with the respective package version required for testing
293+
- At the **root of the project directory**: Add a new test environment entry for the package version in [tox.ini](./tox.ini) and run `tox -e generate-workflows` to regenerate new workflows accordingly. In the same [tox.ini](./tox.ini) file, search for `opentelemetry-instrumentation-{package}/test-requirements` and add a new line to point to the new test-requirements.txt you created in the previous step so tox can install the correct requirements.
294+
295+
Example PRs: [#2976](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2976), [#2845](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2845)
296+
281297
## Guideline for GenAI instrumentations
282298

283299
Instrumentations that relate to [Generative AI](https://opentelemetry.io/docs/specs/semconv/gen-ai/) systems will be placed in the [instrumentation-genai](./instrumentation-genai) folder. This section covers contributions related to those instrumentations. Please note that the [guidelines for instrumentations](#guideline-for-instrumentations) and [expectations from contributors](#expectations-from-contributors) still apply.

0 commit comments

Comments
 (0)