You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to propose add a --upgrade to venv module to automatically update pip and potentially setuptools if supplied. This will allow ensuring you have the latest and greatest of these core components.
Example Usage:
python3 -m venv --upgrade /tmp/awesome_venv
This will allow me to skip my next command that I usually always do:
/tmp/awesome_venv/bin/pip install --upgrade pip setuptools
Thoughts? If people are happy, I will look at doing the PR.
I would envision I'll either import (which seems to be a no no from pip maintainers) the upgrade code or just fork pip ...
This sounds good to me; my python -m venv venv commands are also almost always followed up by venv/bin/python -m pip install -U pip setuptools wheel. I wouldn't get the wheel from this, but it's not always necessary anyway.
Rather than importing or forking, I would expect this could just be done by invoking the venv's pip as a subprocess.
Also, it would need to be a different flag than --upgrade, which already exists.
cooperlees commented on Aug 31, 2018
cooperleesmannequin
MannequinAuthor
More actions
Thanks for hi-lighting, yes, sorry. I should of been clearer here.
What should we use other than --upgrade? I just wanted the topic to be generic:
-U
--upgrade-modules
--pip-upgrade
--pull-latest
In regards to using subprocess, it calls exec or fork to run the child process/command, so that's what I wished to communicate via the term 'fork'.
That’s very disappointing. I had the very small PR ready to merge ~3 weeks before beta1. I now have to wait ~1.5years to be able to use this anywhere that I won’t be back porting it.
I am happy to be on the hook and forward fix anything it causes, but as a new CLI argument that does nothing unless specified, I can’t really see any disadvantages of merging this into 3.8. Is there any way other than discussing with the release manager to have this considered?
Activity
cooperlees commentedon Aug 31, 2018
I'd like to propose add a
--upgradeto venv module to automatically update pip and potentially setuptools if supplied. This will allow ensuring you have the latest and greatest of these core components.Example Usage:
python3 -m venv --upgrade /tmp/awesome_venv
This will allow me to skip my next command that I usually always do:
/tmp/awesome_venv/bin/pip install --upgrade pip setuptools
Thoughts? If people are happy, I will look at doing the PR.
I would envision I'll either import (which seems to be a no no from pip maintainers) the upgrade code or just fork pip ...
zware commentedon Aug 31, 2018
This sounds good to me; my
python -m venv venvcommands are also almost always followed up byvenv/bin/python -m pip install -U pip setuptools wheel. I wouldn't get thewheelfrom this, but it's not always necessary anyway.Rather than importing or forking, I would expect this could just be done by invoking the venv's pip as a subprocess.
Also, it would need to be a different flag than
--upgrade, which already exists.cooperlees commentedon Aug 31, 2018
Thanks for hi-lighting, yes, sorry. I should of been clearer here.
What should we use other than
--upgrade? I just wanted the topic to be generic:-U--upgrade-modules--pip-upgrade--pull-latestIn regards to using subprocess, it calls exec or fork to run the child process/command, so that's what I wished to communicate via the term 'fork'.
ambv commentedon Jun 17, 2019
New changeset 4acdbf1 by Łukasz Langa (Cooper Lees) in branch 'master':
bpo-34556: Add --upgrade-deps to venv module (bpo-13100)
4acdbf1
vsajip commentedon Jun 22, 2019
Can this issue be closed now?
cooperlees commentedon Jun 23, 2019
I believe so - Would love it could be included with latest 3.8 or is there no chance of that?
vsajip commentedon Jun 24, 2019
Unfortunately not, I think, as it missed the cut for 3.8beta1. Never mind! Thanks for your contribution.
cooperlees commentedon Jun 24, 2019
That’s very disappointing. I had the very small PR ready to merge ~3 weeks before beta1. I now have to wait ~1.5years to be able to use this anywhere that I won’t be back porting it.
I am happy to be on the hook and forward fix anything it causes, but as a new CLI argument that does nothing unless specified, I can’t really see any disadvantages of merging this into 3.8. Is there any way other than discussing with the release manager to have this considered?
[-]Add --upgrade to venv module[/-][+]Add --upgrade-deps to venv module[/+]vsajip commentedon Jun 29, 2019
I don't believe so.
miss-islington commentedon May 23, 2020
New changeset 1cba1c9 by Shantanu in branch 'master':
bpo-34556: Document addition of upgrade_deps to venv.create (GH-20135)
1cba1c9
johnthagen commentedon Sep 5, 2020
I noticed this new feature was not added to the Python 3.9 what's new: https://docs.python.org/3.9/whatsnew/3.9.html#venv
Should it be?
Hot-fix for broken Docker build