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

bpo-22640: Add silent mode to py_compile #12976

Merged
merged 11 commits into from May 28, 2019

Conversation

nanjekyejoannah
Copy link
Member

@nanjekyejoannah nanjekyejoannah commented Apr 26, 2019

I have added silent mode to py_compile.

https://bugs.python.org/issue22640

@nanjekyejoannah nanjekyejoannah changed the title bpo-22640: Add silent mode for py_compile bpo-22640: Add silent mode to py_compile Apr 26, 2019
Copy link
Member

@berkerpeksag berkerpeksag left a comment

Please wait for @brettcannon's feedback before addressing my review comments. I opened bpo-22640 years ago and unfortunately I forgot to add Brett to nosy list.

Lib/py_compile.py Outdated Show resolved Hide resolved
Lib/test/test_py_compile.py Show resolved Hide resolved
@@ -192,6 +192,14 @@ def test_invalidation_mode(self):
fp.read(), 'test', {})
self.assertEqual(flags, 0b1)

def test_quiet(self):
bad_coding = os.path.join(os.path.dirname(__file__), 'bad_coding2.py')
with support.captured_stderr():
Copy link
Member

@berkerpeksag berkerpeksag Apr 26, 2019

Choose a reason for hiding this comment

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

Suggested change
with support.captured_stderr():
with support.captured_stderr() as stderr:

Then we can add something like

self.assertEqual(stderr.getvalue(), '')

to test the quiet option.

Copy link
Member

@berkerpeksag berkerpeksag May 24, 2019

Choose a reason for hiding this comment

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

Why did you mark this resolved? It still needs to be addressed.

Copy link
Member Author

@nanjekyejoannah nanjekyejoannah May 24, 2019

Choose a reason for hiding this comment

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

Sorry, I had confused it with @vadmium 's comment .

@@ -0,0 +1 @@
`py_compile` now supports silent mode.
Copy link
Member

@berkerpeksag berkerpeksag Apr 26, 2019

Choose a reason for hiding this comment

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

:func:`py_compile.compile`

Copy link
Member

@berkerpeksag berkerpeksag Apr 26, 2019

Choose a reason for hiding this comment

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

And please add "Patch by Your Name.".

Copy link
Member

@berkerpeksag berkerpeksag May 24, 2019

Choose a reason for hiding this comment

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

This comment is still needs to be addressed as well.

Doc/whatsnew/3.8.rst Outdated Show resolved Hide resolved
Doc/library/py_compile.rst Outdated Show resolved Hide resolved
Doc/library/py_compile.rst Outdated Show resolved Hide resolved
Doc/library/py_compile.rst Outdated Show resolved Hide resolved
Doc/library/py_compile.rst Outdated Show resolved Hide resolved
@bedevere-bot
Copy link

bedevere-bot commented Apr 26, 2019

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

Copy link
Contributor

@ZackerySpytz ZackerySpytz left a comment

Do not use "quite" instead of "quiet", please.

Doc/library/py_compile.rst Outdated Show resolved Hide resolved
Doc/library/py_compile.rst Outdated Show resolved Hide resolved
Lib/py_compile.py Outdated Show resolved Hide resolved
Lib/py_compile.py Outdated Show resolved Hide resolved
Lib/py_compile.py Outdated Show resolved Hide resolved
Lib/test/test_py_compile.py Show resolved Hide resolved
Doc/library/py_compile.rst Outdated Show resolved Hide resolved
Doc/whatsnew/3.8.rst Outdated Show resolved Hide resolved
@nanjekyejoannah
Copy link
Member Author

nanjekyejoannah commented Apr 27, 2019

Please wait for @brettcannon's feedback before addressing my review comments. I opened bpo-22640 years ago and unfortunately I forgot to add Brett to nosy list.

Noted.

@brettcannon
Copy link
Member

brettcannon commented May 6, 2019

I'm fine with the idea.

@nanjekyejoannah
Copy link
Member Author

nanjekyejoannah commented May 8, 2019

Great, I will finish addressing the reviews on this PR as soon as I can.

@nanjekyejoannah
Copy link
Member Author

nanjekyejoannah commented May 10, 2019

I have made the requested changes; please review again.

@bedevere-bot
Copy link

bedevere-bot commented May 10, 2019

Thanks for making the requested changes!

@berkerpeksag: please review the changes made to this pull request.

Copy link
Member

@berkerpeksag berkerpeksag left a comment

This looks good to me, thank you! I just left mostly trivial comments.

You may also want to check documentation changes with a native English speaker. I'm not a native speaker, so they may help us to simply documentation changes :)

Doc/library/py_compile.rst Outdated Show resolved Hide resolved
Doc/library/py_compile.rst Outdated Show resolved Hide resolved
Doc/library/py_compile.rst Outdated Show resolved Hide resolved
Doc/library/py_compile.rst Outdated Show resolved Hide resolved
Doc/whatsnew/3.8.rst Outdated Show resolved Hide resolved
Doc/whatsnew/3.8.rst Outdated Show resolved Hide resolved
Lib/py_compile.py Outdated Show resolved Hide resolved
@bedevere-bot
Copy link

bedevere-bot commented May 15, 2019

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

Doc/whatsnew/3.8.rst Outdated Show resolved Hide resolved
@ZackerySpytz
Copy link
Contributor

ZackerySpytz commented May 27, 2019

@nanjekyejoannah It seems that you marked my comment as "resolved", but the "What's New" entry still falsely states that py_compile.compile is a method. Please fix that.

@nanjekyejoannah
Copy link
Member Author

nanjekyejoannah commented May 27, 2019

@berkerpeksag PTAL .

@nanjekyejoannah
Copy link
Member Author

nanjekyejoannah commented May 28, 2019

I have made the requested changes; please review again .

@bedevere-bot
Copy link

bedevere-bot commented May 28, 2019

Thanks for making the requested changes!

@berkerpeksag: please review the changes made to this pull request.

@berkerpeksag berkerpeksag merged commit 2e33ecd into python:master May 28, 2019
5 checks passed
@berkerpeksag
Copy link
Member

berkerpeksag commented May 28, 2019

Thanks!

@nanjekyejoannah nanjekyejoannah deleted the issue22640 branch May 29, 2019
@vstinner
Copy link
Member

vstinner commented Jun 4, 2019

Well done @nanjekyejoannah!

@merwok
Copy link
Member

merwok commented Nov 15, 2019

Follow-up in #17134 to fix the NameErrors in main.
As this is already released, 3.7 should get a simple fix and 3.8 the missing part of the feature 🙂

@vstinner
Copy link
Member

vstinner commented Apr 30, 2020

It seems like this change introduced a regression in main(): see https://bugs.python.org/issue40456

@merwok
Copy link
Member

merwok commented Apr 30, 2020

It seems that you missed my previous message Victor! 🙂

@vstinner
Copy link
Member

vstinner commented Apr 30, 2020

It seems that you missed my previous message Victor! slightly_smiling_face

Oh, right. Well, the main() changes of this PR should be reverted in 3.8. #17134 is new feature which should not into 3.8.

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.

None yet

10 participants