diff --git a/c2p/common/c2p_base_model.py b/c2p/common/c2p_base_model.py index 884f031..be9a525 100644 --- a/c2p/common/c2p_base_model.py +++ b/c2p/common/c2p_base_model.py @@ -20,8 +20,8 @@ from typing import Any, Dict, Optional, Type, TypeVar import orjson -from pydantic import BaseModel -from pydantic.parse import load_file +from pydantic.v1 import BaseModel +from pydantic.v1.parse import load_file from trestle.core.base_model import robust_datetime_serialization import c2p.common.err as err diff --git a/c2p/framework/c2p.py b/c2p/framework/c2p.py index 037c1d2..0846fe3 100644 --- a/c2p/framework/c2p.py +++ b/c2p/framework/c2p.py @@ -17,7 +17,7 @@ import pathlib from typing import Dict, List, Optional -from pydantic import BaseModel +from pydantic.v1 import BaseModel from trestle import __version__ as TRESTLE_VERSION from trestle.oscal import OSCAL_VERSION from trestle.oscal.assessment_results import ( diff --git a/c2p/framework/models/c2p_config.py b/c2p/framework/models/c2p_config.py index bbdae8c..41b00ae 100644 --- a/c2p/framework/models/c2p_config.py +++ b/c2p/framework/models/c2p_config.py @@ -17,7 +17,7 @@ from enum import Enum from typing import Dict, List, Literal, Optional, Union -from pydantic import Field +from pydantic.v1 import Field from c2p.common.c2p_base_model import C2PBaseModel from c2p.framework.models import PVPResult diff --git a/c2p/framework/models/policy.py b/c2p/framework/models/policy.py index 1ec8052..5f278ba 100644 --- a/c2p/framework/models/policy.py +++ b/c2p/framework/models/policy.py @@ -16,7 +16,7 @@ from typing import Dict, List, Optional -from pydantic import Field +from pydantic.v1 import Field from c2p.common.c2p_base_model import C2PBaseModel diff --git a/c2p/framework/models/pvp_result.py b/c2p/framework/models/pvp_result.py index 19649e3..e9a6e0f 100644 --- a/c2p/framework/models/pvp_result.py +++ b/c2p/framework/models/pvp_result.py @@ -18,7 +18,7 @@ from enum import Enum from typing import List, Optional -from pydantic import Field +from pydantic.v1 import Field from c2p.common.c2p_base_model import C2PBaseModel diff --git a/c2p/framework/models/raw_result.py b/c2p/framework/models/raw_result.py index a6618b2..1b08d17 100644 --- a/c2p/framework/models/raw_result.py +++ b/c2p/framework/models/raw_result.py @@ -16,7 +16,7 @@ from typing import Any, Dict, Optional -from pydantic import Field +from pydantic.v1 import Field from c2p.common.c2p_base_model import C2PBaseModel diff --git a/c2p/framework/oscal_utils.py b/c2p/framework/oscal_utils.py index 9a68561..a1e605f 100644 --- a/c2p/framework/oscal_utils.py +++ b/c2p/framework/oscal_utils.py @@ -19,15 +19,15 @@ from typing import Any, Dict, List, Union from uuid import uuid4 -from pydantic import BaseModel +from pydantic.v1 import BaseModel from trestle.common.common_types import TypeWithProps from trestle.common.list_utils import as_list -from trestle.oscal.assessment_results import ( +from trestle.oscal.common import ( ControlSelection, + Property, ReviewedControls, SelectControlById, ) -from trestle.oscal.common import Property from trestle.oscal.component import ComponentDefinition from c2p.common.oscal import is_component_type_validation diff --git a/c2p/framework/plugin_spec.py b/c2p/framework/plugin_spec.py index f562dfe..ec5ca26 100644 --- a/c2p/framework/plugin_spec.py +++ b/c2p/framework/plugin_spec.py @@ -17,7 +17,7 @@ from abc import ABC, abstractmethod from typing import Any -from pydantic import BaseModel +from pydantic.v1 import BaseModel from c2p.framework.models.policy import Policy from c2p.framework.models.pvp_result import PVPResult diff --git a/c2p/tools/viewer/viewer.py b/c2p/tools/viewer/viewer.py index cba5bb6..2c25e65 100644 --- a/c2p/tools/viewer/viewer.py +++ b/c2p/tools/viewer/viewer.py @@ -17,7 +17,7 @@ from typing import Dict, List, Optional from jinja2 import Template -from pydantic import BaseModel +from pydantic.v1 import BaseModel from trestle.oscal.assessment_results import AssessmentResults, Observation from trestle.oscal.common import Property from trestle.oscal.component import ComponentDefinition, DefinedComponent diff --git a/plugins_public/plugins/auditree.py b/plugins_public/plugins/auditree.py index e000274..6351303 100644 --- a/plugins_public/plugins/auditree.py +++ b/plugins_public/plugins/auditree.py @@ -21,8 +21,8 @@ from pathlib import Path from typing import List, Optional, Tuple, Union -from pydantic import Field -from pydantic.utils import deep_update +from pydantic.v1 import Field +from pydantic.v1.utils import deep_update from c2p.common.logging import getLogger from c2p.common.utils import get_dict_safely diff --git a/plugins_public/plugins/kyverno.py b/plugins_public/plugins/kyverno.py index ba12598..98b0d2e 100644 --- a/plugins_public/plugins/kyverno.py +++ b/plugins_public/plugins/kyverno.py @@ -21,7 +21,7 @@ import yaml from jinja2 import Template -from pydantic import Field +from pydantic.v1 import Field from c2p.common.err import C2PError from c2p.common.logging import getLogger diff --git a/plugins_public/plugins/ocm.py b/plugins_public/plugins/ocm.py index 7c1c068..a8ed229 100644 --- a/plugins_public/plugins/ocm.py +++ b/plugins_public/plugins/ocm.py @@ -21,7 +21,7 @@ from typing import Any, Dict, List, Optional, TypeVar import yaml -from pydantic import BaseModel, Field +from pydantic.v1 import BaseModel, Field from c2p.common.err import C2PError from c2p.common.logging import getLogger diff --git a/pyproject.toml b/pyproject.toml index 03e0256..b65e6b1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,7 @@ classifiers = [ "Operating System :: OS Independent", ] dependencies = [ - "compliance-trestle==2.2.1", + "compliance-trestle~=3.3", "PyGithub==1.58.0", "jq==1.6.0", "pluggy", diff --git a/tests/c2p/framework/test_c2p.py b/tests/c2p/framework/test_c2p.py index 9766ded..8769121 100644 --- a/tests/c2p/framework/test_c2p.py +++ b/tests/c2p/framework/test_c2p.py @@ -18,7 +18,7 @@ import pathlib from typing import Any, Dict, Tuple -from pydantic import BaseModel +from pydantic.v1 import BaseModel from trestle.oscal.assessment_results import AssessmentResults from c2p.framework.c2p import C2P diff --git a/tests/data/framework/c2p/assessment-results.json b/tests/data/framework/c2p/assessment-results.json index bb6dac2..602b742 100644 --- a/tests/data/framework/c2p/assessment-results.json +++ b/tests/data/framework/c2p/assessment-results.json @@ -3,8 +3,8 @@ "metadata": { "title": "TEST Assessment Results", "last_modified": "2024-03-22T08:28:11.000+00:00", - "version": "2.2.1", - "oscal_version": "1.0.4" + "version": "3.3.0", + "oscal_version": "1.1.2" }, "import_ap": { "href": "https://not-available-for-now"