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

Version resolver should handle pinned down versions in libraries #2589

Closed
fridex opened this issue Jul 16, 2018 · 2 comments · Fixed by #2935
Closed

Version resolver should handle pinned down versions in libraries #2589

fridex opened this issue Jul 16, 2018 · 2 comments · Fixed by #2935
Labels
Category: Dependency Resolution Issue relates to dependency resolution.

Comments

@fridex
Copy link
Contributor

fridex commented Jul 16, 2018

Issue description

As described in the docs it is expected that libraries do not pin dependencies to specific versions. However this restriction is many times ignored or simply not seen in projects. I, as a user, should be able to pin down a dependency in my library to a version if that is the only version the given package works with.

As a subsequent behavior, if my application uses the same dependency as one of the libs I use, performing pipenv install or pipenv update simply fails if I do not pin down dependency to the same version as my library uses. This requires pinning dependencies in the Pipfile without any particular reason on my side (also consider updates of libs that can cause pinned versions to be rotten).

Expected result

Dependency resolver is smart enough to resolve dependencies even though libraries I'm using have pinned down versions.

Actual result

If I use the same library as one of my dependencies, pipenv install or pipenv update fails:

Standard error
Creating a virtualenv for this project...
Pipfile: /tmp/tmpqc1yuhsw/Pipfile
Using /usr/bin/python3.6m (3.6.5) to create virtualenv...
Running virtualenv with interpreter /usr/bin/python3.6m
Using base prefix '/usr'
New python executable in /tmp/tmpqc1yuhsw/.venv/bin/python3.6m
Also creating executable in /tmp/tmpqc1yuhsw/.venv/bin/python
Installing setuptools, pip, wheel...done.

Virtualenv location: /tmp/tmpqc1yuhsw/.venv
Locking [dev-packages] dependencies...
Locking [packages] dependencies...

Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
  You can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
  Hint: try $ pipenv lock --pre if it is a pre-release dependency.
Could not find a version that matches pyyaml==3.12,==4.2b4 (from -r /tmp/pipenv-130k553c-requirements/pipenv-86747my2-constraints.txt (line 7))
Tried: 3.10, 3.10, 3.11, 3.11, 3.12, 3.12, 3.12, 3.12, 3.12, 3.12, 3.12, 3.12, 3.13, 3.13, 3.13, 3.13, 3.13, 3.13, 3.13, 3.13, 3.13, 3.13, 3.13
Skipped pre-versions: 3.13b1, 3.13b1, 3.13b1, 3.13b1, 3.13b1, 3.13b1, 3.13b1, 3.13b1, 3.13b1, 3.13b1, 3.13rc1, 3.13rc1, 3.13rc1, 3.13rc1, 3.13rc1, 3.13rc1, 3.13rc1, 3.13rc1, 3.13rc1, 3.13rc1, 3.13rc1, 4.2b1, 4.2b2, 4.2b4, 4.2b4, 4.2b4, 4.2b4, 4.2b4
There are incompatible versions in the resolved dependencies.


Relevant parts of the dependency graph:

Dependency graph
aiogremlin [required: ==3.2.6rc1, installed: 3.2.6rc1]
   ...
    - PyYAML [required: ==3.12, installed: 4.2b4]
...
PyYAML [required: Any, installed: 4.2b4]
...

See this automated report for real world example - thoth-station/package-releases-job#47

Steps to replicate

pipenv install aiogremlin==3.2.6rc1 pyyaml --pre


$ pipenv --support

Pipenv version: '2018.7.1'

Pipenv location: '/usr/local/lib/python3.6/site-packages/pipenv'

Python location: '/usr/bin/python3'

Other Python installations in PATH:

  • 2.7: /usr/bin/python2.7

  • 2.7: /usr/bin/python2.7

  • 3.6: /usr/bin/python3.6m

  • 3.6: /usr/bin/python3.6

  • 2.7.15: /usr/bin/python

  • 2.7.15: /usr/bin/python2

  • 3.6.5: /usr/bin/python3

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.6.5',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '4.17.3-200.fc28.x86_64',
 'platform_system': 'Linux',
 'platform_version': '#1 SMP Tue Jun 26 14:17:07 UTC 2018',
 'python_full_version': '3.6.5',
 'python_version': '3.6',
 'sys_platform': 'linux'}

