Skip to content

Add a comment showing how to call main using runpy #7471

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

Merged
merged 3 commits into from
Dec 12, 2019

Conversation

pfmoore
Copy link
Member

@pfmoore pfmoore commented Dec 12, 2019

Context: https://discuss.python.org/t/can-we-finally-add-a-minimal-api-to-pip/2833/14

This does not endorse using main() as an API to pip.

The only purpose of this comment is to document the correct invocation of runpy.run_module to execute pip, for those people who decide to run pip in-process in spite of our advice.

This would helps wrapper scripts like ensurepip, to protect them against needing to change if we move main() again.

@pfmoore pfmoore requested a review from pradyunsg December 12, 2019 09:14
@pradyunsg pradyunsg added skip news Does not need a NEWS file entry (eg: trivial changes) type: docs Documentation related labels Dec 12, 2019
@pradyunsg
Copy link
Member

pradyunsg commented Dec 12, 2019

Copy link
Member

@pradyunsg pradyunsg left a comment

Choose a reason for hiding this comment

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

nit: some blank lines have # at the start, other don't.

I don't really want to push for >5 hours of cumulative CI runtime, for something this trivial tho.

@pfmoore
Copy link
Member Author

pfmoore commented Dec 12, 2019

Blast, I missed those blank lines. Agreed re the CI costs. I wonder if there's a way to set things up so we can mark certain commits as "don't run CI"? But that's a topic for another issue.

Thanks for the review and the improved wording 🙂

@pfmoore pfmoore merged commit 8eb3bdb into pypa:master Dec 12, 2019
@pfmoore pfmoore deleted the runpy_comment branch December 12, 2019 11:23
@pradyunsg
Copy link
Member

pradyunsg commented Dec 12, 2019

"don't run CI"

You can add [skip ci] or [ci skip] to commits messages -- all CI services skip builds on those commits.

I don't know how they get reported to GitHub's Checks tho. :(

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jan 11, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Jan 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation skip news Does not need a NEWS file entry (eg: trivial changes) type: docs Documentation related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants