Skip to content

Drop support for legacy Python versions#407

Merged
tomodwyer merged 6 commits into
mainfrom
tomodwyer/drop-legacy-python
Jul 22, 2026
Merged

Drop support for legacy Python versions#407
tomodwyer merged 6 commits into
mainfrom
tomodwyer/drop-legacy-python

Conversation

@tomodwyer

@tomodwyer tomodwyer commented Jun 9, 2026

Copy link
Copy Markdown
Member

Part of #280

This PR removes support in OpenSAFELY CLI for Python v3.8 and v3.9. As we are now updating to use 3.10, we take the opportunity to bump our dependencies, meaning we can also remove black and replace it with ruff - as we have in other repos.

This PR does not include just update-vendored-dependencies as that is a RAP task.

Changes

  • Bump minimum Python version to 3.10
  • Update dependencies for Python 3.10+
  • Replace black with Ruff
    Now that we have updated to a modern version of Ruff
  • Run just fix to update syntax for Ruff

@tomodwyer tomodwyer self-assigned this Jun 9, 2026
Comment thread opensafely/_vendor/requests/auth.py Fixed
Comment thread opensafely/_vendor/requests/auth.py Fixed
Comment thread opensafely/_vendor/requests/auth.py Fixed
Comment thread opensafely/_vendor/requests/auth.py Fixed
@tomodwyer
tomodwyer force-pushed the tomodwyer/drop-legacy-python branch 4 times, most recently from abc8124 to 9287068 Compare July 14, 2026 09:05
@tomodwyer
tomodwyer marked this pull request as ready for review July 14, 2026 13:54

@StevenMaude StevenMaude left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The changes look fine; thanks for this.

Before we merge this, is it worth considering a final <3.10 supporting release with a check of the Python version at startup, and a warning if the Python version is <3.10?

The warning might state something like:

The installed Python version being used to run the OpenSAFELY CLI is older than Python 3.10 and now end-of-life.

This installed version of OpenSAFELY CLI will continue to run, but you will no longer receive new versions of the OpenSAFELY CLI.

Please upgrade your Python installation to ensure you can upgrade to new versions of the OpenSAFELY CLI.

It's fine if the answer is "no", but I'm not sure if this idea has been discussed anywhere before.

Comment thread .github/workflows/tests.yaml
@StevenMaude

StevenMaude commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

thought: I would really like for us to go to further on this, but also concede that this is a reasonable and low risk improvement for now.

That's since:

  • Python 3.10 is nearly five years old, which still restricts us from using some newer features.
  • Python 3.10 is end-of-life as of end October 2026 (just three months). We'll be shortly in the situation again where dependencies can't be updated: they'll drop support for end-of-life Python.

But #280 was only scoped to the end-of-life versions incrementally.

So for now, I'll happily take a more regular maintenance cycle in line with Python end-of-life. Maybe other ideas like using uv (#277) make this simpler for end users to manage upgrades in future?

Doing this as a hopefully minimally disruptive upgrade with few users affected gets us some way towards modernising our users' installations, and figuring out how best to conduct these upgrade cycles.

@tomodwyer

Copy link
Copy Markdown
Member Author

@StevenMaude yes I think moving the uv and getting off 3.10 before the end of its life cycle should be the next steps.

@tomodwyer
tomodwyer force-pushed the tomodwyer/drop-legacy-python branch from dd2a3ae to c22ff54 Compare July 22, 2026 15:37
@tomodwyer
tomodwyer requested a review from StevenMaude July 22, 2026 15:39
@tomodwyer
tomodwyer force-pushed the tomodwyer/drop-legacy-python branch from 4e44b8c to a055f4f Compare July 22, 2026 15:53
Comment thread tests/test_init.py Outdated
@tomodwyer
tomodwyer force-pushed the tomodwyer/drop-legacy-python branch from a055f4f to 108f069 Compare July 22, 2026 16:01
@tomodwyer
tomodwyer merged commit b57c10f into main Jul 22, 2026
11 checks passed
@tomodwyer
tomodwyer deleted the tomodwyer/drop-legacy-python branch July 22, 2026 16: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