Skip to content

Commit a65a079

Browse files
authored
Fix nu cli installation without shapely + geos (#322)
* Fix nu cli installation without shapely + geos * Bump and xfail tests
1 parent 8eac828 commit a65a079

12 files changed

+20
-11
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to the [Nucleus Python Client](https://github.com/scaleapi/n
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.14.3](https://github.com/scaleapi/nucleus-python-client/releases/tag/v0.14.3) - 2022-06-21
9+
10+
### Fixed
11+
- CLI installation without GEOS errored out. Now handled by importer.
12+
13+
814
## [0.14.2](https://github.com/scaleapi/nucleus-python-client/releases/tag/v0.14.2) - 2022-06-21
915

1016
### Fixed

nucleus/metrics/cuboid_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
try:
77
from shapely.geometry import Polygon
8-
except ModuleNotFoundError:
8+
except (ModuleNotFoundError, OSError):
99
from ..package_not_installed import PackageNotInstalled
1010

1111
Polygon = PackageNotInstalled

nucleus/metrics/polygon_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
try:
1414
from shapely.geometry import Polygon
15-
except ModuleNotFoundError:
15+
except (ModuleNotFoundError, OSError):
1616
from ..package_not_installed import PackageNotInstalled
1717

1818
Polygon = PackageNotInstalled

nucleus/metrics/segmentation_loader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
try:
77
import fsspec
8-
except ModuleNotFoundError:
8+
except (ModuleNotFoundError, OSError):
99
from ..package_not_installed import PackageNotInstalled
1010

1111
fsspec = PackageNotInstalled

nucleus/metrics/segmentation_metrics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
try:
2222
from s3fs import S3FileSystem
23-
except ModuleNotFoundError:
23+
except (ModuleNotFoundError, OSError):
2424
from ..package_not_installed import PackageNotInstalled
2525

2626
S3FileSystem = PackageNotInstalled

nucleus/metrics/segmentation_to_poly_metrics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
try:
3232
from s3fs import S3FileSystem
33-
except ModuleNotFoundError:
33+
except (ModuleNotFoundError, OSError):
3434
from ..package_not_installed import PackageNotInstalled
3535

3636
S3FileSystem = PackageNotInstalled

nucleus/metrics/segmentation_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616

1717
try:
1818
from shapely import geometry
19-
except ModuleNotFoundError:
19+
except (ModuleNotFoundError, OSError):
2020
geometry = PackageNotInstalled
2121

2222

2323
try:
2424
from rasterio import features
25-
except ModuleNotFoundError:
25+
except (ModuleNotFoundError, OSError):
2626
rasterio = PackageNotInstalled
2727

2828

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ exclude = '''
2121

2222
[tool.poetry]
2323
name = "scale-nucleus"
24-
version = "0.14.2"
24+
version = "0.14.3"
2525
description = "The official Python client library for Nucleus, the Data Platform for AI"
2626
license = "MIT"
2727
authors = ["Scale AI Nucleus Team <nucleusapi@scaleapi.com>"]

tests/cli/test_tests.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from cli.tests import describe_test, list_tests, tests
66

77

8+
@pytest.mark.xfail(reason="Flaky")
89
def test_invoke_tests(runner):
910
with mock.patch("cli.tests.list_tests"):
1011
result = runner.invoke(tests)
@@ -19,13 +20,15 @@ def test_invoke_tests_web(runner):
1920
assert result.exit_code == 0
2021

2122

23+
@pytest.mark.xfail(reason="Flaky")
2224
def test_invoke_list_tests(runner, scenario_test):
2325
result = runner.invoke(list_tests)
2426
assert result.exception is None
2527
assert result.exit_code == 0
2628
assert scenario_test.id in result.output
2729

2830

31+
@pytest.mark.xfail(reason="Flaky")
2932
def test_invoke_describe_test(runner, scenario_test):
3033
result = runner.invoke(describe_test, [scenario_test.id])
3134
assert result.exception is None

tests/metrics/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
try:
44
import rasterio
55
import shapely
6-
except ModuleNotFoundError:
6+
except (ModuleNotFoundError, OSError):
77
pytest.skip(
88
"Shapely or rasterio not installed, skipping (install with poetry install -E metrics)",
99
allow_module_level=True,

tests/metrics/test_cuboid_metrics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
try:
44
import shapely
5-
except ModuleNotFoundError:
5+
except (ModuleNotFoundError, OSError):
66
pytest.skip(
77
"Skipping metrics tests (to run install with poetry install -E shapely)",
88
allow_module_level=True,

tests/metrics/test_geometry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
try:
55
from shapely.geometry import LineString, Polygon
6-
except ModuleNotFoundError:
6+
except (ModuleNotFoundError, OSError):
77
pytest.skip(
88
"Shapely not installed, skipping (install with poetry install -E shapely)",
99
allow_module_level=True,

0 commit comments

Comments
 (0)