Skip to content

Commit

Permalink
Drop support of Python 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
loechel committed Oct 7, 2023
1 parent babc889 commit 075f8fe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion config/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ To run the script just call it::
Dropping support for legacy Python versions
-------------------------------------------

To drop support for Python 2.7 up to 3.6 several steps have to be done as
To drop support for Python 2.7 up to 3.7 several steps have to be done as
documented at https://zope.dev/developer/python2.html#how-to-drop-support.
There is a script to ease this process.

Expand Down
16 changes: 8 additions & 8 deletions config/drop-legacy-python.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@


parser = argparse.ArgumentParser(
description='Drop support of Python 2.7 up to 3.6 from a package.')
description='Drop support of Python 2.7 up to 3.7 from a package.')
parser.add_argument(
'path', type=pathlib.Path, help='path to the repository to be configured')
parser.add_argument(
Expand Down Expand Up @@ -52,13 +52,13 @@
if not args.interactive:
call(bin_dir / 'bumpversion', '--breaking', '--no-input')
call(bin_dir / 'addchangelogentry',
'Drop support for Python 2.7, 3.5, 3.6.', '--no-input')
'Drop support for Python 2.7, 3.5, 3.6., 3.7.', '--no-input')
else:
call(bin_dir / 'bumpversion', '--breaking')
call(bin_dir / 'addchangelogentry',
'Drop support for Python 2.7, 3.5, 3.6.')
'Drop support for Python 2.7, 3.5, 3.6., 3.7.')
call(bin_dir / 'check-python-versions',
'--drop=2.7,3.5,3.6', '--only=setup.py')
'--drop=2.7,3.5,3.6,3.7', '--only=setup.py')
print('Remove legacy Python specific settings from .meta.toml')
call(os.environ['EDITOR'], '.meta.toml')

Expand All @@ -76,8 +76,8 @@
call(os.environ['EDITOR'], 'setup.py')
src = path.resolve() / 'src'
call('find', src, '-name', '*.py', '-exec',
bin_dir / 'pyupgrade', '--py3-plus', '--py37-plus', '{}', ';')
call(bin_dir / 'pyupgrade', '--py3-plus', '--py37-plus', 'setup.py',
bin_dir / 'pyupgrade', '--py3-plus', '--py38-plus', '{}', ';')
call(bin_dir / 'pyupgrade', '--py3-plus', '--py38-plus', 'setup.py',
allowed_return_codes=(0, 1))

excludes = ('--exclude-dir', '__pycache__', '--exclude-dir', '*.egg-info',
Expand All @@ -88,7 +88,7 @@
wait_for_accept()
print('Replace any remaining code that may support legacy Python 2:')
call('egrep', '-rn',
'2.7|3.5|3.6|sys.version|PY2|PY3|Py2|Py3|Python 2|Python 3'
'2.7|3.5|3.6|3.7|sys.version|PY2|PY3|Py2|Py3|Python 2|Python 3'
'|__unicode__|ImportError', src, *excludes,
allowed_return_codes=(0, 1))
wait_for_accept()
Expand All @@ -97,7 +97,7 @@
if not args.interactive:
print('Adding, committing and pushing all changes ...')
call('git', 'add', '.')
call('git', 'commit', '-m', 'Drop support for Python 2.7 up to 3.6.')
call('git', 'commit', '-m', 'Drop support for Python 2.7 up to 3.7.')
call('git', 'push', '--set-upstream', 'origin', branch_name)
if updating:
print('Updated the previously created PR.')
Expand Down

0 comments on commit 075f8fe

Please sign in to comment.