- Add pyupgrade to
.pre-commit-config.yaml.
If supporting py35, use --py3-plus instead of --py37-plus.
- repo: https://github.com/asottile/pyupgrade
rev: ...latest version...
hooks:
- id: pyupgrade
args: [--py37-plus]- Run pre-commit (usually
tox -e lintin my projects). - Remove unnecessary
__future__imports. - Update
setup.py: remove classifiers and add/updatepython_requires
python_requires=">=3.7",- Remove conditional installs e.g.
'flake8-bugbear==19.8.0; python_version >= "3.5"'fromsetup.pyandpre-commit-config.yaml. - Update
tox.iniand CI config (azure-pipelines.ymlor.travis.yml). - Update installation/requirements and contributing docs.
- Update pyproject.yml (black) if it exists.
- Remove compatibility code:
compat.py,sys.version_infochecks,try:..except ImportError: - Use keyword-only arguments where sensible.
- Update changelog.
Some things for this:
try/exceptblocks for things like: