From c79539b86ee86f6aa121af19b6a8461126308b4d Mon Sep 17 00:00:00 2001 From: Szymon Sadkowski Date: Wed, 17 Apr 2024 15:50:01 +0200 Subject: [PATCH 1/3] skip test using gitpython --- pyproject.toml | 1 - tests/e2e/conftest.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2fbf9ad04..48bda301f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,6 @@ swagger-spec-validator = ">=2.7.4" protobuf = "^4.0.0" # Built-in integrations -GitPython = ">=2.0.8" psutil = "*" pandas = "*" diff --git a/tests/e2e/conftest.py b/tests/e2e/conftest.py index 4142f23f7..742ed08ee 100644 --- a/tests/e2e/conftest.py +++ b/tests/e2e/conftest.py @@ -20,7 +20,6 @@ import pytest from faker import Faker -from git import Repo from neptune import init_project from neptune.internal.utils.s3 import get_boto_s3_client @@ -135,7 +134,8 @@ def project(environment): @pytest.fixture(scope="session") -def repo(tmp_path_factory) -> Repo: +def repo(tmp_path_factory) -> "Repo": # noqa: F821 + Repo = pytest.importorskip("git.Repo") path = tmp_path_factory.mktemp("git_repo") repo = Repo.init(path) file = path / f"{uuid.uuid4()}.txt" From b61bed3fa387c0cc6f32fecc28fbcb6b1ea37226 Mon Sep 17 00:00:00 2001 From: Szymon Sadkowski Date: Wed, 17 Apr 2024 15:52:28 +0200 Subject: [PATCH 2/3] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b5809ae5..8fe832616 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ - Added initial operations to the `core.operations` package ([#1759](https://github.com/neptune-ai/neptune-client/pull/1759)) - Move some `OperationProcessor` implementations to `neptune.core.operation_processors` ([#1760](https://github.com/neptune-ai/neptune-client/pull/1760)) - Changed handling of too long custom run id ([#1761](https://github.com/neptune-ai/neptune-client/pull/1761)) +- Skip tests that require `GitPython` when not installed ([#1752](https://github.com/neptune-ai/neptune-client/pull/1752)) ### Fixes - Fixed `tqdm.notebook` import only in Notebook environment ([#1716](https://github.com/neptune-ai/neptune-client/pull/1716)) From 6bd942383abf1f1a62ec17c805c754f7a4088742 Mon Sep 17 00:00:00 2001 From: Szymon Sadkowski Date: Wed, 17 Apr 2024 16:56:36 +0200 Subject: [PATCH 3/3] import fix --- tests/unit/neptune/new/internal/utils/test_git.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/unit/neptune/new/internal/utils/test_git.py b/tests/unit/neptune/new/internal/utils/test_git.py index c3b44e0ab..f024d7a86 100644 --- a/tests/unit/neptune/new/internal/utils/test_git.py +++ b/tests/unit/neptune/new/internal/utils/test_git.py @@ -15,9 +15,7 @@ # import datetime -import git import pytest -from git import Repo from mock import ( MagicMock, patch, @@ -36,6 +34,9 @@ ) from neptune.types import GitRef +git = pytest.importorskip("git") +Repo = pytest.importorskip("git.Repo") + @pytest.mark.skip("Temporarily disabled - will be brought back in 2.0.0") class TestGit: