open-telemetry / open-telemetry/opentelemetry-python

Make `docs` generation more consistent between CI/CD and local

Open
#4,730 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request
Dominant language
Python
Stars
2.6k
Forks
1k
Avg merge
4d 15h
Merged PRs (30d)
19

Description

Is your feature request related to a problem?

While reviewing https://github.com/open-telemetry/opentelemetry-python/pull/4728, there were Misc 0 / docs workflow failures which were correctly detecting formatting issues. I think these are always run with Python 3.11. However, some of us had issues reproducing the same errors on our local environments with tox -e doc.

For example, the workflow gave this failure:

sphinx.errors.SphinxWarning: /home/runner/work/opentelemetry-python/opentelemetry-python/docs/examples/metrics/prometheus-grafana/README.rst:63:'any' reference target not found: MyAppPrefix_my_counter_total

But on local with Python 3.13 virtual environments, we'd get other unrelated failures first:

/Users/tammy.baylis/Dev/dupes3/opentelemetry-python/opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal/__init__.py:docstring of opentelemetry.sdk._logs._internal.LogRecord:1:more than one target found for cross-reference 'Context': opentelemetry.context.Context, opentelemetry.context.context.Context

Describe the solution you'd like

I'm not sure! Here are some ideas:

(A) Update Development info to mention that CI/CD for several jobs are run in Python 3.11, so choose your environment with that in mind.

(B) Change basepython for docs to Python 3.11 to match but duplicate CI/CD.

(C) Upgrade template to newest Python 3.13.

(D) If we did (C), we'd also have to update several existing docstring that are reporting issues with opentelemetry.context.context.Context like above. Or, if such errors are temporary as Logging API becomes stable, maybe we update docs/conf.py with several new nitpick_ignore entries temporarily.

Describe alternatives you've considered

No response

Additional Context

No response

Would you like to implement a fix?

None

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the docs job in .github/workflows/misc_0.yml, its template at .github/workflows/templates/misc.yml.j2, and the docs tox environment in tox.ini. Review the Development info section of CONTRIBUTING.md and docs/conf.py for the documented Python version and warning handling. Done means the chosen local and CI setup is consistent and the documented docs check reproduces the relevant failures.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, ci-cd, documentation
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.