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 install should not bring back old versions of dependent packages, if newer versions are already installed #6104
Comments
If you are not happy with version 1.4.52 And in that case, you will see the error that you expect. But since you said "I need sqlalchemy, in what ever version". pipenv decides to downgrade (you don't express any constraint on that pkg). From my point of view, it is not an issue at all. |
Technically this is indeed expected behavior. I think it should be quite easy to add a warning whenever a dependency gets downgraded. But I would also love (even more) a way to specify that I want to install a package with version |
@Kroppeb I believe the version ~=x.y syntax/operator is already supported 🤔 |
I guess I don't agree with the expectation that "pipenv install dataset should error out, indicating that sqlalchemy is installed and at a later incompatible version." and let me explain why. The resolve gets all the constraints from the Pipfile and seeks to find packages that match them -- since you specified that any package version is acceptable, the pip resolver will find one that matches if one does match at all from the pool of all constraints. |
|
The issue is the user app is working fine until a new package is added
using pipenv. Pipenv then decides to downgrade the sqlalchemy version to be
compatible with the new package and now the user app doesn't work anymore.
While this works as coded, this behavior is contrary to making development
smooth. The '*' in the version should not be interpreted as being ok to
downgrade an existing installed package (making the user app not work)
Erroring out is a great option. If not a requirement that the user should
force downgrade is another., or at least a warning.
…On Wed, Mar 20, 2024, 3:13 PM Bashintosh ***@***.***> wrote:
If you are not happy with version 1.4.52
I would say that you need to restrict the version you want / need for
sqlalchemy ?
for exemple : sqlalchemy >= "2.0.0" in your Pipefile.
And in that case, you will see the error that you expect.
But since you said "I need sqlalchemy, in what ever version". pipenv
decides to downgrade (you don't express any constraint on that pkg).
From my point of view, it is not an issue at all.
—
Reply to this email directly, view it on GitHub
<#6104 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFMJHPX347T2JO26EEWEZWLYZICXNAVCNFSM6AAAAABEF4MFVSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJQG4ZTOMBSHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Feel free to work on a PR, but I don't think it should error out entirely unless possibly a flag is passed -- printing warnings should be fine. You might want to look into the upgrade command as well (if you find that is affected) as that is going to be the default behavior of install here in the next major release. |
Be sure to check the existing issues (both open and closed!), and make sure you are running the latest version of Pipenv.
Check the diagnose documentation for common issues before posting! We may close your issue if it is very similar to one of them. Please be considerate, or be on your way.
Make sure to mention your debugging experience if the documented solution failed.
Issue description
pipenv install sqlalchemy #the Pipfile is updated with sqlalchemy = "*"
pip install sqlalchemy #This correctly installs 'current' sqlalchemy 2.0 ( "version": "==2.0.28")
pipenv install dataset #This changes the previously installed sqlalchemy to "version": "==1.4.52"
Expected result
pipenv install dataset should error out, indicating that sqlalchemy is installed and at a later incompatible version.
Discussion: The application was working with the installed sqlalchemy version 2.0.. After installing dataset, the sqlalchemy version went backward to 1.4.52 and application failed.
In general the newer versions offer new features, and retain some compatibility with older versions. So upgrading packages during pipenv dependency resolution is acceptible. But downgrading packages is not..
$ pipenv --support
Pipenv version:
'2023.12.1'
Pipenv location:
'/home/vv/junk/venv/lib/python3.12/site-packages/pipenv'
Python location:
'/home/vv/junk/venv/bin/python3.12'
OS Name:
'posix'
User pip version:
'23.3.2'
user Python installations found:
PEP 508 Information:
System environment variables:
SHELL
SESSION_MANAGER
QT_ACCESSIBILITY
COLORTERM
XDG_CONFIG_DIRS
XDG_SESSION_PATH
TERM_PROGRAM_VERSION
GNOME_DESKTOP_SESSION_ID
LANGUAGE
SSH_AUTH_SOCK
CINNAMON_VERSION
DESKTOP_SESSION
GTK_MODULES
XDG_SEAT
PWD
XDG_SESSION_DESKTOP
LOGNAME
QT_QPA_PLATFORMTHEME
XDG_SESSION_TYPE
GPG_AGENT_INFO
XAUTHORITY
VSCODE_GIT_ASKPASS_NODE
XDG_GREETER_DATA_DIR
GJS_DEBUG_TOPICS
GDM_LANG
HOME
LANG
XDG_CURRENT_DESKTOP
VIRTUAL_ENV
GIT_ASKPASS
XDG_SEAT_PATH
CHROME_DESKTOP
GJS_DEBUG_OUTPUT
VSCODE_GIT_ASKPASS_EXTRA_ARGS
XDG_SESSION_CLASS
TERM
GTK_OVERLAY_SCROLLING
USER
VSCODE_GIT_IPC_HANDLE
DISPLAY
SHLVL
XDG_VTNR
XDG_SESSION_ID
VIRTUAL_ENV_PROMPT
XDG_RUNTIME_DIR
PS1
VSCODE_GIT_ASKPASS_MAIN
GTK3_MODULES
XDG_DATA_DIRS
GDK_BACKEND
PATH
GDMSESSION
ORIGINAL_XDG_CURRENT_DESKTOP
DBUS_SESSION_BUS_ADDRESS
GIO_LAUNCHED_DESKTOP_FILE_PID
GIO_LAUNCHED_DESKTOP_FILE
OLDPWD
TERM_PROGRAM
_
PIP_DISABLE_PIP_VERSION_CHECK
PYTHONDONTWRITEBYTECODE
PYTHONFINDER_IGNORE_UNSUPPORTED
Pipenv–specific environment variables:
Debug–specific environment variables:
PATH
:/home/vv/junk/venv/bin:/home/vv/.vscode/extensions/ms-python.python-2024.2.0/pythonFiles/deactivate/bash:/home/vv/git/OBD/venv/bin:/home/vv/.local/bin:/home/vv/.vscode/extensions/ms-python.python-2024.2.0/pythonFiles/deactivate/bash:/home/vv/git/OBD/venv/bin:/home/vv/.local/bin:/home/vv/.local/bin:/home/vv/.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/vv/junk/venv
VIRTUAL_ENV
:/home/vv/junk/venv
Contents of
Pipfile
('/home/vv/junk/venv/Pipfile'):Contents of
Pipfile.lock
('/home/vv/junk/venv/Pipfile.lock'):The text was updated successfully, but these errors were encountered: