Bug 1948297

Summary: pipenv/pipdeptree incompatibility - ImportError: cannot import name 'build_dist_index' from 'pipdeptree'
Product: [Fedora] Fedora Reporter: Laurent Almeras <lalmeras>
Component: pipenvAssignee: Tomas Orsava <torsava>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 34CC: awilliam, mhroncok, python-sig, torsava
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard: AcceptedFreezeException
Fixed In Version: pipenv-2020.11.15-2.fc35 pipenv-2020.11.15-2.fc34 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-04-17 22:12:04 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1829025    
Attachments:
Description Flags
pipenv spec patch proposal none

Description Laurent Almeras 2021-04-11 16:30:26 UTC
Created attachment 1771194 [details]
pipenv spec patch proposal

Description of problem:

pipenv as packaged in fedora 34 is not compatible with pipdeptree 2.0.0.


Version-Release number of selected component (if applicable): pipenv-2020.11.15-1


Steps to Reproduce:

mkdir failure
cd failure
pipenv install --dev tox
pipenv install --dev pytest



Actual results:

Installing pytest...
Adding pytest to Pipfile's [dev-packages]...
✔ Installation Succeeded 
Pipfile.lock (dce959) out of date, updating to (4b9d3e)...
Locking [dev-packages] dependencies...
Building requirements...
Resolving dependencies...
✘ Locking Failed! 
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/pipenv/resolver.py", line 764, in <module>
    main()
  File "/usr/lib/python3.9/site-packages/pipenv/resolver.py", line 758, in main
    _main(parsed.pre, parsed.clear, parsed.verbose, parsed.system, parsed.write,
  File "/usr/lib/python3.9/site-packages/pipenv/resolver.py", line 741, in _main
    resolve_packages(pre, clear, verbose, system, write, requirements_dir, packages, dev)
  File "/usr/lib/python3.9/site-packages/pipenv/resolver.py", line 714, in resolve_packages
    results = clean_results(results, resolver, project, dev)
  File "/usr/lib/python3.9/site-packages/pipenv/resolver.py", line 590, in clean_results
    reverse_deps = project.environment.reverse_dependencies()
  File "/usr/lib/python3.9/site-packages/pipenv/environment.py", line 727, in reverse_dependencies
    for req in self.get_package_requirements():
  File "/usr/lib/python3.9/site-packages/pipenv/environment.py", line 695, in get_package_requirements
    from pipdeptree import flatten, sorted_tree, build_dist_index, construct_tree
ImportError: cannot import name 'build_dist_index' from 'pipdeptree' (/usr/lib/python3.9/site-packages/pipdeptree.py)


Expected results:

Package installed in pipenv environment, triggering no error.


Additional info:

This is linked to pipdeptree update from version 0.13.2 to 2.0.0. Vanilla pipenv uses vendored dependencies that are removed by pipenv Fedora packaging.

I attach a patch that removes pipdeptree from the list of devendored dependency. With this patch, pipenv works as expected.

Comment 1 Tomas Orsava 2021-04-13 09:46:22 UTC
Thank you for the patch Laurent, I transformed it into a Pull Request so it can be tested by our CI:
https://src.fedoraproject.org/rpms/pipenv/pull-request/33

Comment 2 Fedora Update System 2021-04-14 15:56:19 UTC
FEDORA-2021-710ca90795 has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-710ca90795

Comment 3 Fedora Update System 2021-04-14 17:14:34 UTC
FEDORA-2021-710ca90795 has been pushed to the Fedora 34 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-710ca90795`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-710ca90795

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 4 Laurent Almeras 2021-04-14 21:44:08 UTC
I just try the new rpm and it works fine. Reported issue is resolved.

Comment 5 Miro Hrončok 2021-04-15 13:55:26 UTC
You can provide karma to the update.


Also, I am requesting a freeze exception, pipenv is on the Python Classroom lab and we want that working -- the Lab should be usable as a live system and we don't expect users to run dnf upgrade when they boot it.

Comment 6 Adam Williamson 2021-04-17 05:43:06 UTC
+3 in https://pagure.io/fedora-qa/blocker-review/issue/356 , marking accepted.

Comment 7 Fedora Update System 2021-04-17 22:12:04 UTC
FEDORA-2021-710ca90795 has been pushed to the Fedora 34 stable repository.
If problem still persists, please make note of it in this bug report.