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-38662: Invoke pip via runpy, in ensurepip #18901

Merged
merged 4 commits into from
Mar 10, 2020

Conversation

hroncok
Copy link
Contributor

@hroncok hroncok commented Mar 10, 2020

This way, any changes to the internal pip API won't mean ensurepip needs to be
changed as well. Also, distributors can update their pip wheels independent on
CPython release schedule.

Co-Authored-By: @pradyunsg

Closes #17029

https://bugs.python.org/issue38662

This way, any changes to the internal pip API won't mean ensurepip needs to be
changed as well. Also, distributors can update their pip wheels independent on
CPython release schedule.

Co-Authored-By: Pradyun Gedam <pradyunsg@gmail.com>
Co-Authored-By: Miro Hrončok <miro@hroncok.cz>
Lib/ensurepip/__init__.py Outdated Show resolved Hide resolved
Lib/ensurepip/__init__.py Show resolved Hide resolved
Lib/ensurepip/__init__.py Outdated Show resolved Hide resolved
Co-Authored-By: Victor Stinner <vstinner@python.org>
Lib/ensurepip/__init__.py Outdated Show resolved Hide resolved
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.

Looks good to go, to me!

Co-Authored-By: Pradyun Gedam <pradyunsg@gmail.com>
@vstinner vstinner merged commit 88f82b2 into python:master Mar 10, 2020
@vstinner
Copy link
Member

Thanks @hroncok and @pradyunsg.

While it's not a major issue in CPython, I can say that being tightly coupled to pip internals is a major in Fedora which updates pip frequently and tries to support multiple pip versions.

@miss-islington
Copy link
Contributor

Thanks @hroncok for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Thanks @hroncok for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 10, 2020
The ensurepip module now invokes pip via the runpy module.
Hence it is no longer tightly coupled with the internal API of the bundled
pip version, allowing easier updates to a newer pip version both
internally and for distributors.

This way, any changes to the internal pip API won't mean ensurepip needs to be
changed as well. Also, distributors can update their pip wheels independent on
CPython release schedule.

Co-Authored-By: Pradyun Gedam <pradyunsg@gmail.com>
Co-Authored-By: Miro Hrončok <miro@hroncok.cz>
(cherry picked from commit 88f82b2)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
@bedevere-bot
Copy link

GH-18906 is a backport of this pull request to the 3.8 branch.

@bedevere-bot
Copy link

GH-18907 is a backport of this pull request to the 3.7 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 10, 2020
The ensurepip module now invokes pip via the runpy module.
Hence it is no longer tightly coupled with the internal API of the bundled
pip version, allowing easier updates to a newer pip version both
internally and for distributors.

This way, any changes to the internal pip API won't mean ensurepip needs to be
changed as well. Also, distributors can update their pip wheels independent on
CPython release schedule.

Co-Authored-By: Pradyun Gedam <pradyunsg@gmail.com>
Co-Authored-By: Miro Hrončok <miro@hroncok.cz>
(cherry picked from commit 88f82b2)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
@hroncok hroncok deleted the use-runpy-in-ensurepip branch March 10, 2020 21:23
@hroncok
Copy link
Contributor Author

hroncok commented Mar 10, 2020

I wasn't even hoping for a backport. Thanks!

miss-islington added a commit that referenced this pull request Mar 10, 2020
The ensurepip module now invokes pip via the runpy module.
Hence it is no longer tightly coupled with the internal API of the bundled
pip version, allowing easier updates to a newer pip version both
internally and for distributors.

This way, any changes to the internal pip API won't mean ensurepip needs to be
changed as well. Also, distributors can update their pip wheels independent on
CPython release schedule.

Co-Authored-By: Pradyun Gedam <pradyunsg@gmail.com>
Co-Authored-By: Miro Hrončok <miro@hroncok.cz>
(cherry picked from commit 88f82b2)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
miss-islington added a commit that referenced this pull request Mar 10, 2020
The ensurepip module now invokes pip via the runpy module.
Hence it is no longer tightly coupled with the internal API of the bundled
pip version, allowing easier updates to a newer pip version both
internally and for distributors.

