Skip to content

Commit ae9f7f2

Browse files
committed
Add COM812 to exclusions list for Ruff and make pre-commit check.
1 parent 9f45acb commit ae9f7f2

4 files changed

Lines changed: 15 additions & 10 deletions

File tree

earthaccess/store.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -298,10 +298,7 @@ def _running_in_us_west_2(self) -> bool:
298298
except Exception:
299299
return False
300300

301-
if resp.status_code == _HTTP_OK and resp.content == b"us-west-2":
302-
# On AWS, in region us-west-2
303-
return True
304-
return False
301+
return resp.status_code == _HTTP_OK and resp.content == b"us-west-2"
305302

306303
def set_requests_session(self, url: str, method: str = "get") -> None:
307304
"""Sets up a `requests` session with bearer tokens that are used by CMR.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ ignore = [
219219
"C416",
220220
"C420",
221221
"C901",
222+
"COM812",
222223
"D1",
223224
"D205",
224225
"D401",

tests/integration/test_api.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,10 +260,15 @@ def test_download_deferred_failure(tmp_path: Path):
260260
# raises a single generic Exception, passing the sequence of caught exceptions
261261
# as arguments to the Exception constructor.
262262
with pytest.raises(Exception) as exc_info:
263-
earthaccess.download(
264-
results,
265-
tmp_path,
266-
pqdm_kwargs=dict(exception_behaviour="deferred", disable=True),
263+
(
264+
(
265+
earthaccess.download(
266+
results,
267+
tmp_path,
268+
pqdm_kwargs=dict(exception_behaviour="deferred", disable=True),
269+
),
270+
)
271+
)
267272
with (
268273
patch.object(earthaccess.__store__, "_download_file", fail_to_download_file),
269274
# With "deferred" exceptions, pqdm catches all exceptions, then at the end

tests/unit/test_virtual.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ def test_virtualize_multi_granule_no_concat_dim_raises() -> None:
7474

7575
with (
7676
patch(
77-
"earthaccess.virtual.core.build_obstore_registry", return_value=MagicMock(),
77+
"earthaccess.virtual.core.build_obstore_registry",
78+
return_value=MagicMock(),
7879
),
7980
pytest.raises(ValueError, match="concat_dim"),
8081
):
@@ -121,7 +122,8 @@ def test_virtualize_load_true_delegates_to_kerchunk(tmp_path) -> None:
121122
reg_patch,
122123
open_patch,
123124
patch(
124-
"earthaccess.virtual.core._load_via_kerchunk", return_value=expected_ds,
125+
"earthaccess.virtual.core._load_via_kerchunk",
126+
return_value=expected_ds,
125127
) as mock_load,
126128
):
127129
result = virtualize(

0 commit comments

Comments
 (0)