From d620b67c12c2f639de172cbc93b4edcb78b4a404 Mon Sep 17 00:00:00 2001 From: skshetry <18718008+skshetry@users.noreply.github.com> Date: Tue, 22 Oct 2024 12:30:46 +0545 Subject: [PATCH] ci: support 3.13 --- .github/workflows/check-test-release.yml | 2 +- pyproject.toml | 1 + tests/test_api.py | 12 ++++++------ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/check-test-release.yml b/.github/workflows/check-test-release.yml index 02ed189f..bd770def 100644 --- a/.github/workflows/check-test-release.yml +++ b/.github/workflows/check-test-release.yml @@ -26,7 +26,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python: ["3.9", "3.10", "3.11", "3.12"] + python: ["3.9", "3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v4 diff --git a/pyproject.toml b/pyproject.toml index e9874ac7..eb03e9db 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,6 +16,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", ] requires-python = ">=3.9" dynamic = ["version"] diff --git a/tests/test_api.py b/tests/test_api.py index 15c08ba8..1a31e624 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -2,7 +2,7 @@ """TODO: add more tests for API""" import os -from contextlib import contextmanager +from contextlib import contextmanager, nullcontext from time import sleep from typing import Optional from unittest.mock import ANY, call, patch @@ -509,7 +509,7 @@ def test_if_deprecate_with_delete_and_auto_push_then_invoke_git_push_tag( def test_if_register_with_remote_repo_then_invoke_git_push_tag(tmp_dir: TmpDir): with patch("gto.registry.git_push_tag") as mocked_git_push_tag: with patch("gto.git_utils.TemporaryDirectory") as MockedTemporaryDirectory: - MockedTemporaryDirectory.return_value = tmp_dir + MockedTemporaryDirectory.return_value = nullcontext(tmp_dir) gto.api.register( repo=tests.resources.SAMPLE_REMOTE_REPO_URL, name="model", @@ -525,7 +525,7 @@ def test_if_register_with_remote_repo_then_invoke_git_push_tag(tmp_dir: TmpDir): def test_if_assign_with_remote_repo_then_invoke_git_push_tag(tmp_dir: TmpDir): with patch("gto.registry.git_push_tag") as mocked_git_push_tag: with patch("gto.git_utils.TemporaryDirectory") as MockedTemporaryDirectory: - MockedTemporaryDirectory.return_value = tmp_dir + MockedTemporaryDirectory.return_value = nullcontext(tmp_dir) gto.api.assign( repo=tests.resources.SAMPLE_REMOTE_REPO_URL, name="model", @@ -550,7 +550,7 @@ def test_if_assign_with_remote_repo_then_invoke_git_push_tag(tmp_dir: TmpDir): def test_if_deprecate_with_remote_repo_then_invoke_git_push_tag(tmp_dir: TmpDir): with patch("gto.registry.git_push_tag") as mocked_git_push_tag: with patch("gto.git_utils.TemporaryDirectory") as MockedTemporaryDirectory: - MockedTemporaryDirectory.return_value = tmp_dir + MockedTemporaryDirectory.return_value = nullcontext(tmp_dir) gto.api.deprecate( repo=tests.resources.SAMPLE_REMOTE_REPO_URL, name="churn", @@ -565,7 +565,7 @@ def test_if_deprecate_with_remote_repo_then_invoke_git_push_tag(tmp_dir: TmpDir) def test_if_deregister_with_remote_repo_then_invoke_git_push_tag(tmp_dir: TmpDir): with patch("gto.registry.git_push_tag") as mocked_git_push_tag: with patch("gto.git_utils.TemporaryDirectory") as MockedTemporaryDirectory: - MockedTemporaryDirectory.return_value = tmp_dir + MockedTemporaryDirectory.return_value = nullcontext(tmp_dir) gto.api.deregister( repo=tests.resources.SAMPLE_REMOTE_REPO_URL, name="churn", @@ -581,7 +581,7 @@ def test_if_deregister_with_remote_repo_then_invoke_git_push_tag(tmp_dir: TmpDir def test_if_unassign_with_remote_repo_then_invoke_git_push_tag(tmp_dir: TmpDir): with patch("gto.registry.git_push_tag") as mocked_git_push_tag: with patch("gto.git_utils.TemporaryDirectory") as MockedTemporaryDirectory: - MockedTemporaryDirectory.return_value = tmp_dir + MockedTemporaryDirectory.return_value = nullcontext(tmp_dir) gto.api.unassign( repo=tests.resources.SAMPLE_REMOTE_REPO_URL, name="churn",