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

chore: Bump Pydantic to 2.9.2 Using the v1 API #137

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
175 changes: 124 additions & 51 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion py_ocsf_models/events/base_event.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from enum import IntEnum
from typing import Optional

from pydantic import BaseModel
from pydantic.v1 import BaseModel

from py_ocsf_models.objects.enrichment import Enrichment
from py_ocsf_models.objects.metadata import Metadata
Expand Down
2 changes: 1 addition & 1 deletion py_ocsf_models/events/findings/detection_finding.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from enum import IntEnum
from typing import Optional

from pydantic import BaseModel
from pydantic.v1 import BaseModel

from py_ocsf_models.events.findings.finding import Finding
from py_ocsf_models.objects.api import API
Expand Down
2 changes: 1 addition & 1 deletion py_ocsf_models/events/findings/finding.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from enum import IntEnum
from typing import List, Optional

from pydantic import BaseModel
from pydantic.v1 import BaseModel

from py_ocsf_models.events.base_event import BaseEvent
from py_ocsf_models.objects.mitre_attack import MITREAttack
Expand Down
2 changes: 1 addition & 1 deletion py_ocsf_models/objects/account.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from enum import IntEnum
from typing import Optional

from pydantic import BaseModel
from pydantic.v1 import BaseModel


class TypeID(IntEnum):
Expand Down
2 changes: 1 addition & 1 deletion py_ocsf_models/objects/api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Optional

from pydantic import BaseModel
from pydantic.v1 import BaseModel

from py_ocsf_models.objects.group import Group
from py_ocsf_models.objects.request_elements import RequestElements
Expand Down
2 changes: 1 addition & 1 deletion py_ocsf_models/objects/cloud.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Optional

from pydantic import BaseModel
from pydantic.v1 import BaseModel

from py_ocsf_models.objects.account import Account
from py_ocsf_models.objects.organization import Organization
Expand Down
2 changes: 1 addition & 1 deletion py_ocsf_models/objects/container.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Optional
from uuid import UUID

from pydantic import BaseModel
from pydantic.v1 import BaseModel

from py_ocsf_models.objects.fingerprint import FingerPrint
from py_ocsf_models.objects.image import Image
Expand Down
2 changes: 1 addition & 1 deletion py_ocsf_models/objects/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from enum import IntEnum
from typing import List, Optional

from pydantic import BaseModel
from pydantic.v1 import BaseModel

from py_ocsf_models.objects.device_hardware_info import DeviceHardwareInfo
from py_ocsf_models.objects.geolocation import GeoLocation
Expand Down
2 changes: 1 addition & 1 deletion py_ocsf_models/objects/device_hardware_info.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Optional

from pydantic import BaseModel
from pydantic.v1 import BaseModel


