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

handling of extra_requires #47

Closed
anntzer opened this issue Jun 16, 2016 · 12 comments
Closed

handling of extra_requires #47

anntzer opened this issue Jun 16, 2016 · 12 comments
Labels
tobeconfirmed To be confirmed after more investigation

Comments

@anntzer
Copy link

anntzer commented Jun 16, 2016

scikit-image (https://pypi.python.org/pypi/scikit-image) depends on dask[array] (https://pypi.python.org/pypi/dask) (not visible on PyPI but this can be checked by installing in a clean venv). dask[array] itself depends on toolz and numpy.
pipdeptree does not realize this and considers toolz and numpy to not be dependents of anything after a clean install of scikit-image.

@naiquevin
Copy link
Contributor

Sorry for replying so late, I missed this issue somehow. What do you mean by "not visible on PyPI"? pipdeptree internally calls functions in the pip and pkg_resources modules. Hence it can only identify dependencies that pip can.

@anntzer
Copy link
Author

anntzer commented Oct 23, 2016

PyPI shows the line

Requires matplotlib (>= 1.3.1), numpy (>= 1.7.2), scipy (>= 0.9.0), six (>= 1.7.3), networkx (>= 1.8), pillow (>= 2.1.0), dask (>= 0.5.0)

This dependency is visible at /usr/lib/python3.5/site-packages/scikit_image-0.12.3-py3.5.egg-info/requires.txt (or the equivalent on your OS), which contains the lines

six>=1.7.3
networkx>=1.8
pillow>=2.1.0
dask[array]>=0.5.0

pip does know about the dependency (well, it's able to resolve it...) but I'm not sure pip or pkg_resources expose it though...

@naiquevin
Copy link
Contributor

Ok. I'll have a look at it. Thanks.

@OrangeDog
Copy link

Looks like this is the same as pypa/pipenv#1013
See there for additional detail.

@joar
Copy link

joar commented Sep 19, 2018

Looks like this is the same as pypa/pipenv#1013
See there for additional detail.

For future reference:

  • This pipdeptree issue is not duplicated by that pipenv issue.
  • The pipenv issue depends on this pipdeptree issue to solve the pipenv issue since pipenv depends on pipdeptree. (the pipenv issue is closed as "out of scope").

@naiquevin naiquevin added the tobeconfirmed To be confirmed after more investigation label Jul 14, 2019
@gaborbernat
Copy link
Member

This should be no longer the case.

@TurnrDev
Copy link

TurnrDev commented Nov 7, 2023

Hi, unfortunately, this seems to still be a problem.

To replicate this, I created a fresh virtualenv with just pipdeptree and django-import-export 3.2.0

django-import-export==3.2.0 depends on tablib[html,ods,xls,xlsx,yaml]>=3.4.0 in it's install_requires
tablib==3.5.0 depends on the following:

[project.optional-dependencies]
all = [
    "markuppy",
    "odfpy",
    "openpyxl>=2.6.0",
    "pandas",
    "pyyaml",
    "tabulate",
    "xlrd",
    "xlwt",
]
cli = ["tabulate"]
html = ["markuppy"]
ods = ["odfpy"]
pandas = ["pandas"]
xls = ["xlrd", "xlwt"]
xlsx = ["openpyxl>=2.6.0"]
yaml = ["pyyaml"]

Which can be seen in tablib-3.5.0-py3-none-any.whl/tablib-3.5.0.dist-info/METADATA as the following lines:

Provides-Extra: all
Requires-Dist: markuppy ; extra == 'all'
Requires-Dist: odfpy ; extra == 'all'
Requires-Dist: openpyxl (>=2.6.0) ; extra == 'all'
Requires-Dist: pandas ; extra == 'all'
Requires-Dist: pyyaml ; extra == 'all'
Requires-Dist: tabulate ; extra == 'all'
Requires-Dist: xlrd ; extra == 'all'
Requires-Dist: xlwt ; extra == 'all'
Provides-Extra: cli
Requires-Dist: tabulate ; extra == 'cli'
Provides-Extra: html
Requires-Dist: markuppy ; extra == 'html'
Provides-Extra: ods
Requires-Dist: odfpy ; extra == 'ods'
Provides-Extra: pandas
Requires-Dist: pandas ; extra == 'pandas'
Provides-Extra: xls
Requires-Dist: xlrd ; extra == 'xls'
Requires-Dist: xlwt ; extra == 'xls'
Provides-Extra: xlsx
Requires-Dist: openpyxl (>=2.6.0) ; extra == 'xlsx'
Provides-Extra: yaml
Requires-Dist: pyyaml ; extra == 'yaml'
Unfortunately, pipdeptree appears to be unable to find the dependency between `tablib` and it's optional dependencies

This is my pip freeze output:

(.venv) C:\Users\JayTurner\Desktop> pip freeze
asgiref==3.7.2
defusedxml==0.7.1
diff-match-patch==20230430
Django==4.2.7
django-import-export==3.2.0
et-xmlfile==1.1.0
MarkupPy==1.14
odfpy==1.4.1
openpyxl==3.1.2
pipdeptree==2.13.0
PyYAML==6.0.1
sqlparse==0.4.4
tablib==3.5.0
tzdata==2023.3
xlrd==2.0.1
xlwt==1.3.0

This is my pipdeptree output:

(.venv) C:\Users\JayTurner\Desktop> pipdeptree
django-import-export==3.2.0
├── diff-match-patch [required: Any, installed: 20230430]
├── Django [required: >=3.2, installed: 4.2.7]
│   ├── asgiref [required: >=3.6.0,<4, installed: 3.7.2]
│   ├── sqlparse [required: >=0.3.1, installed: 0.4.4]
│   └── tzdata [required: Any, installed: 2023.3]
└── tablib [required: >=3.4.0, installed: 3.5.0]
MarkupPy==1.14
odfpy==1.4.1
└── defusedxml [required: Any, installed: 0.7.1]
openpyxl==3.1.2
└── et-xmlfile [required: Any, installed: 1.1.0]
pip==23.2.1
pipdeptree==2.13.0
PyYAML==6.0.1
setuptools==65.5.0
xlrd==2.0.1
xlwt==1.3.0

I have also tried on pipdeptree 2.3.0, 2.3.1 and 2.3.2, which were the releases just before, just after and a bit after your comment on September 6th, 2022, none of which seem to work as expected.

@TurnrDev
Copy link

TurnrDev commented Nov 7, 2023

Interestingly, pipdeptree[test]'s own dependencies don't show as related to pipdeptree. Perhaps that might be an easy way to test that functionality is working.

@TurnrDev
Copy link

TurnrDev commented Nov 7, 2023

I see this might be related to #107 too

@TurnrDev
Copy link

TurnrDev commented Nov 7, 2023

I see it's due to lack of resources. I won't bother you no more!

@gaborbernat
Copy link
Member

PR welcome 🤗

@TurnrDev
Copy link

TurnrDev commented Nov 7, 2023

I'll see what I can do, but no promises ☺️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tobeconfirmed To be confirmed after more investigation
Projects
None yet
Development

No branches or pull requests

6 participants