From b1948ad94e7bd1e6fce56534ced4649515572af8 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Thu, 5 Sep 2024 11:04:25 +0200 Subject: [PATCH 1/2] Remove dep on mock --- .github/workflows/pypi.yml | 2 +- docker/Dockerfile.dev | 2 +- pyproject.toml | 1 - tests/test_models.py | 3 --- tests/test_preprocessing.py | 3 --- 5 files changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index a240182a..0b94f6f3 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -16,7 +16,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip uv - python -m uv pip install setuptools wheel twine mock + python -m uv pip install setuptools wheel twine - name: Build and publish env: TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} diff --git a/docker/Dockerfile.dev b/docker/Dockerfile.dev index 2a7abbe9..fb691c70 100644 --- a/docker/Dockerfile.dev +++ b/docker/Dockerfile.dev @@ -4,7 +4,7 @@ WORKDIR /tmp/smp/ COPY ./requirements.txt /tmp/smp/requirements.txt RUN pip install -r requirements.txt -RUN pip install pytest mock +RUN pip install pytest COPY . /tmp/smp/ RUN pip install . diff --git a/pyproject.toml b/pyproject.toml index 06624560..fbf9c76c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,6 @@ docs = [ 'sphinx-book-theme==1.1.2', ] test = [ - 'mock', 'pytest', 'ruff==0.5.2', ] diff --git a/tests/test_models.py b/tests/test_models.py index acd71a04..03f84311 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -1,10 +1,7 @@ import sys -import mock import pytest import torch -# mock detection module -sys.modules["torchvision._C"] = mock.Mock() import segmentation_models_pytorch as smp # noqa diff --git a/tests/test_preprocessing.py b/tests/test_preprocessing.py index 282232d3..ef56a2fc 100644 --- a/tests/test_preprocessing.py +++ b/tests/test_preprocessing.py @@ -1,9 +1,6 @@ import sys -import mock import numpy as np -# mock detection module -sys.modules["torchvision._C"] = mock.Mock() import segmentation_models_pytorch as smp # noqa From 38fea0e2a53db4bbb1d5a2108c2d942baa203c91 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Thu, 5 Sep 2024 14:32:36 +0200 Subject: [PATCH 2/2] Remove unused imports --- tests/test_models.py | 1 - tests/test_preprocessing.py | 1 - 2 files changed, 2 deletions(-) diff --git a/tests/test_models.py b/tests/test_models.py index 03f84311..f78f55d6 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -1,4 +1,3 @@ -import sys import pytest import torch diff --git a/tests/test_preprocessing.py b/tests/test_preprocessing.py index ef56a2fc..fd4c9da5 100644 --- a/tests/test_preprocessing.py +++ b/tests/test_preprocessing.py @@ -1,4 +1,3 @@ -import sys import numpy as np import segmentation_models_pytorch as smp # noqa