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

Modernize classes to use Python 3 syntax #7937

Merged
merged 9 commits into from Jun 23, 2019

Conversation

Projects
None yet
2 participants
@Eric-Arellano
Copy link
Contributor

commented Jun 22, 2019

Python 3 makes it repetitive to subclass object and to call the verbose form of super().

We use this script to update the codebase to use the simpler style, excluding the contrib.python.checks.checker package. The main part of this script is these two regex substitutions:

re.sub(r"super\([a-zA-Z]+, [a-z]+\)", "super()")
re.sub(r"class (?P<className>[a-zA-Z]*)\(object\):", r"class \g<className>:")
@Eric-Arellano

This comment has been minimized.

Copy link
Contributor Author

commented Jun 22, 2019

This depends on #7934 to be merged for green CI.

Each commit may be independently reviewed.

@jsirois
Copy link
Member

left a comment

My review of cf1d38d was cursory, but the other commits definitely look good.

@Eric-Arellano

This comment has been minimized.

Copy link
Contributor Author

commented Jun 22, 2019

My review of cf1d38d was cursory, but the other commits definitely look good.

I did a close review of it, which is what resulted in 0042167. Will likely closely review one more time before merging. Hoping CI will catch issues as well.

Thanks for the review!

Eric-Arellano added some commits Jun 22, 2019

Update docs
SKIP_FULL_CI  # Documentation-only change.

# Delete this line to force a full CI run for documentation-only changes.
SKIP_FULL_CI  # Documentation-only change.

# Delete this line to force a full CI run for documentation-only changes.
SKIP_FULL_CI  # Documentation-only change.
Restore old-style for Addressable, which has crazy meta-programming
I'm not sure why this is necessary, but it is.

@Eric-Arellano Eric-Arellano marked this pull request as ready for review Jun 23, 2019

@Eric-Arellano Eric-Arellano force-pushed the Eric-Arellano:modernize-classes branch from 87ef6fd to 5684300 Jun 23, 2019

@Eric-Arellano Eric-Arellano merged commit 14e0bd6 into pantsbuild:master Jun 23, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@Eric-Arellano Eric-Arellano deleted the Eric-Arellano:modernize-classes branch Jun 23, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.