Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop support of Python 3.7 #217

Merged
merged 5 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,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 @@ -26,7 +26,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 @@ -65,13 +65,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 @@ -89,8 +89,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 @@ -101,7 +101,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 @@ -110,7 +110,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