From 2e9a473023a27c0205515cd8cc880e11faab495f Mon Sep 17 00:00:00 2001 From: Timo <35654063+tibue99@users.noreply.github.com> Date: Wed, 24 Dec 2025 20:24:50 +0100 Subject: [PATCH 1/4] chore: drop python 3.9 --- .github/workflows/checks.yml | 2 +- .pre-commit-config.yaml | 2 +- README.md | 2 +- pyproject.toml | 3 +-- requirements/requirements.txt | 1 - 5 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 30d1357..eb3b9cb 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v4 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 73a857d..acc876b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,7 +33,7 @@ repos: rev: v3.20.0 hooks: - id: pyupgrade - args: [--py39-plus] + args: [--py310-plus] - repo: https://github.com/DanielNoord/pydocstringformatter rev: v0.7.5 diff --git a/README.md b/README.md index 065180f..7c00832 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Official wrapper for the [Cookie](https://cookieapp.me) API. ## ⚙️ Installation -Python 3.9 or higher is required +Python 3.10 or higher is required ``` pip install cookie-api ``` diff --git a/pyproject.toml b/pyproject.toml index d80bebb..7c1ce48 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "cookie-api" description = "An API wrapper for the Cookie API" -requires-python = ">=3.9" +requires-python = ">=3.10" license = {text = "MIT"} readme = "README.md" keywords = ["discord", "bot", "cookie", "api"] @@ -13,7 +13,6 @@ classifiers = [ "License :: OSI Approved :: MIT License", "Intended Audience :: Developers", "Operating System :: OS Independent", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 0ca428c..57f5cd5 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -1,4 +1,3 @@ httpx pydantic python-dotenv -eval_type_backport; python_version<='3.9' From 58d37ad834fb2da5a6ad8bb11e705d1a2ad41cd6 Mon Sep 17 00:00:00 2001 From: Timo <35654063+tibue99@users.noreply.github.com> Date: Thu, 25 Dec 2025 09:50:23 +0100 Subject: [PATCH 2/4] change model generation target version --- cookie/_internal/model_generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookie/_internal/model_generator.py b/cookie/_internal/model_generator.py index ee1d26e..67a3950 100644 --- a/cookie/_internal/model_generator.py +++ b/cookie/_internal/model_generator.py @@ -16,7 +16,7 @@ use_union_operator=True, use_double_quotes=True, use_standard_collections=True, - target_python_version=PythonVersion.PY_39, + target_python_version=PythonVersion.PY_310, custom_formatters=["formatter"], output=Path("cookie/models.py"), output_model_type=DataModelType.PydanticV2BaseModel, From 3bf478a1e3cfb41fc014d82b283f2062c665c125 Mon Sep 17 00:00:00 2001 From: Timo <35654063+tibue99@users.noreply.github.com> Date: Thu, 25 Dec 2025 10:19:46 +0100 Subject: [PATCH 3/4] regenerate models --- cookie/models.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cookie/models.py b/cookie/models.py index c0bb6f7..8c0a49a 100644 --- a/cookie/models.py +++ b/cookie/models.py @@ -3,9 +3,9 @@ from __future__ import annotations -from datetime import date, datetime +from datetime import date -from pydantic import BaseModel, Field +from pydantic import AwareDatetime, BaseModel, Field from ._internal import BaseChart @@ -17,7 +17,7 @@ class Chart(BaseChart): class Daily(BaseModel): ready: bool = Field(..., title="Ready") - next: datetime = Field(..., title="Next") + next: AwareDatetime = Field(..., title="Next") streak: int = Field(..., title="Streak") max_streak: int = Field(..., title="Max Streak") @@ -50,7 +50,7 @@ class MemberActivity(BaseModel): class Oven(BaseModel): ready: bool = Field(..., title="Ready") - next: datetime = Field(..., title="Next") + next: AwareDatetime = Field(..., title="Next") class Steals(BaseModel): @@ -89,13 +89,13 @@ class VoiceLevel(BaseModel): class Work(BaseModel): - career: str = Field(..., title="Career") + career: str | None = Field(..., title="Career") total_shifts: int = Field(..., title="Total Shifts") current_shifts: int = Field(..., title="Current Shifts") - job: str = Field(..., title="Job") + job: str | None = Field(..., title="Job") job_level: int = Field(..., title="Job Level") job_ready: bool = Field(..., title="Job Ready") - next_shift: datetime = Field(..., title="Next Shift") + next_shift: AwareDatetime = Field(..., title="Next Shift") class HTTPValidationError(BaseModel): From 59340e2a0209155f7a39ff0cc88a88f8471ddc0c Mon Sep 17 00:00:00 2001 From: Timo <35654063+tibue99@users.noreply.github.com> Date: Mon, 29 Dec 2025 20:53:47 +0100 Subject: [PATCH 4/4] use datetime --- cookie/models.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cookie/models.py b/cookie/models.py index 8c0a49a..40b5437 100644 --- a/cookie/models.py +++ b/cookie/models.py @@ -3,9 +3,9 @@ from __future__ import annotations -from datetime import date +from datetime import date, datetime -from pydantic import AwareDatetime, BaseModel, Field +from pydantic import BaseModel, Field from ._internal import BaseChart @@ -17,7 +17,7 @@ class Chart(BaseChart): class Daily(BaseModel): ready: bool = Field(..., title="Ready") - next: AwareDatetime = Field(..., title="Next") + next: datetime = Field(..., title="Next") streak: int = Field(..., title="Streak") max_streak: int = Field(..., title="Max Streak") @@ -50,7 +50,7 @@ class MemberActivity(BaseModel): class Oven(BaseModel): ready: bool = Field(..., title="Ready") - next: AwareDatetime = Field(..., title="Next") + next: datetime = Field(..., title="Next") class Steals(BaseModel): @@ -95,7 +95,7 @@ class Work(BaseModel): job: str | None = Field(..., title="Job") job_level: int = Field(..., title="Job Level") job_ready: bool = Field(..., title="Job Ready") - next_shift: AwareDatetime = Field(..., title="Next Shift") + next_shift: datetime = Field(..., title="Next Shift") class HTTPValidationError(BaseModel):