materialsproject / api

New API client for the Materials Project
https://materialsproject.github.io/api/
Other
105 stars 34 forks source link

BUG: Change in emmet means that `custodian` is now required dependency to import `MPRester` #861

Closed mattmcdermott closed 8 months ago

mattmcdermott commented 8 months ago

A custodian import was recently added to emmet's TaskDoc: https://github.com/materialsproject/emmet/commit/bc2f68796e153805e577454680df60b2e610d25c

This now means that importing MPRester fails unless custodian is installed manually, as it is not currently required.

Tagging @munrojm. Here is a traceback:

Traceback (most recent call last):
  File "/home/runner/work/reaction-network/reaction-network/src/rxn_network/jobs/core.py", line 135, in make
    from mp_api.client import MPRester
  File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/mp_api/client/__init__.py", line 8, in <module>
    from .mprester import MPRester
  File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/mp_api/client/mprester.py", line 13, in <module>
    from emmet.core.tasks import TaskDoc
  File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/emmet/core/tasks.py", line 10, in <module>
    from custodian.vasp.jobs import VaspJob
ModuleNotFoundError: No module named 'custodian'
matthewcarbone commented 8 months ago

@mattmcdermott thanks for raising this. I'm not a maintainer but I'm having the same issue. Was wondering what was going on.

mattmcdermott commented 8 months ago

@matthewcarbone yup, it's not just you. Should be fixed early this week

rikigigi commented 8 months ago

also here same issue. Why custodian is listed in requirement.txt https://github.com/materialsproject/api/blob/6cde233b469b925ad82c743b770532bd6aa0f42f/requirements.txt#L9C1-L9C10 but non in pyproject.toml?

munrojm commented 8 months ago

This is an issue in emmet-core. Will fix this asap.

munrojm commented 8 months ago

This should be fixed with the latest emmet release.

mattmcdermott commented 8 months ago

Thanks Jason!