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

pipenv update <pkg> updates all packages and not just the selected #2665

Closed
mgranq opened this issue Jul 27, 2018 · 16 comments
Closed

pipenv update <pkg> updates all packages and not just the selected #2665

mgranq opened this issue Jul 27, 2018 · 16 comments

Comments

@mgranq
Copy link

mgranq commented Jul 27, 2018

Issue description

When I have more than one outdated packages in Pipfile and run pipenv update package-name all outdated packages are updated.

Expected result

I only expect the selected package and its dependencies to be updated.

Actual result

$` pipenv update --outdated
Package 'jsonpickle' out-of-date: '==0.9.5' installed, '==0.9.6' available.
Package 'requests' out-of-date: '==2.19.0' installed, '==2.19.1' available.

$ pipenv update jsonpickle
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
Updated Pipfile.lock (15aa44)!
Installing dependencies from Pipfile.lock (15aa44)...
🐍 ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 6/6 — 00:00:01
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
All dependencies are now up-to-date!

$ pipenv update --outdated
$

both jsonpickle and requests where updated

Steps to replicate

$ pipenv install jsonpickle==0.9.5
$ pipenv install requests==2.19.0

update Pipfile from:
$ cat Pipfile
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
requests = "==2.19.0"
jsonpickle = "==0.9.5"

[dev-packages]

[requires]
python_version = "3.6"

to:
$ cat Pipfile
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
requests = ""
jsonpickle = "
"

[dev-packages]

[requires]
python_version = "3.6"

update jsonpickle:
$ pipenv update --outdated
Package 'jsonpickle' out-of-date: '==0.9.5' installed, '==0.9.6' available.
Package 'requests' out-of-date: '==2.19.0' installed, '==2.19.1' available.
$ pipenv update jsonpickle
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
Updated Pipfile.lock (15aa44)!
Installing dependencies from Pipfile.lock (15aa44)...
🐍 ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 6/6 — 00:00:01
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
All dependencies are now up-to-date!

Both packages are updated.


$ pipenv --support

Pipenv version: '2018.7.1'

Pipenv location: '/home/darwin/.pyenv/versions/3.6.4/lib/python3.6/site-packages/pipenv'

Python location: '/home/darwin/.pyenv/versions/3.6.4/bin/python3.6'

Other Python installations in PATH:

  • 2.7: /usr/bin/python2.7

  • 2.7: /usr/bin/python2.7

  • 3.5: /usr/bin/python3.5m

  • 3.5: /usr/bin/python3.5

  • 3.6: /home/darwin/.pyenv/versions/3.6.4/bin/python3.6m

  • 3.6: /home/darwin/.pyenv/versions/3.6.4/bin/python3.6

  • 3.6: /home/darwin/.pyenv/shims/python3.6

  • 3.6: /home/darwin/.pyenv/shims/python3.6

  • 3.6: /home/darwin/.pyenv/shims/python3.6

  • 3.6.4: /home/darwin/.pyenv/versions/3.6.4/bin/python

  • 3.6.4: /home/darwin/.pyenv/shims/python

  • 3.6.4: /home/darwin/.pyenv/shims/python

  • 3.6.4: /home/darwin/.pyenv/shims/python

  • 2.7.12: /usr/bin/python

  • 2.7.12: /usr/bin/python2

  • 3.6.4: /home/darwin/.pyenv/versions/3.6.4/bin/python3

  • 3.6.4: /home/darwin/.pyenv/shims/python3

  • 3.6.4: /home/darwin/.pyenv/shims/python3

  • 3.6.4: /home/darwin/.pyenv/shims/python3

  • 3.5.2: /usr/bin/python3

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.6.4',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '4.13.0-45-generic',
 'platform_system': 'Linux',
 'platform_version': '#50~16.04.1-Ubuntu SMP Wed May 30 11:18:27 UTC 2018',
 'python_full_version': '3.6.4',
 'python_version': '3.6',
 'sys_platform': 'linux'}

System environment variables:

  • LC_PAPER
  • XDG_VTNR
  • XDG_SESSION_ID
  • LC_ADDRESS
  • LC_MONETARY
  • CLUTTER_IM_MODULE
  • XDG_GREETER_DATA_DIR
  • SESSION
  • GPG_AGENT_INFO
  • PYENV_ROOT
  • VTE_VERSION
  • SHELL
  • TERM
  • XDG_MENU_PREFIX
  • PIPENV_VENV_IN_PROJECT
  • QT_LINUX_ACCESSIBILITY_ALWAYS_ON
  • WINDOWID
  • LC_NUMERIC
  • UPSTART_SESSION
  • GNOME_KEYRING_CONTROL
  • GTK_MODULES
  • PYENV_VERSION
  • USER
  • LS_COLORS
  • LC_TELEPHONE
  • QT_ACCESSIBILITY
  • XDG_SESSION_PATH
  • XDG_SEAT_PATH
  • SSH_AUTH_SOCK
  • PYENV_DIR
  • SESSION_MANAGER
  • DEFAULTS_PATH
  • TMUX
  • XDG_CONFIG_DIRS
  • PATH
  • DESKTOP_SESSION
  • QT_QPA_PLATFORMTHEME
  • QT_IM_MODULE
  • EVENT_NOEPOLL
  • LC_IDENTIFICATION
  • XDG_SESSION_TYPE
  • JOB
  • PWD
  • XMODIFIERS
  • GNOME_KEYRING_PID
  • LANG
  • GDM_LANG
  • MANDATORY_PATH
  • LC_MEASUREMENT
  • PYENV_HOOK_PATH
  • IM_CONFIG_PHASE
  • COMPIZ_CONFIG_PROFILE
  • TMUX_PANE
  • GDMSESSION
  • SESSIONTYPE
  • GTK2_MODULES
  • PYENV_SHELL
  • HOME
  • SHLVL
  • XDG_SEAT
  • LANGUAGE
  • GNOME_DESKTOP_SESSION_ID
  • XDG_SESSION_DESKTOP
  • LOGNAME
  • DBUS_SESSION_BUS_ADDRESS
  • QT4_IM_MODULE
  • XDG_DATA_DIRS
  • LESSOPEN
  • INSTANCE
  • DISPLAY
  • XDG_RUNTIME_DIR
  • GTK_IM_MODULE
  • XDG_CURRENT_DESKTOP
  • LC_TIME
  • LESSCLOSE
  • XAUTHORITY
  • LC_NAME
  • PYTHONDONTWRITEBYTECODE
  • PIP_PYTHON_PATH

Pipenv–specific environment variables:

  • PIPENV_VENV_IN_PROJECT: 1

Debug–specific environment variables:

  • PATH: /home/darwin/.pyenv/versions/3.6.4/bin:/home/darwin/.pyenv/libexec:/home/darwin/.pyenv/plugins/python-build/bin:/home/darwin/.pyenv/plugins/pyenv-virtualenv/bin:/home/darwin/.pyenv/plugins/py env-update/bin:/home/darwin/.pyenv/plugins/pyenv-installer/bin:/home/darwin/.pyenv/plugins/pyenv-doctor/bin:/home/darwin/.pyenv/shims:/home/darwin/.pyenv/bin:/home/darwin/.pyenv/shims:/home/darwin/.pyenv/ bin:/home/darwin/.pyenv/shims:/home/darwin/.pyenv/bin:/home/darwin/bin:/home/darwin/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
  • SHELL: /bin/bash
  • LANG: en_US.UTF-8
  • PWD: /home/darwin/pipenv_test

Contents of Pipfile ('/home/darwin/pipenv_test/Pipfile'):

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
requests = "*"
jsonpickle = "*"

[dev-packages]

[requires]
python_version = "3.6"

Contents of Pipfile.lock ('/home/darwin/pipenv_test/Pipfile.lock'):

{
    "_meta": {
        "hash": {
            "sha256": "0566daf64852964905816f083f9b740b46ca8bd820ca2e6886988c239b15aa44"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_version": "3.6"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {
        "certifi": {
            "hashes": [
                "sha256:13e698f54293db9f89122b0581843a782ad0934a4fe0172d2a980ba77fc61bb7",
                "sha256:9fa520c1bacfb634fa7af20a76bcbd3d5fb390481724c597da32c719a7dca4b0"
            ],
            "version": "==2018.4.16"
        },
        "chardet": {
            "hashes": [
                "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae",
                "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691"
            ],
            "version": "==3.0.4"
        },
        "idna": {
            "hashes": [
                "sha256:156a6814fb5ac1fc6850fb002e0852d56c0c8d2531923a51032d1b70760e186e",
                "sha256:684a38a6f903c1d71d6d5fac066b58d7768af4de2b832e426ec79c30daa94a16"
            ],
            "version": "==2.7"
        },
        "jsonpickle": {
            "hashes": [
                "sha256:545b3bee0d65e1abb4baa1818edcc9ec239aa9f2ffbfde8084d71c056180054f"
            ],
            "index": "pypi",
            "version": "==0.9.6"
        },
        "requests": {
            "hashes": [
                "sha256:63b52e3c866428a224f97cab011de738c36aec0185aa91cfacd418b5d58911d1",
                "sha256:ec22d826a36ed72a7358ff3fe56cbd4ba69dd7a6718ffd450ff0e9df7a47ce6a"
            ],
            "index": "pypi",
            "version": "==2.19.1"
        },
        "urllib3": {
            "hashes": [
                "sha256:a68ac5e15e76e7e5dd2b8f94007233e01effe3e50e8daddf69acfd81cb686baf",
                "sha256:b5725a0bd4ba422ab0e66e89e030c806576753ea3ee08554382c14e685d117b5"
            ],
            "markers": "python_version >= '2.6' and python_version != '3.3.*' and python_version != '3.0.*' and python_version != '3.2.*' and python_version != '3.1.*' and python_version < '4'",
            "version": "==1.23"
        }
    },
    "develop": {}
}
@uranusjr
Copy link
Member

Merging into #2412 (different command but basically the same thing sematically).

@gegenschall
Copy link

gegenschall commented Oct 3, 2018

I'm not really sure why this is closed as the issue still isn't fixed with either this issue or #2412. With the most recent version of pipenv I have no way of selectively upgrading packages. I can either update them all at once or none at all. :/

Another thing: Running pipenv update --keep-outdated python-package results in the message "All dependencies are now up-to-date!" when in reality nothing has been done at all.

edit: removed outbursty language.

@revolter
Copy link

Doesn't work for me either with version 2018.10.9.

@techalchemy
Copy link
Member

defies the purpose of the whole tool

Please avoid language like this. If you or your company need this feature we will happily review your pull request. Telling us our tool is pointless because it doesn’t do one thing you want, on the other hand, is a bit rude and also makes us less likely to want to work with you. Its a small thing but it matters.

We are well aware of this limitation of this subcommand. It is complicated and our volunteer maintainer team of two people simply hasn’t gotten to this yet. I also feel the pain of this problem regularly, but honestly I haven’t had time to fix it so it remains broken.

@gegenschall
Copy link

gegenschall commented Oct 23, 2018

You are absolutely right and I edited my post. Not sure what happened there, my apologies!

@dmugtasimov
Copy link

I think description of update command should be fixed, too: "update Runs lock, then sync."

Since it updates all dependencies maybe it is worth renaming it to update-all or similar until you fix it or at least mention in the description that there is a issue that makes command not to work as intended (or named)

@fredrikaverpil
Copy link

fredrikaverpil commented May 28, 2019

Just got hit by this. What is the recommended way to update one single package to its latest version?

Even pipenv update --selective-upgrade pipenv updates all my packages. I am on Windows 10 with pipenv 2018.11.26.

@lggwettmann
Copy link

Same question here... any help on that?

@fredrikaverpil
Copy link

#2412 (comment)

@zoltan-fedor
Copy link

zoltan-fedor commented Aug 26, 2019

While we are waiting for this to be fixed / implemented in pipenv, here is my very manual workaround:

  1. Upgrade your package (and all other packages...):
    $ pipenv update [mypackage]
  2. Copy the details of your package from the Pipfile.lock and store it somewhere, you will use it at step # 4
  3. Downgrade all packages back to where they were:
# WARNING: this will reset all changes made (!), so make sure you started with a clean
# workspace, so you won't lose any other changes than the one you made with the
# pipenv update. This has changed the Pipfile.lock file back to how it was before
# the upgrade
$ git reset --hard
 
# this will install all packages from the Pipfile.lock, alias back to how 
# they were before step # 1
$ pipenv sync
  1. Now copy your package's details (see step # 2) into the Pipfile.lock
  2. Sync the packages from this modified Pipfile.lock to install your package's new version:
    $ pipenv sync
  3. Check the source code of your package (setup.py) to see whether any of its dependency packages also need to be upgraded, if yes, then you need to do the same for those
  4. Run your tests to ensure that everything works

PeterJCLaw added a commit to PeterJCLaw/srobo-runbook that referenced this issue Aug 31, 2019
This is motivated by the issues around pipenv always upgrading
every dependency whenever you touch any dependency.
(See pypa/pipenv#2665 and
pypa/pipenv#2412)
PeterJCLaw added a commit to PeterJCLaw/srobo-runbook that referenced this issue Aug 31, 2019
This is motivated by the issues around pipenv always upgrading
every dependency whenever you touch any dependency.
(See pypa/pipenv#2665 and
pypa/pipenv#2412)
@ikigai-gh
Copy link

Any changes on this? Absolutely tired of updating of all packages instead of one specified... Hear the people's pain and please fix this bug, it really frustrates: in our company we have to manually delete the package, run lock with --keep-outdated, return the package, and finally run lock again ;_;

@0mars
Copy link

0mars commented Sep 18, 2019

So it's not going to be fixed, or why closed ?

@fredrikaverpil
Copy link

fredrikaverpil commented Sep 18, 2019

I don't think anyone should expect this to be fixed in the near (far?) future unless you attempt to fix it yourself. I did but gave up knee-deep in a spaghetti bucket of unclear intentions.

Edit: absolutely not meant as offence towards the authors

@0mars
Copy link

0mars commented Sep 18, 2019

this works now I guess:

pipenv update --selective-upgrade pipenv

I tried it and it didn't update anything, maybe that meant to update if unlocked or something, can you try it now with latest ?

@andreif
Copy link

andreif commented Jan 19, 2021

Version 2020.11.15 did update everything, so it still doesn't work as expected.

tsibley added a commit to seattleflu/switchboard that referenced this issue Jan 25, 2021
This was an oversight that should have been part of "Switch to new-style
env vars for REDCap API credentials" (e5e78be).  It happened because I
tested those changes by using a different ID3C install instead of the
Pipenv-one managed here.

It was near impossible to get Pipenv to cooperate in just upgrading ID3C
without upgrading a ton of other stuff (like Datasette) that I don't
want to vette right now.¹  These changes were the result of `pipenv lock
--keep-outdated`.  They don't touch any of our existing deps except
ID3C, but I'm also pretty sure this is still not a minimal upgrade set:
some of these newly added transitive deps, like sqlite-fts4, are clearly
for newer Datasette versions, even though Datasette itself is not
upgraded.  Hopefully my PRs for ditching Pipenv in favor of pip-tools
will merge soon and this will be moot anyway.

¹ pypa/pipenv#2665
@yesthesoup
Copy link

yesthesoup commented Jan 26, 2021

I posted my manual workaround in #2412, but c/p-ing here:

Still an issue in pipenv 2020.11.15 for me as well.

After losing a bunch of time to pipenv today, here's my workaround:

  1. Figure out the version you want to install, in my case the latest requests, 25.2.1
  2. pipenv install --keep-outdated 'requests==25.2.1' will just update to that version
  3. verify Pipfile.lock shows new version, then git checkout -- Pipfile to revert to what you had before, in my case requests = "*"
  4. verify correct version is installed
$ pipenv graph | ack requests # or grep
  - requests [required: >=2.7.9, installed: 2.25.1]
[...]

krysal added a commit to WordPress/openverse-api that referenced this issue Jul 29, 2022
syntaxaire added a commit to TrashMonks/hagadias that referenced this issue Jul 30, 2022
I used to use and like Pipenv but no longer think it’s viable - the
project is in maintenance mode and has some serious unfixed issues
([link](pypa/pipenv#2665),
[link](pypa/pipenv#2412))
which have been “fixed” by removing fundamental features since the dev
team was [unable to figure out](pypa/pipenv#4988)
what was going on in the codebase. Other dev teams are also
[abandoning](log2timeline/dftimewolf#636)
this package manager.

Poetry offers some significant advantages such as compatibility with
the pyproject.toml standard, the ability to upgrade a single
dependency, and the ability to publish packages.
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

No branches or pull requests