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 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 tirkarthi left a comment

Choose a reason for hiding this comment

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

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
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
@cjw296 cjw296 deleted the backport_friendly_imports branch January 27, 2020 14:11
shihai1991 pushed a commit to shihai1991/cpython that referenced this pull request Jan 31, 2020
…nGH-18197)

* asyncio.run only available in 3.8+

* iscoroutinefunction has important bungfixes in 3.8

* IsolatedAsyncioTestCase only available in 3.8+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants