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

Add --upgrade-deps to venv module #78737

Closed
cooperlees mannequin opened this issue Aug 31, 2018 · 11 comments
Closed

Add --upgrade-deps to venv module #78737

cooperlees mannequin opened this issue Aug 31, 2018 · 11 comments
Labels
3.9 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@cooperlees
Copy link
Mannequin

cooperlees mannequin commented Aug 31, 2018

BPO 34556
Nosy @vsajip, @ambv, @zware, @johnthagen, @cooperlees, @miss-islington, @hauntsaninja
PRs
  • bpo-34556: Add --upgrade-deps to venv module #13100
  • bpo-34556: Document addition of upgrade_deps to venv.create #20135
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2019-06-24.06:59:01.296>
    created_at = <Date 2018-08-31.15:25:51.100>
    labels = ['type-feature', 'library', '3.9']
    title = 'Add --upgrade-deps to venv module'
    updated_at = <Date 2020-09-05.16:13:00.221>
    user = 'https://github.com/cooperlees'

    bugs.python.org fields:

    activity = <Date 2020-09-05.16:13:00.221>
    actor = 'John Hagen'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-06-24.06:59:01.296>
    closer = 'vinay.sajip'
    components = ['Library (Lib)']
    creation = <Date 2018-08-31.15:25:51.100>
    creator = 'cooperlees'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 34556
    keywords = ['patch']
    message_count = 11.0
    messages = ['324431', '324433', '324435', '345885', '346278', '346344', '346355', '346396', '346901', '369708', '376434']
    nosy_count = 7.0
    nosy_names = ['vinay.sajip', 'lukasz.langa', 'zach.ware', 'John Hagen', 'cooperlees', 'miss-islington', 'hauntsaninja']
    pr_nums = ['13100', '20135']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue34556'
    versions = ['Python 3.9']

    @cooperlees
    Copy link
    Mannequin Author

    cooperlees mannequin commented Aug 31, 2018

    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 ...

    @cooperlees cooperlees mannequin added 3.8 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Aug 31, 2018
    @zware
    Copy link
    Member

    zware commented Aug 31, 2018

    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
    Copy link
    Mannequin Author

    cooperlees mannequin commented 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-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'.

    @ambv
    Copy link
    Contributor

    ambv commented 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
    Copy link
    Member

    vsajip commented Jun 22, 2019

    Can this issue be closed now?

    @cooperlees
    Copy link
    Mannequin Author

    cooperlees mannequin commented Jun 23, 2019

    I believe so - Would love it could be included with latest 3.8 or is there no chance of that?

    @vsajip
    Copy link
    Member

    vsajip commented Jun 24, 2019

    included with latest 3.8 or is there no chance of that?

    Unfortunately not, I think, as it missed the cut for 3.8beta1. Never mind! Thanks for your contribution.

    @vsajip vsajip added 3.9 only security fixes and removed 3.8 only security fixes labels Jun 24, 2019
    @vsajip vsajip closed this as completed Jun 24, 2019
    @cooperlees
    Copy link
    Mannequin Author

    cooperlees mannequin commented 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?

    @cooperlees cooperlees mannequin changed the title Add --upgrade to venv module Add --upgrade-deps to venv module Jun 24, 2019
    @vsajip
    Copy link
    Member

    vsajip commented Jun 29, 2019

    Is there any way other than discussing with the release manager to have this considered?

    I don't believe so.

    @miss-islington
    Copy link
    Contributor

    New changeset 1cba1c9 by Shantanu in branch 'master':
    bpo-34556: Document addition of upgrade_deps to venv.create (GH-20135)
    1cba1c9

    @johnthagen
    Copy link
    Mannequin

    johnthagen mannequin commented 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?

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    MorganShorter added a commit to MorganShorter/djaoapp that referenced this issue May 6, 2022
    Use `python3-pil` Debian package instead of `python3-pillow` package.
    Debian changed the name of the package in their repository, but it is
    still built from the `Pillow` PyPi project.
    
    Use `venv --upgrade-deps` instead of `pip install --upgrade setuptools`.
    Starting with Python version 3.9, `venv` supports automatically
    installing the latest versions of `pip` and `setuptools` by using the
    `--upgrade-deps` flag; see
    [python/cpython#78737 for details. `pip`
    seems to have trouble deleting currently installed versions of
    `setuptools` as of late, making it impossible to upgrade and thereby
    breaking the build.
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.9 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants