pipx icon indicating copy to clipboard operation
pipx copied to clipboard

Disable auto-upgrading shared libraries

Open jpyams opened this issue 6 months ago • 2 comments

I am trying to update a Pipx install that has to stay on Python 3.8. Given 3.8 is end of life, pip has dropped support for it and has introduced code that requires >Python 3.9. That means when I try to upgrade this install, I get errors from pip (specifically TypeError: 'ABCMeta' object is not subscriptable).

I have tried forcing the shared library version of pip back to a version that supports Python 3.8 per the docs:

pipx upgrade-shared --pip-args 'pip<25'

However, when I run install or upgrade, the shared libraries are always immediately upgraded before running the pip install, producing the same error.

The docs mention something about how this should pin the pip version 'temporarily, until the next automatic upgrade, if that is not explicitly turned off'.

How do I explicity turn off automatic upgrades?

jpyams avatar Jun 24 '25 15:06 jpyams

Perhaps an environment variable can be introduced for this.

dukecat0 avatar Oct 05 '25 06:10 dukecat0

Hi @dukecat0 and @jpyams!

I'd like to work on this issue for Hacktoberfest 2025.

Based on @dukecat0's suggestion about introducing an environment variable,
I've analyzed the codebase and have a clear implementation plan.

I will implement this by:

  1. Adding an environment variable PIPX_DISABLE_SHARED_LIBS_AUTO_UPGRADE
    (when set to any value, it will disable automatic shared library upgrades)
  2. Modifying venv.py's check_upgrade_shared_libs() method to check this variable
  3. Updating the documentation to explain the new environment variable
  4. Adding tests to verify the behavior

I'll submit a PR shortly. Looking forward to your feedback!

G26karthik avatar Oct 07 '25 16:10 G26karthik