diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c14c991..37af6ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,3 +57,27 @@ jobs: - name: Tests run: uv run pytest tests/ -v --cov=agentscore_commerce --cov-report=term-missing + + test: + runs-on: blacksmith-2vcpu-ubuntu-2404-arm + timeout-minutes: 10 + strategy: + fail-fast: false + matrix: + python: ["3.11", "3.12", "3.13", "3.14", "3.15"] + steps: + - uses: useblacksmith/checkout@v1 + + - name: Install uv + uses: astral-sh/setup-uv@v10.2.0 + with: + version: "0.12.20" + + - name: Set up Python + run: uv python install ${{ matrix.python }} + + - name: Install dependencies + run: uv sync --frozen --all-extras --python ${{ matrix.python }} + + - name: Tests + run: uv run --python ${{ matrix.python }} pytest tests/ -q diff --git a/agentscore_commerce/checkout_compute_first.py b/agentscore_commerce/checkout_compute_first.py index 8716cc7..d35cc02 100644 --- a/agentscore_commerce/checkout_compute_first.py +++ b/agentscore_commerce/checkout_compute_first.py @@ -33,7 +33,7 @@ import logging import uuid from dataclasses import dataclass, field -from datetime import UTC, datetime, timezone +from datetime import UTC, datetime from decimal import Decimal from typing import TYPE_CHECKING, Any @@ -207,7 +207,7 @@ def _decimals_for_unit(unit_price_cents: float) -> int: def _iso_now() -> str: - return datetime.now(timezone.utc).isoformat().replace("+00:00", "Z") + return datetime.now(UTC).isoformat().replace("+00:00", "Z") def _default_success_body(app_url: str) -> Callable[[SuccessBodyArgs], dict[str, Any]]: diff --git a/examples/multi_rail_merchant.py b/examples/multi_rail_merchant.py index 2cf24dd..cca5bcf 100644 --- a/examples/multi_rail_merchant.py +++ b/examples/multi_rail_merchant.py @@ -40,7 +40,7 @@ import os from dataclasses import asdict -from datetime import datetime, timezone +from datetime import UTC, datetime from typing import Any from fastapi import FastAPI, Request @@ -154,7 +154,7 @@ async def _on_settled(ctx: Any, outcome: SettleOutcome) -> dict[str, Any]: success = build_success_next_steps(order_status_url=f"{APP_URL}/orders/{ctx.reference_id}") receipt = Receipt( id=ctx.reference_id, - created_at=datetime.now(timezone.utc).isoformat(), + created_at=datetime.now(UTC).isoformat(), pricing=ctx.pricing.block, product=ProductInfo(name="Regulated Goods Cart"), payment_status="completed", diff --git a/pyproject.toml b/pyproject.toml index 8544246..b7596fd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,6 +19,11 @@ classifiers = [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", + "Programming Language :: Python :: 3.15", "Framework :: FastAPI", "Framework :: Flask", "Framework :: Django", diff --git a/ruff.toml b/ruff.toml index 40e2e29..8e52da7 100644 --- a/ruff.toml +++ b/ruff.toml @@ -1,4 +1,4 @@ -target-version = "py310" +target-version = "py311" line-length = 120 [lint]