System environment variables:

  • XDG_SEAT
  • GIO_LAUNCHED_DESKTOP_FILE_PID
  • XDG_SESSION_ID
  • WINDOWPATH
  • DISPLAY
  • BASH_ENV
  • HOSTNAME
  • COLORTERM
  • QTLIB
  • ENV
  • GNOME_DESKTOP_SESSION_ID
  • LOGNAME
  • MODULESHOME
  • GUESTFISH_PS1
  • SHELL
  • FPATH
  • GUESTFISH_INIT
  • PATH
  • HISTCONTROL
  • XMODIFIERS
  • GIO_LAUNCHED_DESKTOP_FILE
  • SSH_AUTH_SOCK
  • GUESTFISH_OUTPUT
  • XAUTHORITY
  • XDG_SESSION_DESKTOP
  • GDMSESSION
  • QT_IM_MODULE
  • HISTSIZE
  • SSH_ASKPASS
  • LESSOPEN
  • OLDPWD
  • XDG_MENU_PREFIX
  • MODULES_RUN_QUARANTINE
  • MAIL
  • USERNAME
  • XDG_RUNTIME_DIR
  • MODULES_CMD
  • MODULEPATH
  • DESKTOP_SESSION
  • GUESTFISH_RESTORE
  • QTDIR
  • USER
  • PWD
  • TERMINATOR_UUID
  • VTE_VERSION
  • QTINC
  • TERMINATOR_DBUS_PATH
  • HOME
  • DESKTOP_AUTOSTART_ID
  • XDG_DATA_DIRS
  • LOADEDMODULES
  • MODULEPATH_modshare
  • LANG
  • SHLVL
  • XDG_VTNR
  • GDM_LANG
  • TERMINATOR_DBUS_NAME
  • XDG_SESSION_TYPE
  • DBUS_SESSION_BUS_ADDRESS
  • XDG_CURRENT_DESKTOP
  • TERM
  • SESSION_MANAGER
  • LS_COLORS
  • ZSH
  • PAGER
  • LESS
  • LSCOLORS
  • VIRTUALENVWRAPPER_PROJECT_FILENAME
  • VIRTUALENVWRAPPER_WORKON_CD
  • VIRTUALENVWRAPPER_SCRIPT
  • WORKON_HOME
  • VIRTUALENVWRAPPER_HOOK_DIR
  • LC_CTYPE
  • GOPATH
  • _
  • PYTHONDONTWRITEBYTECODE
  • PIP_PYTHON_PATH

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /home/fpokorny/bin:/usr/local/cuda-8.0/bin:/usr/local/bin:/usr/lib64/qt-3.3/bin:/usr/share/Modules/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/fpokorny/bin
  • SHELL: /usr/bin/zsh
  • LANG: en_US.UTF-8
  • PWD: /tmp/a

Contents of Pipfile ('/tmp/a/Pipfile'):

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

[packages]
aiogremlin = "==3.2.6rc1"
pyyaml = "*"

[dev-packages]

[requires]
python_version = "3.6"

[pipenv]
allow_prereleases = true
@uranusjr
Copy link
Member

I concur. Contributions welcomed!

@techalchemy
Copy link
Member

(Probably don't spend too much time trying to fix this, we are working on it ourselves and should have something to use soon)

This one is tricky and obviously is super annoying from a usage perspective, just know that we are aware of it and it's basically our top priority

@techalchemy techalchemy added the Category: Dependency Resolution Issue relates to dependency resolution. label Jul 24, 2018
techalchemy added a commit that referenced this issue Oct 7, 2018
- Fixes #2499
- Fixes #2529
- Fixes #2589
- Fixes #2666
- Fixes #2767
- Fixes #2785
- Fixes #2795
- Fixes #2801
- Fixes #2802
- Fixes #2824
- Fixes #2862
- Fixes #2867
- Fixes #2879
- Fixes #2880
- Fixes #2894
- Fixes #2902
- Fixes #2924

Signed-off-by: Dan Ryan <dan@danryan.co>
techalchemy added a commit that referenced this issue Oct 7, 2018
- Fixes #2499
- Fixes #2529
- Fixes #2589
- Fixes #2666
- Fixes #2767
- Fixes #2785
- Fixes #2795
- Fixes #2801
- Fixes #2802
- Fixes #2824
- Fixes #2862
- Fixes #2867
- Fixes #2879
- Fixes #2880
- Fixes #2894
- Fixes #2902
- Fixes #2924

Signed-off-by: Dan Ryan <dan@danryan.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Dependency Resolution Issue relates to dependency resolution.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants