diff --git a/.github/ci/min_deps_check.py b/.github/ci/min_deps_check.py index 3a353e724..36278ff3c 100644 --- a/.github/ci/min_deps_check.py +++ b/.github/ci/min_deps_check.py @@ -60,8 +60,8 @@ def parse_requirements(fname) -> Iterator[tuple[str, int, int, int | None]]: try: version_tup = tuple(int(x) for x in version.split(".")) - except ValueError: - raise ValueError("non-numerical version: " + row) + except ValueError as e: + raise ValueError("non-numerical version: " + row) from e if len(version_tup) == 2: yield (pkg, *version_tup, None) # type: ignore[misc] diff --git a/parcels/particle.py b/parcels/particle.py index 3fbbacb30..db2feac5f 100644 --- a/parcels/particle.py +++ b/parcels/particle.py @@ -51,9 +51,9 @@ def __init__( try: dtype = np.dtype(dtype) - except (TypeError, ValueError): + except (TypeError, ValueError) as e: if dtype is not _SAME_AS_FIELDSET_TIME_INTERVAL.VALUE: - raise TypeError(f"Variable dtype must be a valid numpy dtype. Got {dtype=!r}") + raise TypeError(f"Variable dtype must be a valid numpy dtype. Got {dtype=!r}") from e if to_write not in _TO_WRITE_OPTIONS: raise ValueError(f"to_write must be one of {_TO_WRITE_OPTIONS!r}. Got {to_write=!r}") diff --git a/parcels/xgcm/grid.py b/parcels/xgcm/grid.py index 8495e0877..d4676b3c2 100644 --- a/parcels/xgcm/grid.py +++ b/parcels/xgcm/grid.py @@ -515,7 +515,7 @@ def check_neighbor(link, position): try: neighbor_link = face_links[idx][ax][correct_position] except (KeyError, IndexError): - raise KeyError( + raise KeyError( # noqa: B904 f"Couldn't find a face link for face {idx!r}in axis {ax!r} at position {correct_position!r}" ) idx_n, ax_n, rev_n = neighbor_link diff --git a/pyproject.toml b/pyproject.toml index ff2e8a315..b866c60ea 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -111,9 +111,6 @@ parcels = { path = ".", editable = true } [tool.setuptools] packages = ["parcels"] -[tool.setuptools.package-data] -parcels = ["parcels/include/*"] - [tool.setuptools_scm] write_to = "parcels/_version_setup.py" local_scheme = "no-local-version" @@ -193,15 +190,7 @@ ignore = [ "D404", # 1 blank line required between summary line and description (requires writing of summaries) "D205", - # do not use bare except, specify exception instead - "E722", "F811", - - - # TODO: These bugbear issues are to be resolved - "B011", # Do not `assert False` - "B016", # Cannot raise a literal. Did you intend to return it or raise an Exception? - "B904", # Within an `except` clause, raise exceptions ] [tool.ruff.lint.pydocstyle]