Skip to content

Commit

Permalink
sigstore_rekor_types: don't use PEP 585 syntax in models
Browse files Browse the repository at this point in the history
Signed-off-by: William Woodruff <william@trailofbits.com>
  • Loading branch information
woodruffw committed Oct 4, 2023
1 parent 14c4772 commit 27978d5
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 19 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ select = ["ALL"]
[tool.ruff.per-file-ignores]
"sigstore_rekor_types/_internal/*.py" = [
"A003", # some fields shadow python builtins
"UP006", # pydantic doesn't support PEP 585 below Python 3.9
"UP007", # pydantic doesn't support PEP 604 below Python 3.10
]
"test/**/*.py" = [
Expand Down
2 changes: 1 addition & 1 deletion sigstore_rekor_types/_internal/alpine.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# generated by datamodel-codegen:
# timestamp: 2023-10-04T14:54:07+00:00
# timestamp: 2023-10-04T15:20:02+00:00

from __future__ import annotations

Expand Down
2 changes: 1 addition & 1 deletion sigstore_rekor_types/_internal/cose.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# generated by datamodel-codegen:
# timestamp: 2023-10-04T14:54:07+00:00
# timestamp: 2023-10-04T15:20:02+00:00

from __future__ import annotations

Expand Down
8 changes: 4 additions & 4 deletions sigstore_rekor_types/_internal/dsse.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# generated by datamodel-codegen:
# timestamp: 2023-10-04T14:54:07+00:00
# timestamp: 2023-10-04T15:20:03+00:00

from __future__ import annotations

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

from pydantic import BaseModel, Field, RootModel, StrictStr

Expand All @@ -14,7 +14,7 @@ class ProposedContent(BaseModel):
...,
description="DSSE envelope specified as a stringified JSON object",
)
verifiers: list[str] = Field(
verifiers: List[str] = Field(
...,
description=(
"collection of all verification material (e.g. public keys or certificates) used to"
Expand Down Expand Up @@ -63,7 +63,7 @@ class PayloadHash(BaseModel):

class DsseV001Schema(BaseModel):
proposed_content: Optional[ProposedContent] = Field(None, alias="proposedContent")
signatures: Optional[list[Signature]] = Field(
signatures: Optional[List[Signature]] = Field(
None,
description=(
"extracted collection of all signatures of the envelope's payload; elements will be"
Expand Down
2 changes: 1 addition & 1 deletion sigstore_rekor_types/_internal/hashedrekord.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# generated by datamodel-codegen:
# timestamp: 2023-10-04T14:54:08+00:00
# timestamp: 2023-10-04T15:20:03+00:00

from __future__ import annotations

Expand Down
2 changes: 1 addition & 1 deletion sigstore_rekor_types/_internal/helm.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# generated by datamodel-codegen:
# timestamp: 2023-10-04T14:54:08+00:00
# timestamp: 2023-10-04T15:20:03+00:00

from __future__ import annotations

Expand Down
6 changes: 3 additions & 3 deletions sigstore_rekor_types/_internal/intoto.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# generated by datamodel-codegen:
# timestamp: 2023-10-04T14:54:08+00:00
# timestamp: 2023-10-04T15:20:03+00:00

from __future__ import annotations

from enum import Enum
from typing import Optional, Union
from typing import List, Optional, Union

from pydantic import BaseModel, Field, RootModel, StrictStr

Expand Down Expand Up @@ -77,7 +77,7 @@ class Envelope(BaseModel):
alias="payloadType",
description="type describing the payload",
)
signatures: list[Signature] = Field(
signatures: List[Signature] = Field(
...,
description="collection of all signatures of the envelope's payload",
min_length=1,
Expand Down
2 changes: 1 addition & 1 deletion sigstore_rekor_types/_internal/jar.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# generated by datamodel-codegen:
# timestamp: 2023-10-04T14:54:08+00:00
# timestamp: 2023-10-04T15:20:04+00:00

from __future__ import annotations

Expand Down
2 changes: 1 addition & 1 deletion sigstore_rekor_types/_internal/rekord.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# generated by datamodel-codegen:
# timestamp: 2023-10-04T14:54:09+00:00
# timestamp: 2023-10-04T15:20:04+00:00

from __future__ import annotations

Expand Down
2 changes: 1 addition & 1 deletion sigstore_rekor_types/_internal/rfc3161.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# generated by datamodel-codegen:
# timestamp: 2023-10-04T14:54:09+00:00
# timestamp: 2023-10-04T15:20:04+00:00

from __future__ import annotations

Expand Down
2 changes: 1 addition & 1 deletion sigstore_rekor_types/_internal/rpm.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# generated by datamodel-codegen:
# timestamp: 2023-10-04T14:54:09+00:00
# timestamp: 2023-10-04T15:20:04+00:00

from __future__ import annotations

Expand Down
8 changes: 4 additions & 4 deletions sigstore_rekor_types/_internal/tuf.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# generated by datamodel-codegen:
# timestamp: 2023-10-04T14:54:10+00:00
# timestamp: 2023-10-04T15:20:05+00:00

from __future__ import annotations

from typing import Any, Optional
from typing import Any, Dict, Optional

from pydantic import BaseModel, Field, RootModel, StrictStr


class Metadata(BaseModel):
content: dict[str, Any] = Field(
content: Dict[str, Any] = Field(
...,
description="Specifies the metadata inline within the document",
)


class Root(BaseModel):
content: dict[str, Any] = Field(
content: Dict[str, Any] = Field(
...,
description="Specifies the metadata inline within the document",
)
Expand Down

0 comments on commit 27978d5

Please sign in to comment.