This way, any changes to the internal pip API won't mean ensurepip needs to be
changed as well. Also, distributors can update their pip wheels independent on
CPython release schedule.

Co-Authored-By: Pradyun Gedam <pradyunsg@gmail.com>
Co-Authored-By: Miro Hrončok <miro@hroncok.cz>
(cherry picked from commit 88f82b2)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
@vstinner
Copy link
Member

vstinner commented Mar 12, 2020

@petdance: Do you have an idea why your CPython fork creates almost 20 new " petdance added a commit to petdance/cpython that referenced this pull request" comments???

I see that https://github.com/petdance/cpython/commit/c861affb02eb7a4a90d7c34f86c743545551d8a4 commit starts with " bpo-38662: ensurepip invokes pip via runpy (GH-18901) ". What is this "(GH-18901)" syntax? do you rewrite the Python history?

@petdance
Copy link
Contributor

I'm sorry, I don't know what's happening.

My normal process is to pull from upstream master daily, and then rebase my working branches against it my new master. Then I push the branches back. I'm not changing any history. I don't know what the "GH-18901" syntax is.

Clearly c861affb02eb7a4a90d7c34f86c743545551d8a4 somehow got created on my calloc branch but I don't know how/why. I'll look into it tonight.

@vstinner
Copy link
Member

vstinner commented Mar 12, 2020

In the master branch, the "bpo-38662: ensurepip invokes pip via runpy (GH-18901)" has the sha1: 88f82b2. In your repository, it has the sha1: c861affb02eb7a4a90d7c34f86c743545551d8a4 and the title "bpo-38662: ensurepip invokes pip via runpy (GH-18901)". Something replaced "GH-18901" with "GH-18901".

"GH-18901" syntax is used in Python to mean "identifier 18901 in the GitHub namespace", as bpo-123 is "123 in the bugs.python.org namespace".

My normal process is to pull from upstream master daily, and then rebase my working branches against it my new master.

How do you pull commits from GitHub? Which tools/commands are you using?

@petdance
Copy link
Contributor

petdance commented Mar 12, 2020

git co master
git pull upstream master
git push
git co dev
git rebase master
git push

That's it.

Maybe I screwed up a commit on my one calloc branch. Or has this happened elsewhere that can give me a clue?

@vstinner
Copy link
Member

Maybe I screwed up a commit on my one calloc branch. Or has this happened elsewhere that can give me a clue?

Try maybe to clone again a fresh copy of the cpython Git repository and restart from that point.

@petdance
Copy link
Contributor

petdance commented Mar 13, 2020

I deleted my calloc branch and recreated it fresh, and pushed it back to github. And then I git gcd my local repo. git branch --contains no longer finds the commit, but it's still on the Github side. Please let me know if this happens again. Sorry about the mess.

@vstinner
Copy link
Member

You added two more commmits to this PR :-)

petdance added a commit to petdance/cpython that referenced this pull request 4 hours ago

and

petdance added a commit to petdance/cpython that referenced this pull request 4 hours ago

"I deleted my calloc branch" Aha. I added PyMem_Calloc(). I recall that I ran some benchmarks. Tell me if you want me to have a look at your PR.

@petdance
Copy link
Contributor

The two weird commits have nothing to do with the calloc branch, though. :-(

Is there a bpo ticket you'd like me to add a calloc PR to? It's just 16 places where I changed malloc+memset to calloc.

@vstinner
Copy link
Member

Is there a bpo ticket you'd like me to add a calloc PR to? It's just 16 places where I changed malloc+memset to calloc.

If you want to make changes related to calloc, please open a new issue. I'm not aware of an open issue related to calloc.

@hroncok
Copy link
Contributor Author

hroncok commented Mar 13, 2020

JFYI I've unsubscribed. If there is anything related to this PR itself that needs my attention, please do mention me.

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.

7 participants