class KeyboardInformation(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion py_ocsf_models/objects/dns_query.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from enum import IntEnum
from typing import Optional

from pydantic import BaseModel
from pydantic.v1 import BaseModel


class DNSOpcodeID(IntEnum):
Expand Down
2 changes: 1 addition & 1 deletion py_ocsf_models/objects/enrichment.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Optional

from pydantic import BaseModel
from pydantic.v1 import BaseModel


class Enrichment(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion py_ocsf_models/objects/evidence_artifacts.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Optional

from pydantic import BaseModel
from pydantic.v1 import BaseModel

from py_ocsf_models.objects.api import API
from py_ocsf_models.objects.dns_query import DNSQuery
Expand Down
2 changes: 1 addition & 1 deletion py_ocsf_models/objects/fingerprint.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from enum import IntEnum
from typing import Optional

from pydantic import BaseModel
from pydantic.v1 import BaseModel


class AlgorithmID(IntEnum):
Expand Down
2 changes: 1 addition & 1 deletion py_ocsf_models/objects/geolocation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Optional

from pydantic import BaseModel
from pydantic.v1 import BaseModel


class GeoLocation(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion py_ocsf_models/objects/group.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Optional

from pydantic import BaseModel
from pydantic.v1 import BaseModel


class Group(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion py_ocsf_models/objects/image.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Optional

from pydantic import BaseModel
from pydantic.v1 import BaseModel


class Image(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion py_ocsf_models/objects/kb_article.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from datetime import datetime
from typing import Optional

from pydantic import BaseModel
from pydantic.v1 import BaseModel

from py_ocsf_models.objects.operating_system import OperatingSystem
from py_ocsf_models.objects.product import Product
Expand Down
2 changes: 1 addition & 1 deletion py_ocsf_models/objects/ldap_person.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# FIXME(circular-dependency)
# from py_ocsf_models.objects.user import User
from pydantic import BaseModel, EmailStr
from pydantic.v1 import BaseModel, EmailStr

from py_ocsf_models.objects.geolocation import GeoLocation

Expand Down
2 changes: 1 addition & 1 deletion py_ocsf_models/objects/metadata.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from datetime import datetime
from typing import List, Optional

from pydantic import BaseModel
from pydantic.v1 import BaseModel

from py_ocsf_models import OCSF_VERSION
from py_ocsf_models.objects.device import Device
Expand Down
2 changes: 1 addition & 1 deletion py_ocsf_models/objects/mitre_attack.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Optional

from pydantic import BaseModel
from pydantic.v1 import BaseModel


class Technique(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion py_ocsf_models/objects/network_interface.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from enum import IntEnum
from typing import Optional

from pydantic import BaseModel
from pydantic.v1 import BaseModel


class NetworkType(IntEnum):
Expand Down
2 changes: 1 addition & 1 deletion py_ocsf_models/objects/observable.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from enum import IntEnum
from typing import Optional

from pydantic import BaseModel
from pydantic.v1 import BaseModel


class ReputationScoreID(IntEnum):
Expand Down
2 changes: 1 addition & 1 deletion py_ocsf_models/objects/operating_system.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from enum import IntEnum
from typing import Optional

from pydantic import BaseModel
from pydantic.v1 import BaseModel


class TypeID(IntEnum):
Expand Down
2 changes: 1 addition & 1 deletion py_ocsf_models/objects/organization.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Optional

from pydantic import BaseModel
from pydantic.v1 import BaseModel


class Organization(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion py_ocsf_models/objects/product.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Optional

from pydantic import BaseModel
from pydantic.v1 import BaseModel


class Feature(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion py_ocsf_models/objects/related_event.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import List, Optional

from pydantic import BaseModel
from pydantic.v1 import BaseModel

from py_ocsf_models.objects.mitre_attack import MITREAttack
from py_ocsf_models.objects.observable import Observable
Expand Down
2 changes: 1 addition & 1 deletion py_ocsf_models/objects/remediation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Optional

from pydantic import BaseModel
from pydantic.v1 import BaseModel

from py_ocsf_models.objects.kb_article import KBArticle

Expand Down
2 changes: 1 addition & 1 deletion py_ocsf_models/objects/request_elements.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Optional

from pydantic import BaseModel
from pydantic.v1 import BaseModel

from py_ocsf_models.objects.container import Container

Expand Down
2 changes: 1 addition & 1 deletion py_ocsf_models/objects/resource_details.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Optional

from pydantic import BaseModel
from pydantic.v1 import BaseModel

from py_ocsf_models.objects.group import Group
from py_ocsf_models.objects.user import User
Expand Down
2 changes: 1 addition & 1 deletion py_ocsf_models/objects/response_elements.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Optional

from pydantic import BaseModel
from pydantic.v1 import BaseModel

from py_ocsf_models.objects.container import Container

Expand Down
2 changes: 1 addition & 1 deletion py_ocsf_models/objects/service.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Optional

from pydantic import BaseModel
from pydantic.v1 import BaseModel


class Service(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion py_ocsf_models/objects/user.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Optional

from pydantic import BaseModel
from pydantic.v1 import BaseModel

from py_ocsf_models.objects.account import Account
from py_ocsf_models.objects.group import Group
Expand Down
2 changes: 1 addition & 1 deletion py_ocsf_models/objects/vulnerability_details.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from datetime import datetime
from typing import List, Optional

from pydantic import BaseModel
from pydantic.v1 import BaseModel

from py_ocsf_models.objects.kb_article import KBArticle
from py_ocsf_models.objects.remediation import Remediation
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ version = "0.2.0"
[tool.poetry.dependencies]
cryptography = "43.0.1"
email-validator = "2.2.0"
pydantic = "1.10.18"
pydantic = "^2.9.2"
python = ">=3.9,<3.13"

[tool.poetry.group.dev.dependencies]
Expand Down