diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 7c7dfdb76..016fad62c 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -20,7 +20,7 @@ jobs: matrix: os: [macOS-latest, ubuntu-latest] python-version: ["3.8", "3.9", "3.10", "3.11"] - pydantic-version: ["1", "2"] + pydantic-version: ["2"] defaults: run: diff --git a/gmso/core/forcefield.py b/gmso/core/forcefield.py index 1d95a31ca..e86c22c72 100644 --- a/gmso/core/forcefield.py +++ b/gmso/core/forcefield.py @@ -7,7 +7,11 @@ from typing import Iterable from lxml import etree -from pydantic import ValidationError + +try: + from pydantic.v1 import ValidationError +except: + from pydantic import ValidationError from gmso.core.element import element_by_symbol from gmso.exceptions import ( @@ -574,7 +578,7 @@ def xml_from_forcefield_utilities(cls, filename): try: loader = GMSOFFs() ff = loader.load(filename).to_gmso_ff() - except (ForceFieldParseError, FileNotFoundError, ValidationError): + except (ForceFieldParseError, ValidationError): loader = FoyerFFs() ff = loader.load(filename).to_gmso_ff() return ff