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
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install locked dependencies
run: |
python -m pip install --upgrade uv
uv sync --locked --extra dev --python "${{ matrix.python-version }}"
- name: Test supported Python versions
run: uv run --no-sync python -m pytest tests/ -q --tb=short
7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ mcp = []
nlp2uri = ["nlp2uri[envmap]>=0.4.7"]
dev = [
"pytest>=8.0",
"goal>=2.1.0",
"costs>=0.1.20",
"pfix>=0.1.60",
]
Expand Down Expand Up @@ -72,3 +71,9 @@ max_commits = 500

# Cost thresholds for badge colors (USD)
badge_color_thresholds = { low = 1.0, medium = 5.0, high = 10.0, critical = 50.0 }

[tool.uv.dependency-groups.automation]
requires-python = ">=3.12"

[dependency-groups]
automation = ["goal>=2.1.302"]
4 changes: 2 additions & 2 deletions src/env2llm/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import annotations

import os
from datetime import UTC, datetime
from datetime import datetime, timezone
from typing import Mapping

DEFAULT_ENV_KEYS: tuple[str, ...] = (
Expand Down Expand Up @@ -74,7 +74,7 @@ def collect_environment(
_collect_default_keys(out, keys)
if include_all_prefixes:
_collect_prefixed_keys(out, include_all_prefixes=include_all_prefixes)
out["generated_at"] = datetime.now(UTC).isoformat()
out["generated_at"] = datetime.now(timezone.utc).isoformat()
return out


Expand Down
6 changes: 3 additions & 3 deletions src/env2llm/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import os
import shutil
import stat
from datetime import UTC, datetime
from datetime import datetime, timezone
from pathlib import Path
from typing import Any, Mapping

Expand Down Expand Up @@ -183,7 +183,7 @@ def current_run_id(root: Path | str) -> str:
env = os.environ.get("NLP2DSL_RUN_ID", "").strip()
if env:
return env
stamp = datetime.now(UTC).strftime("%Y%m%dT%H%M%S")
stamp = datetime.now(timezone.utc).strftime("%Y%m%dT%H%M%S")
os.environ["NLP2DSL_RUN_ID"] = stamp
return stamp

Expand Down Expand Up @@ -214,7 +214,7 @@ def write_turn_snapshot(
"turn": turn,
"phase": phase,
"status": response.get("status"),
"generated_at": datetime.now(UTC).isoformat(),
"generated_at": datetime.now(timezone.utc).isoformat(),
"conversation_id": response.get("conversation_id"),
"missing": response.get("missing"),
"autofill_applied": response.get("autofill_applied"),
Expand Down
4 changes: 2 additions & 2 deletions src/env2llm/probes/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import annotations

import platform
from datetime import UTC, datetime
from datetime import datetime, timezone
from pathlib import Path
from typing import Any

Expand Down Expand Up @@ -145,7 +145,7 @@ def _resolve_monitor_log(project_dir: Path) -> Path:
def collect_host_probe(*, project_dir: Path | str | None = None) -> HostProbeIR:
"""Snapshot cron, local services, and example-test readiness on this host."""
root = Path(project_dir).resolve() if project_dir is not None else Path.cwd()
now = datetime.now(UTC).isoformat()
now = datetime.now(timezone.utc).isoformat()

cron_ok, cron_entries, taskinity_cron = cron_probe_state()
endpoints = _probe_agent_http_endpoints()
Expand Down
6 changes: 3 additions & 3 deletions src/env2llm/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from __future__ import annotations

from datetime import UTC, datetime
from datetime import datetime, timezone
from pathlib import Path
from typing import Any, Mapping

Expand Down Expand Up @@ -56,7 +56,7 @@ def _merge_execution_header(
phase: str,
) -> None:
history["last_phase"] = phase
history["last_observed_at"] = datetime.now(UTC).isoformat()
history["last_observed_at"] = datetime.now(timezone.utc).isoformat()
history["last_status"] = str(execution.get("status", execution.get("state", "")))


Expand Down Expand Up @@ -216,7 +216,7 @@ def refresh_doql_registry(
ir.data.update(dict(extra_data))

ir.workflow_history.setdefault("last_phase", phase)
ir.workflow_history["last_observed_at"] = datetime.now(UTC).isoformat()
ir.workflow_history["last_observed_at"] = datetime.now(timezone.utc).isoformat()
if intent:
ir.workflow_history["last_intent"] = intent

Expand Down
Loading
Loading