Skip to content

Commit

Permalink
fix type hints for 3.9 :(
Browse files Browse the repository at this point in the history
  • Loading branch information
Esgrove committed Nov 13, 2024
1 parent d638dda commit 8dfea46
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions python-pyo3/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ classifiers = [
dependencies = []

[project.optional-dependencies]
build = ["maturin", "twine", "wheel"]
dev = ["ruff"]
build = ["maturin", "wheel"]
dev = ["maturin", "ruff"]

[project.urls]
Repository = "https://github.com/NitorCreations/vault"
Expand Down
10 changes: 5 additions & 5 deletions python-pyo3/python/n_vault/vault.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

from collections.abc import Collection
from dataclasses import dataclass
from typing import Optional
from typing import Optional, Union

from n_vault import nitor_vault_rs

Expand Down Expand Up @@ -128,7 +128,7 @@ def direct_decrypt(self, data: bytes) -> bytes:
profile=self.profile,
)

def direct_encrypt(self, data: bytes | str) -> bytes:
def direct_encrypt(self, data: Union[bytes, str]) -> bytes:
"""
Encrypt data with KMS.
"""
Expand Down Expand Up @@ -161,7 +161,7 @@ def exists(self, name: str) -> bool:
profile=self.profile,
)

def init(self) -> StackCreated | CloudFormationStackData:
def init(self) -> Union[StackCreated, CloudFormationStackData]:
"""
Initialize new Vault stack.
Expand Down Expand Up @@ -230,7 +230,7 @@ def stack_status(self) -> CloudFormationStackData:
)
return CloudFormationStackData(**data)

def store(self, name: str, data: bytes | str) -> None:
def store(self, name: str, data: Union[bytes, str]) -> None:
"""
Store encrypted value with given key name in S3.
"""
Expand All @@ -248,7 +248,7 @@ def store(self, name: str, data: bytes | str) -> None:
profile=self.profile,
)

def update(self) -> StackUpdated | CloudFormationStackData:
def update(self) -> Union[StackUpdated, CloudFormationStackData]:
"""
Update the vault Cloudformation stack with the current template.
Expand Down

0 comments on commit 8dfea46

Please sign in to comment.