Skip to content

Pin the Python version#1195

Merged
tsmbland merged 1 commit intomainfrom
python_version
Mar 13, 2026
Merged

Pin the Python version#1195
tsmbland merged 1 commit intomainfrom
python_version

Conversation

@tsmbland
Copy link
Copy Markdown
Collaborator

@tsmbland tsmbland commented Mar 11, 2026

Just had a go setting everything up on a new laptop, following the dev instruction. All super clear and everything worked really well with one exception, when I got to running pre-commit hooks with just pre-commit:

ERROR: Package 'check-jsonschema' requires a different Python: 3.9.6 not in '>=3.10'

I was able to fix it by running

uv tool install --python 3.12 pre-commit --force

but perhaps better to pin the Python version using a .python-version file, as described here. Unless there's some reason why we shouldn't pin the Python version?

@tsmbland tsmbland marked this pull request as ready for review March 11, 2026 21:53
Copilot AI review requested due to automatic review settings March 11, 2026 21:53
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.32%. Comparing base (ceb32bc) to head (21a6876).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1195   +/-   ##
=======================================
  Coverage   87.32%   87.32%           
=======================================
  Files          57       57           
  Lines        7726     7726           
  Branches     7726     7726           
=======================================
  Hits         6747     6747           
  Misses        673      673           
  Partials      306      306           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a repository-level Python version pin to make uv/pre-commit setup reproducible across developer machines and avoid failures from using an older system Python.

Changes:

  • Introduces a .python-version file specifying Python 3.12 for tooling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@tsmbland tsmbland requested a review from alexdewar March 12, 2026 08:27
Copy link
Copy Markdown
Collaborator

@alexdewar alexdewar left a comment

Choose a reason for hiding this comment

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

but perhaps better to pin the Python version using a .python-version file, as described here. Unless there's some reason why we shouldn't pin the Python version?

No, I think this is a good idea!

In fact, maybe we should consider having a pyproject.toml file and pinning the versions of Python dependencies there, as well as the Python version. (I've just been adding dependencies to scripts directly like this so far.) I can imagine that a few of the docs-related scripts might just stop working in a few years, which will mean we have the annoyance of backporting patches in order to build old docs. What do you think?

Either way, this is an improvement, so I think we should merge and worry about that later.

@tsmbland tsmbland merged commit 0eedcfe into main Mar 13, 2026
12 checks passed
@tsmbland tsmbland deleted the python_version branch March 13, 2026 15:07
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