Skip to content

Fix docs environment to Python 3.12.#1942

Merged
mhsmith merged 5 commits intobeeware:mainfrom
freakboy3742:docs-pyver
Aug 7, 2024
Merged

Fix docs environment to Python 3.12.#1942
mhsmith merged 5 commits intobeeware:mainfrom
freakboy3742:docs-pyver

Conversation

@freakboy3742
Copy link
Member

The changes in #1940 didn't have the desired effect on dependabot (see #1937).

This takes a different approach - since RTD always uses Python3.12 as the build environment, we can force tox to also use Python3.12 as a development environment. This radically simplifies dependency configuration (as we only
need to worry about a single Python version), and eliminates a potential source of bugs (as different Python versions can render details like type annotations differently).

PR Checklist:

  • All new features have been tested
  • All new features have been documented
  • I have read the CONTRIBUTING.md file
  • I will abide by the code of conduct

@freakboy3742 freakboy3742 requested a review from mhsmith August 7, 2024 00:15
@rmartin16
Copy link
Member

rmartin16 commented Aug 7, 2024

FWIW, while I philosophically support this change, I expect some subset of contributors to not understand how to satisfy this requirement....and it's usually non-trivial to explain to someone how to set up side-by-side Python installs 🫤

tox.ini Outdated
sphinx_args = --show-traceback --fail-on-warning --keep-going --jobs auto

[testenv:docs{,-lint,-all,-live}]
basepython = python3.12
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency :) or perhaps the coverage section could be updated to match this

Suggested change
basepython = python3.12
base_python = py312

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WHY ARE THERE TWO VALID SYNTAXES FOR THIS!!>!!KJHKJH!OI&!^&!

@freakboy3742
Copy link
Member Author

I agree this is a concern. However, the Sphinx ecosystem is making supporting "all valid Python versions" exceedingly difficult (deprecating Python 3.9 a full year before it goes EOL), and there are some advantages (such as being consistent with RTD rendering) that I think it's worth the pain.

If it turns out that it's more trouble than wrangling version dependencies, we can easily revert this and find another way to keep dependabot happy.

@mhsmith
Copy link
Member

mhsmith commented Aug 7, 2024

We now have 4 places referencing the Python version number. There's a very good chance that we'll forget one of them next time we have to update this.

Three of them are unavoidable: contribute-docs.rst, tox.ini and readthedocs.yaml. But they should each have a comment referencing the other two.

In pyproject.toml we can simply remove the expicit Python version number and change it to something like "Docs are always built on a specific Python version; see ...".

@mhsmith mhsmith merged commit 293bf2e into beeware:main Aug 7, 2024
@freakboy3742 freakboy3742 deleted the docs-pyver branch August 8, 2024 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants