From 813e022d5a3c20fce050986a89f2bc78059cdf13 Mon Sep 17 00:00:00 2001 From: Danny Willems Date: Tue, 27 Jan 2026 13:40:54 -0300 Subject: [PATCH 1/2] Update Python to 3.13/3.14, upgrade all dependencies - Drop support for Python 3.9-3.12, now requires Python 3.13+ - Update serde to 0.9.0 (uses stdlib iso8601 which works on Python 3.11+) - Update all dev dependencies to latest versions: - black 26.1.0 - fire 0.7.1 - isort 7.0.0 - pip-audit 2.10.0 - pytest 9.0.2 - ruff 0.14.14 - Update poetry version in CI to 2.3.1 - Use ubuntu-latest instead of ubuntu-22.04 in CI - Add test for ISO8601 nanosecond precision parsing --- .github/workflows/action.yml | 6 +++--- pyproject.toml | 21 ++++++++------------- tests/test_l9format.py | 20 ++++++++++++++++++++ 3 files changed, 31 insertions(+), 16 deletions(-) diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index aa5fefd..ce8b056 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -6,9 +6,9 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.9", "3.10", "3.11", "3.12"] - poetry-version: ["1.8.5"] - os: ["ubuntu-22.04", "macos-latest", "windows-latest"] + python-version: ["3.13", "3.14"] + poetry-version: ["2.3.1"] + os: ["ubuntu-latest", "macos-latest", "windows-latest"] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 diff --git a/pyproject.toml b/pyproject.toml index 2f57c5b..22315be 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,21 +11,16 @@ repository = "https://github.com/leakix/l9format-python" documentation = "https://github.com/leakix/l9format-python" [tool.poetry.dependencies] -python = "^3.9" -# Updating to 0.9.0 breaks the support of iso8601. -# The author of serde updated its code to use the stdlib iso8601 support, which -# does not support for instance: -# 2023-10-05T23:30:36.823867784Z -# Bump up to python 3.11 fixes the issue as it seems fixed in the stdlib of 3.11 -serde = "^0.8.1" +python = "^3.13" +serde = "^0.9.0" [tool.poetry.group.dev.dependencies] -black = "^24.10.0" -fire = "^0.7.0" -isort = "^5.12.0" -pip-audit = "^2.7.3" -pytest = "^8.3.4" -ruff = "^0.9.2" +black = "^26.1.0" +fire = "^0.7.1" +isort = "^7.0.0" +pip-audit = "^2.10.0" +pytest = "^9.0.2" +ruff = "^0.14.14" [build-system] requires = ["poetry-core>=1.0.0"] diff --git a/tests/test_l9format.py b/tests/test_l9format.py index 443ba80..6ce2e2a 100644 --- a/tests/test_l9format.py +++ b/tests/test_l9format.py @@ -21,3 +21,23 @@ def test_l9events_form_ip4scout(): for path in IP4SCOUT_FILES: c = json.load(open(str(path), "r")) l9format.L9Event.from_dict(c) + + +def test_iso8601_nanosecond_parsing(): + """ + Test ISO8601 datetime parsing with nanosecond precision. + + serde 0.9.0+ uses Python stdlib iso8601 support which handles nanoseconds + correctly in Python 3.11+. + """ + path = TESTS_DIR / "l9event.json" + c = json.load(open(str(path), "r")) + # Use a timestamp with nanosecond precision (9 decimal places) + c["time"] = "2023-10-05T23:30:36.823867784Z" + event = l9format.L9Event.from_dict(c) + assert event.time.year == 2023 + assert event.time.month == 10 + assert event.time.day == 5 + assert event.time.hour == 23 + assert event.time.minute == 30 + assert event.time.second == 36 From 17402be8bea073d60a3ff997808600d084a35dd0 Mon Sep 17 00:00:00 2001 From: Danny Willems Date: Tue, 27 Jan 2026 14:16:57 -0300 Subject: [PATCH 2/2] CI: remove Python 3.14 due to serde compatibility issues --- .github/workflows/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index ce8b056..04c3fea 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -6,7 +6,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.13", "3.14"] + python-version: ["3.13"] poetry-version: ["2.3.1"] os: ["ubuntu-latest", "macos-latest", "windows-latest"] runs-on: ${{ matrix.os }}