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 Python 2 remaining logic #279

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

Kludex
Copy link

@Kludex Kludex commented Dec 11, 2024

I think this is self-contained already.

@Kludex
Copy link
Author

Kludex commented Dec 11, 2024

I'm happy to continue the work to add type hints here, in case this is reviewed/accepted.

Copy link

@grayjk grayjk Dec 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can remove from __future__ import print_function. just use print

and in other files

@grayjk
Copy link

grayjk commented Dec 11, 2024

Recommend running pyupgrade --py38-plus to remove other python2-isms from the code

see https://github.com/asottile/pyupgrade

{ "__complex__", (PyCFunction)WraptObjectProxy_complex, METH_NOARGS, 0 },
#if PY_MAJOR_VERSION > 3 || (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 7)
#if PY_MINOR_VERSION >= 7
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though this section covers into Python 3 I would clean it up now else might be confusing when come back to to see just a minor version check.

@GrahamDumpleton
Copy link
Owner

Thanks, this is looking great. Only saw the one minor thing above where may be better to just always include the mro hook code rather than have that strange minor version check without a check for Python 3 specifically as well.

Also appreciate that except for trailing white space no reformatting was done to satisfy any standards as that makes it hard to review then. Once we have cleaned up stuff and merged we can look at running all the code through black formatter to standardize format. Same with running that pyupgrade thing, run it as part of separate PR after so is easier to review separately what it does.

Now prior to merging this, presuming is done, since I can’t make code changes myself right now since traveling, can someone make a separate PR which updates the wrapt version to 2.0.0.dev1 (can’t remember what latest convention is for version strings for dev, so check first) and add a 2.0.0 section in changes file with comment about removal of old code which supported 2.7 and Python < 3.8. Just because dropping so much code, adding type hints, and potentially another change I have in mind which may cause subtle difference, would prefer to increase major version so people are more careful in upgrading. I’ll merge the version upgrade before this, but now remembered I might have had some other unreleased changes in develop which maybe I should have released first as a minor update. From memory the change was only to add macOS Intel wheels which got lost from the last release, so only change is in GitHub actions. Either way I can’t do that release while traveling, so will be a delay either way.

@Kludex
Copy link
Author

Kludex commented Dec 11, 2024

No hurry here. I'll create the PR tomorrow (CET).

Enjoy the trip. 🙏

@Kludex
Copy link
Author

Kludex commented Dec 13, 2024

I'm not if it makes sense to add this before the 1.7.1 is released, but... #280

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants