Skip to content

Commit 708d9e3

Browse files
committed
Adapt test suite to skip metrics tests if shapely not found
1 parent f50bebd commit 708d9e3

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

.circleci/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717
- run:
1818
name: Install Environment Dependencies
1919
command: | # install dependencies
20-
apt-get -y install curl
21-
pip install --upgrade pip
20+
apt-get -y install curl libgeos-dev
21+
pip install --upgrade pip
2222
pip install poetry
23-
poetry install
23+
poetry install -E metrics
2424
2525
- run:
2626
name: Black Formatting Check # Only validation, without re-formatting

tests/metrics/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import pytest
2+
3+
try:
4+
import shapely
5+
except ModuleNotFoundError:
6+
pytest.skip(
7+
"Skipping metrics tests (to run install with poetry install -E metrics)",
8+
allow_module_level=True,
9+
)

tests/metrics/test_polygon_metrics.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
from copy import deepcopy
22

3+
import pkg_resources
34
import pytest
45

56
from nucleus.metrics import PolygonIOU, PolygonPrecision, PolygonRecall
6-
from nucleus.metrics.base import Metric, MetricResult
7+
from nucleus.metrics.base import MetricResult
78
from tests.metrics.helpers import (
89
TEST_ANNOTATION_LIST,
910
TEST_BOX_ANNOTATION_LIST,

0 commit comments

Comments
 (0)