-
Notifications
You must be signed in to change notification settings - Fork 38
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 python3.6 support #681
Conversation
CI config, tox, and setuptools config are all updated. pyupgrade is intentionally exempted so that it can be updated in a dedicated commit. The changelog fragment is included.
This applies some rewrites.
This was always going to be a multi-step process to add `__future__` imports, rewrite, and iterate. However, there's an additional wrinkle: unfortunately, `pyupgrade` does not support rewrites on `import typing as t`-style annotations. Therefore, the following procedure includes rewrites away from and back to this style. 1. Set future annotations in all files Run a script to inject `from __future__ import annotations` in all non-`__init__.py` python files in the src tree. 2. Convert `import typing as t` style to `import typing` style This was done with a combination of scripts and macros. 3. Run `pre-commit run -a` to converge Converge, converge, converge. `black`, `isort`, `pyupgrade`, until they get along. 4. Convert `import typing` style back to `import typing as t` style Again, scripts and editor macros. Converge again, as the rewrites may fold out and fold in with `black`, especially. 5. Update _generate_init.py to not check python version The TYPE_CHECKING branch was combined with the py3.6 branch. Remove that logic for better clarity.
- A tox environment list in the Makefile (aside: maybe remove in the future?) - A bit of documentation text in `_testing`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for keeping the pyupgrade modifications in a separate commit! I basically glossed over that as "tools doing what tools do...nothing to see here".
I was really surprised when I got back to this to see the pylint failure. But the diff to fix it is + type: None # pylint: disable=redefined-builtin
+ | (Literal["file", "dir"]) = None,
- type: None
- | (Literal["file", "dir"]) = None, # pylint: disable=redefined-builtin So I think we can see what happened here, at some level. |
Remove it from all CI and configurations, docs, etc.
Then, do some rewrite magic (my fingers are sore from my macros!) to get
__future__
style annotations in place.Nothing is changing other than the removal of 3.6 support and the future possibility of 3.6 support on this branch.
I am ready to get this
list[Changes]
merged. Are you?