Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.8.0
FROM python:3.9.20

# Install poetry
RUN pip install poetry
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "Python 3.8.0",
"name": "Python 3.9.20",
"build": {
"dockerfile": "Dockerfile",
"context": ".."
Expand Down
2 changes: 1 addition & 1 deletion alignai/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import uuid
from datetime import datetime, timezone

from alignai.proto.ingestion.v1alpha.event_pb2 import Event, EventProperties
from alignai.api_client import APIClient
from alignai.buffer_storage import BufferStorage
from alignai.config import Config
Expand All @@ -18,6 +17,7 @@
EventTypes,
)
from alignai.logger import get_logger
from alignai.proto.ingestion.v1alpha.event_pb2 import Event, EventProperties
from alignai.utils import (
CustomProperties,
datetime_to_timestamp,
Expand Down
5 changes: 3 additions & 2 deletions alignai/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from collections.abc import Mapping
from datetime import datetime
from typing import Mapping, Dict

from google.protobuf.timestamp_pb2 import Timestamp

from alignai.proto.ingestion.v1alpha.event_pb2 import EventProperties


Expand All @@ -11,7 +12,7 @@ def datetime_to_timestamp(dt: datetime) -> Timestamp:
return timestamp


CustomProperties = Dict[str, str]
CustomProperties = dict[str, str]


def serialize_custom_properties(
Expand Down
5 changes: 1 addition & 4 deletions alignai/validate.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from typing import Dict


class ValidationError(ValueError):
def __init__(self, message: str):
self.message = message
Expand All @@ -23,7 +20,7 @@ def validate_user_id_or_raise(user_id: str):
raise ValidationError("user_id must be at most 64 characters")


def validate_custom_properties_or_raise(custom_properties: Dict[str, str]):
def validate_custom_properties_or_raise(custom_properties: dict[str, str]):
if len(custom_properties) > 10:
raise ValidationError("custom_properties must have at most 10 keys")
for key, value in custom_properties.items():
Expand Down
2 changes: 1 addition & 1 deletion lint_format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

black .
isort .
ruff .
ruff check .
62 changes: 31 additions & 31 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ packages = [{include = "alignai"}]


[tool.poetry.dependencies]
python = ">=3.8.0,<4.0"
python = ">=3.9.0,<4.0"
requests = "^2.31.0"
protobuf = "^5.28.1"
googleapis-common-protos = "^1.65.0"
Expand All @@ -33,12 +33,12 @@ lint.select = [
"F", # pyflakes
"UP", # pyupgrade
]
exclude = ["alignai/ingestion"]
target-version = "py38"
exclude = ["alignai/proto"]
target-version = "py39"

[tool.black]
line-length = 120
target-version = ["py38"]
target-version = ["py39"]
exclude = '''
/(
alignai\/proto
Expand All @@ -49,5 +49,5 @@ exclude = '''

[tool.isort]
profile = "black"
py_version=38
skip_glob = ["alignai/ingestion", "venv", ".venv"]
py_version=39
skip_glob = ["alignai/proto", "venv", ".venv"]