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

Use relative imports in mock and its tests to help backporting #18197

Merged
merged 3 commits into from Jan 27, 2020

Conversation

@cjw296
Copy link
Contributor

cjw296 commented Jan 27, 2020

I stopped short of putting comments at the top of each file explaining the import style, but I've tagged everyone I know of who's active in mock's development right now to ask if you can keep an eye out for import foo; foo.bar usage for things that aren't in Python 3.6+.

from foo import bar makes it much easier to backport just what's necessary and stops patches failing to apply cleanly going forwards.

@mariocj89 - tagging you too for reference :-)

Copy link
Member

tirkarthi left a comment

LGTM since it will help backporting. Maybe we need to add these points about imports to checklist too when changes to mock are made in future to be in line with backport. Thanks Chris.

@cjw296

This comment has been minimized.

Copy link
Contributor Author

cjw296 commented Jan 27, 2020

Yeah, I can't think of a good place to put such a checklist though.
Pragmatically, I've just tagged up the people in this PR who are likely to be merging, hopefully people will see it.

Better suggestions very gratefully received!

@cjw296 cjw296 merged commit c7dd3c7 into python:master Jan 27, 2020
8 checks passed
8 checks passed
Windows (x86)
Details
Windows (x64)
Details
macOS
Details
Ubuntu
Details
Azure Pipelines PR #20200127.9 succeeded
Details
bedevere/issue-number Issue report skipped
bedevere/news "skip news" label found
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@cjw296 cjw296 deleted the cjw296:backport_friendly_imports branch Jan 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.