From e04449964c7240a5cae1d466d25e690dceb19b3a Mon Sep 17 00:00:00 2001 From: Teo Date: Tue, 7 Jan 2025 07:01:39 +0100 Subject: [PATCH 1/3] chore: update dependencies for Python 3.13 compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When running with Python 3.13, ensure Pydantic ≥2.8.0 and typing-extensions are used to prevent build failures with pydantic-core. This is implemented using UV's constraint-dependencies with environment markers, allowing flexible dependency versions for other Python versions while enforcing compatibility requirements specifically for Python 3.13. --- pyproject.toml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 76485a68d..421bfd0e7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,9 +34,6 @@ dependencies = [ "opentelemetry-api>=1.22.0,<2.0.0", "opentelemetry-sdk>=1.22.0,<2.0.0", "opentelemetry-exporter-otlp-proto-http>=1.22.0,<2.0.0", - # "typing-extensions>=4.9.0; python_version >= '3.8'", - # "pydantic>=2.7.4,<3.0.0; python_version < '3.13'", - # "pydantic-core>=2.23.4; python_version >= '3.8' and python_version < '3.13'" ] [dependency-groups] @@ -79,6 +76,10 @@ Issues = "https://github.com/AgentOps-AI/agentops/issues" [tool.uv] compile-bytecode = true # Enable bytecode compilation for better performance default-groups = ["test", "dev"] # Default groups to install for development +constraint-dependencies = [ + "pydantic>=2.8.0; python_version>='3.13'", # Ensure Python 3.13 compatibility + "typing-extensions; python_version>='3.13'" # Required for Pydantic with Python 3.13 +] [tool.autopep8] max_line_length = 120 From a8e5997fff5c5fecf29f0a2e7c7eeb7f08683f95 Mon Sep 17 00:00:00 2001 From: Teo Date: Tue, 7 Jan 2025 07:05:08 +0100 Subject: [PATCH 2/3] ci: trigger python-tests on pyproject.toml changes --- .github/workflows/python-tests.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-tests.yaml b/.github/workflows/python-tests.yaml index e072b9b8f..0b9d7e807 100644 --- a/.github/workflows/python-tests.yaml +++ b/.github/workflows/python-tests.yaml @@ -3,7 +3,7 @@ # :: `act push -j python-tests --matrix python-version:3.10 --container-architecture linux/amd64` name: Python Tests on: - workflow_dispatch: + workflow_dispatch: {} push: branches: - main @@ -16,6 +16,7 @@ on: branches: - main paths: + - 'pyproject.toml' - 'agentops/**/*.py' - 'agentops/**/*.ipynb' - 'tests/**/*.py' From 844ad8b4971085d85e534b7db4983c367a114976 Mon Sep 17 00:00:00 2001 From: Teo Date: Tue, 7 Jan 2025 07:09:10 +0100 Subject: [PATCH 3/3] ci: python-tests - replace deprecated `cache-prefix` with `cache-suffix` --- .github/workflows/python-tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-tests.yaml b/.github/workflows/python-tests.yaml index 0b9d7e807..fdf0b3879 100644 --- a/.github/workflows/python-tests.yaml +++ b/.github/workflows/python-tests.yaml @@ -41,8 +41,8 @@ jobs: continue-on-error: true with: python-version: ${{ matrix.python-version }} - cache-prefix: uv-${{ matrix.python-version }} enable-cache: true + cache-suffix: uv-${{ matrix.python-version }} cache-dependency-glob: "**/pyproject.toml" - name: Install dependencies