Skip to content

Add --upgrade-deps to venv module #78737

Closed

Description

@cooperlees
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']

    Activity

    1. cooperlees commented on Aug 31, 2018

      cooperleesmannequin
      MannequinAuthor

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

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      type-featureA feature request or enhancement
      on Aug 31, 2018
    3. zware commented on Aug 31, 2018

      @zware
      Member

      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.

    4. cooperlees commented on Aug 31, 2018

      cooperleesmannequin
      MannequinAuthor

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

    5. ambv commented on Jun 17, 2019

      @ambv
      Contributor

      New changeset 4acdbf1 by Łukasz Langa (Cooper Lees) in branch 'master':
      bpo-34556: Add --upgrade-deps to venv module (bpo-13100)
      4acdbf1

    6. vsajip commented on Jun 22, 2019

      @vsajip
      Member

      Can this issue be closed now?

    7. cooperlees commented on Jun 23, 2019

      cooperleesmannequin
      MannequinAuthor

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

    8. vsajip commented on Jun 24, 2019

      @vsajip
      Member

      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.

    9. added and removed on Jun 24, 2019
    10. cooperlees commented on Jun 24, 2019

      cooperleesmannequin
      MannequinAuthor

      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?

    11. changed the title [-]Add --upgrade to venv module[/-] [+]Add --upgrade-deps to venv module[/+] on Jun 24, 2019
    12. vsajip commented on Jun 29, 2019

      @vsajip
      Member

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

      I don't believe so.

    13. miss-islington commented on May 23, 2020

      @miss-islington
      Contributor

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

    14. johnthagen commented on Sep 5, 2020

      johnthagenmannequin
      Mannequin

      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?

    15. transferred this issue fromon Apr 10, 2022
    16. added a commit that references this issue on May 6, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.9 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions