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

New pipenv uninstall --all behaviour removes packages from lock file #6346

Open
agraves-giffgaff opened this issue Feb 18, 2025 · 0 comments

Comments

@agraves-giffgaff
Copy link

Issue description

The behaviour of pipenv uninstall --all has changed in version 2024. Now it removes all packages from the lock file. It used to (version 2023.12.1) not touch the lock file.

I wonder if it was introduced by the same change that caused this issue: #6200

Expected result

Old (expected) behaviour using version 2023.12.1:

❯ pipenv --version
pipenv, version 2023.12.1

Uninstall all:

❯ pipenv uninstall --all
Un-installing all [dev-packages] and [packages]...
Found 6 installed package(s), purging...
...

Environment now purged and fresh!

No changes to Pipfile or Pipfile.lock:

❯ git status
On branch main
nothing to commit, working tree clean

Actual result

New behaviour using version 2024.4.4

❯ /Users/username/.local/bin/pipenv --version
pipenv, version 2024.4.0

Uninstall all:

❯ /Users/username/.local/bin/pipenv uninstall --all --verbose
Un-installing all packages...
Uninstalling pandas...
Running command: $ /Users/username/repos/pipenv-testing/.venv/bin/python /Users/username/.local/pipx/venvs/pipenv/lib/python3.10/site-packages/pipenv/patched/pip/__pip-runner__.py uninstall pandas -y
Command output: Found existing installation: pandas 2.2.3
Uninstalling pandas-2.2.3:
  Successfully uninstalled pandas-2.2.3

Found existing installation: pandas 2.2.3
Uninstalling pandas-2.2.3:
  Successfully uninstalled pandas-2.2.3

Uninstalling requests...
Running command: $ /Users/username/repos/pipenv-testing/.venv/bin/python /Users/username/.local/pipx/venvs/pipenv/lib/python3.10/site-packages/pipenv/patched/pip/__pip-runner__.py uninstall requests -y
Command output: Found existing installation: requests 2.32.3
Uninstalling requests-2.32.3:
  Successfully uninstalled requests-2.32.3

Found existing installation: requests 2.32.3
Uninstalling requests-2.32.3:
  Successfully uninstalled requests-2.32.3

Found 9 installed package(s), purging...
$ /Users/username/repos/pipenv-testing/.venv/bin/python /Users/username/.local/pipx/venvs/pipenv/lib/python3.10/site-packages/pipenv/patched/pip/__pip-runner__.py uninstall -y idna pytz tzdata charset_normalizer certifi numpy six python_dateutil urllib3
Found existing installation: idna 3.10
Uninstalling idna-3.10:
  Successfully uninstalled idna-3.10
Found existing installation: pytz 2025.1
Uninstalling pytz-2025.1:
  Successfully uninstalled pytz-2025.1
Found existing installation: tzdata 2025.1
Uninstalling tzdata-2025.1:
  Successfully uninstalled tzdata-2025.1
Found existing installation: charset-normalizer 3.4.1
Uninstalling charset-normalizer-3.4.1:
  Successfully uninstalled charset-normalizer-3.4.1
Found existing installation: certifi 2025.1.31
Uninstalling certifi-2025.1.31:
  Successfully uninstalled certifi-2025.1.31
Found existing installation: numpy 2.2.3
Uninstalling numpy-2.2.3:
  Successfully uninstalled numpy-2.2.3
Found existing installation: six 1.17.0
Uninstalling six-1.17.0:
  Successfully uninstalled six-1.17.0
Found existing installation: python-dateutil 2.9.0.post0
Uninstalling python-dateutil-2.9.0.post0:
  Successfully uninstalled python-dateutil-2.9.0.post0
Found existing installation: urllib3 2.3.0
Uninstalling urllib3-2.3.0:
  Successfully uninstalled urllib3-2.3.0

Environment now purged and fresh!

Removing all packages:

{
    "_meta": {
        "hash": {
            "sha256": "58272263d51cf3585e09ae916d6a268d35ba5cf24b849cee1559be5ca8935bad"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_version": "3.10"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {},
    "develop": {}
}

Steps to replicate

Same starting config in both examples:

Pipfile:

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

[packages]
requests = "*"
numpy = "*"

[dev-packages]

[requires]
python_version = "3.10"

$ /Users/username/.local/bin/pipenv --support #2024

Pipenv version: '2024.4.0'

Pipenv location: '/Users/username/.local/pipx/venvs/pipenv/lib/python3.10/site-packages/pipenv'

Python location: '/Users/username/.local/pipx/venvs/pipenv/bin/python'

OS Name: 'posix'

User pip version: '24.3.1'

user Python installations found:

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.10.13',
 'os_name': 'posix',
 'platform_machine': 'arm64',
 'platform_python_implementation': 'CPython',
 'platform_release': '24.3.0',
 'platform_system': 'Darwin',
 'platform_version': 'Darwin Kernel Version 24.3.0: Thu Jan  2 20:24:23 PST '
                     '2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6020',
 'python_full_version': '3.10.13',
 'python_version': '3.10',
 'sys_platform': 'darwin'}

System environment variables:

  • __CF_USER_TEXT_ENCODING
  • __CFBundleIdentifier
  • _
  • _P9K_SSH_TTY
  • _P9K_TTY
  • COLORFGBG
  • COLORTERM
  • COMMAND_MODE
  • EDITOR
  • HOME
  • HOMEBREW_CELLAR
  • HOMEBREW_PREFIX
  • HOMEBREW_REPOSITORY
  • INFOPATH
  • ITERM_PROFILE
  • ITERM_SESSION_ID
  • LANG
  • LC_TERMINAL_VERSION
  • LC_TERMINAL
  • LOGNAME
  • LSCOLORS
  • MANPATH
  • P9K_SSH
  • P9K_TTY
  • PATH
  • PIP_DISABLE_PIP_VERSION_CHECK
  • PIP_REQUIRE_VIRTUALENV
  • PIPX_DEFAULT_PYTHON
  • PWD
  • PYENV_SHELL
  • PYTHONDONTWRITEBYTECODE
  • PYTHONFINDER_IGNORE_UNSUPPORTED
  • SHELL
  • SHLVL
  • SSH_AUTH_SOCK
  • TERM_FEATURES
  • TERM_PROGRAM_VERSION
  • TERM_PROGRAM
  • TERM_SESSION_ID
  • TERM
  • TERMINFO_DIRS
  • TMPDIR
  • USER
  • VISUAL
  • XPC_FLAGS
  • XPC_SERVICE_NAME

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /Users/username/.pyenv/versions/3.11.9/bin:/Users/username/.pyenv/versions/3.12.8/bin:/Users/username/.pyenv/versions/3.9.19/bin:/Users/username/.pyenv/versions/3.13.1/bin:/Users/username/.pyenv/versions/3.8.18/bin:/Users/username/.pyenv/versions/3.10.13/bin:/Users/username/.pyenv/versions/3.12.2/bin:/Users/username/.pyenv/shims:/Users/username/.pyenv/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Applications/iTerm.app/Contents/Resources/utilities:/Users/username/.local/bin:/Applications/Visual Studio Code.app/Contents/Resources/app/bin:/Users/username/.local/bin
  • SHELL: /bin/zsh
  • EDITOR: nano
  • LANG: en_GB.UTF-8
  • PWD: /Users/username

$ pipenv --support #2023

Pipenv version: '2023.12.1'

Pipenv location: '/Users/username/.pyenv/versions/3.10.13/lib/python3.10/site-packages/pipenv'

Python location: '/Users/username/.pyenv/versions/3.10.13/bin/python3.10'

OS Name: 'posix'

User pip version: '23.3.2'

user Python installations found:

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.10.13',
 'os_name': 'posix',
 'platform_machine': 'arm64',
 'platform_python_implementation': 'CPython',
 'platform_release': '24.3.0',
 'platform_system': 'Darwin',
 'platform_version': 'Darwin Kernel Version 24.3.0: Thu Jan  2 20:24:23 PST '
                     '2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6020',
 'python_full_version': '3.10.13',
 'python_version': '3.10',
 'sys_platform': 'darwin'}

System environment variables:

  • __CF_USER_TEXT_ENCODING
  • __CFBundleIdentifier
  • _P9K_SSH_TTY
  • _P9K_TTY
  • COLORFGBG
  • COLORTERM
  • COMMAND_MODE
  • EDITOR
  • HOME
  • HOMEBREW_CELLAR
  • HOMEBREW_PREFIX
  • HOMEBREW_REPOSITORY
  • INFOPATH
  • ITERM_PROFILE
  • ITERM_SESSION_ID
  • LANG
  • LC_TERMINAL_VERSION
  • LC_TERMINAL
  • LOGNAME
  • LSCOLORS
  • MANPATH
  • P9K_SSH
  • P9K_TTY
  • PATH
  • PIP_DISABLE_PIP_VERSION_CHECK
  • PIP_REQUIRE_VIRTUALENV
  • PIPX_DEFAULT_PYTHON
  • PWD
  • PYENV_DIR
  • PYENV_HOOK_PATH
  • PYENV_ROOT
  • PYENV_SHELL
  • PYENV_VERSION
  • PYTHONDONTWRITEBYTECODE
  • PYTHONFINDER_IGNORE_UNSUPPORTED
  • SHELL
  • SHLVL
  • SSH_AUTH_SOCK
  • TERM_FEATURES
  • TERM_PROGRAM_VERSION
  • TERM_PROGRAM
  • TERM_SESSION_ID
  • TERM
  • TERMINFO_DIRS
  • TMPDIR
  • USER
  • VISUAL
  • XPC_FLAGS
  • XPC_SERVICE_NAME

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /Users/username/.pyenv/versions/3.11.9/bin:/Users/username/.pyenv/versions/3.12.8/bin:/Users/username/.pyenv/versions/3.9.19/bin:/Users/username/.pyenv/versions/3.13.1/bin:/Users/username/.pyenv/versions/3.8.18/bin:/Users/username/.pyenv/versions/3.10.13/bin:/Users/username/.pyenv/versions/3.12.2/bin:/Users/username/.pyenv/versions/3.10.13/bin:/opt/homebrew/Cellar/pyenv/2.5.0/libexec:/opt/homebrew/Cellar/pyenv/2.5.0/plugins/python-build/bin:/Users/username/.pyenv/shims:/Users/username/.pyenv/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Applications/iTerm.app/Contents/Resources/utilities:/Users/username/.local/bin:/Applications/Visual Studio Code.app/Contents/Resources/app/bin:/Users/username/.local/bin
  • SHELL: /bin/zsh
  • EDITOR: nano
  • LANG: en_GB.UTF-8
  • PWD: /Users/username

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

1 participant