Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Drop support of old Python version

Erik Welch edited this pageAug 10, 2023 ·4 revisions

For the most part, dropping support of old Python versions is the opposite ofsupport new Python version,but with a few more checks.

As per our policy,we aim to support Python versions for at least 42 months (or 36 months if it's troublesome for some reason).In practice, we can probably support versions of Python for longer, b/c it does not cost us any extra CI time (b/c we choose versions randomly).If supporting an extra-old version of Python ever becomes a nuisance, or if we want new features available in the next Python version,then by all means drop support for it! It may also be interesting to look at download data to see usage of different versions.

pyproject.toml

  • Remove"py3x" from[tool.black.target-version]
  • Remove"Programming Language :: Python :: 3.x", from[project.classifiers]
  • Remove unnecessary warning filters in[tool.pytest.ini_options.filterwarnings]
  • Update[tool.ruff.target-version] to next version, such as"py39"
  • Update minimum dependency versions inpyproject.toml (dependencies andoptional-dependencies) to match what we test
    • (Optional) Also, removing support of a Python version is a natural time to remove supported versions of dependencies,which we may support for much longer than 24 months if it's trivial to do so.

.github/workflows/imports.yml

  • Remove3.x option from randompyver (and its weight)

.github/workflows/test_and_build.yml

  • Remove3.x option from randompyver (and its weight)
  • Deleteif branch under "Update env" task for this Python version
    • Note that this can, in effect, increase the minimum supported version of a dependency

.pre-commit-config.yaml

  • Updateargs ofpyupgrade pre-commit, such asargs: [--py39-plus]

Wrap it up

Update versions underpython-version: in e.g. CI scripts. Find them:

  • $ git grep 'python-version.*3.8'

As a sanity check, perform a search to see if there are any lingering items (you can also start with this step!)

  • $ git grep 3\.8
  • $ git grep py38
  • $ git grep MAINT

Update Python version inbinder/environment.yml anddocs/env.yml whenever.

Finally, be aware of any other new Python features that are now available to useand whether anyfrom __future__ import whatever are no longer needed.Sometimes, the linters as part of pre-commit will update or flag things for us.

Clone this wiki locally


[8]ページ先頭

©2009-2025 Movatter.jp