materialsvirtuallab / matgl

Graph deep learning library for materials
BSD 3-Clause "New" or "Revised" License
232 stars 57 forks source link

[Bug]: pymatgen CI broken due to transitive `pydantic` dependency via `matgl->dgl->pydantic`. #238

Closed janosh closed 1 month ago

janosh commented 4 months ago

Version

1.0.0

What happened?

pymatgen CI started failing 2 days ago with

/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/dgl/graphbolt/impl/ondisk_dataset.py:34: in <module>
    from .ondisk_metadata import (
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    """Ondisk metadata of GraphBolt."""

    from enum import Enum
    from typing import Any, Dict, List, Optional

>   import pydantic
E   ModuleNotFoundError: No module named 'pydantic'

pymatgen did not used to require pydantic. it's now a transitive dependency via matgl->dgl->pydantic.

_______ TestEnumerateStructureTransformation.test_callable_sort_criteria _______

self = <tests.transformations.test_advanced_transformations.TestEnumerateStructureTransformation testMethod=test_callable_sort_criteria>

    def test_callable_sort_criteria(self):
        matgl = pytest.importorskip("matgl")
>       from matgl.ext.ase import Relaxer

tests/transformations/test_advanced_transformations.py:209: 

given how much maintenance burden pydantic has caused in other MP repos, we definitely want to stay away from it in pymatgen. can you guys look into how to remove dgl/graphbolt from the import stack in matgl?