From a33549c7fe1b506fe7b94bbb09f4ffc410c255f3 Mon Sep 17 00:00:00 2001 From: Michael Niklas Date: Fri, 25 Sep 2026 22:22:29 +0200 Subject: [PATCH 1/3] Fix failing tests, mypy and various warnings in tests (#11608) * pin numbagg to !=0.9.5 * Skip pint in mypy to avoid a recursion crash * Fix the docs build with sphinx-llm 1.1 and iris 3.16.1 * Clean up warnings in the test suite * Close the store if creating the group fails in to_netcdf * Avoid overflow in the mean of all-NaT datetime arrays * Speed up the slowest chunked interpolation tests * Update the hypothesis cache in the CI test jobs --------- Co-authored-by: Claude --- .github/workflows/ci.yaml | 20 +++++++++++++++++--- ci/requirements/environment.yml | 2 +- doc/conf.py | 12 ++++++++++++ pixi.toml | 8 ++++---- pyproject.toml | 12 ++++++++++-- xarray/backends/writers.py | 6 +++++- xarray/core/duck_array_ops.py | 5 ++++- xarray/tests/test_cftime_offsets.py | 8 +++++--- xarray/tests/test_coordinate_transform.py | 4 ++-- xarray/tests/test_dask.py | 2 ++ xarray/tests/test_dataarray.py | 7 ++++++- xarray/tests/test_duck_array_wrapping.py | 2 ++ xarray/tests/test_interp.py | 5 +++-- xarray/tests/test_variable.py | 7 ++++++- 14 files changed, 79 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 32d2d0a7937..85f74354938 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -155,15 +155,20 @@ jobs: run: | pixi run -e ${{ matrix.pixi-env }} -- python -c "import xarray" + # caches are immutable, so use a unique key per job and restore the latest cache + # https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache - name: Restore cached hypothesis directory - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: .hypothesis/ - key: cache-hypothesis + key: cache-hypothesis-${{ runner.os }}-${{ github.run_id }}-${{ github.run_attempt }}-${{ strategy.job-index }} + restore-keys: | + cache-hypothesis-${{ runner.os }}- + cache-hypothesis- enableCrossOsArchive: true - save-always: true - name: Run tests + id: tests run: | pixi run -e ${{ matrix.pixi-env }} -- python -m pytest -n ${{ matrix.numprocesses || 4 }} \ --timeout 180 \ @@ -171,6 +176,15 @@ jobs: --cov-report=xml \ --junitxml=pytest.xml + # explicitly save the cache so it gets updated, also do this even if the tests fail + - name: Save cached hypothesis directory + if: always() && steps.tests.outcome != 'skipped' + uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: .hypothesis/ + key: cache-hypothesis-${{ runner.os }}-${{ github.run_id }}-${{ github.run_attempt }}-${{ strategy.job-index }} + enableCrossOsArchive: true + - name: Upload test results if: always() uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 diff --git a/ci/requirements/environment.yml b/ci/requirements/environment.yml index dee3cc3c5e4..674b6d4ff0a 100644 --- a/ci/requirements/environment.yml +++ b/ci/requirements/environment.yml @@ -24,7 +24,7 @@ dependencies: - nc-time-axis - netcdf4 - numba - - numbagg + - numbagg!=0.9.5 - numexpr - numpy>=2.2 - opt_einsum diff --git a/doc/conf.py b/doc/conf.py index c539db8e979..6a40c4a46c8 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -177,6 +177,18 @@ # mermaid config mermaid_version = "11.6.0" +# sphinx-llm config +# the markdown builder used for llms.txt can't render these nodes; they are omitted +# from the generated markdown, so don't turn the warnings into build errors +llms_txt_suppress_unknown_node_warnings = [ + "abbreviation", + "classifier", + "desc_optional", + "label", + "mermaid", + "PassthroughTextElement", +] + # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates", sphinx_autosummary_accessors.templates_path] diff --git a/pixi.toml b/pixi.toml index 6f28f8649e5..4d5762224fa 100644 --- a/pixi.toml +++ b/pixi.toml @@ -58,7 +58,7 @@ aiobotocore = "*" [feature.numba.dependencies] numba = "*" -numbagg = "*" +numbagg = "!=0.9.5" # 0.9.5 rejects list axes passed by dask.array.nanmedian [feature.dask.dependencies] dask = "*" @@ -181,11 +181,11 @@ python = "3.12.*" kerchunk = "*" ipykernel = "*" ipywidgets = "*" # silence nbsphinx warning -iris = "!=3.16.0" # avoid ncdata failing. See https://github.com/SciTools/ncdata/issues/255 +iris = "*" ipython = "*" jupyter_client = "*" jupyter_sphinx = "*" -ncdata = "*" +ncdata = ">=0.4" # support for iris>=3.16. See https://github.com/SciTools/ncdata/issues/255 pydata-sphinx-theme = "*" pyproj = "*" rich = "*" # for Zarr tree() @@ -194,7 +194,7 @@ sphinx-autosummary-accessors = "*" sphinx-copybutton = "*" sphinx-design = "*" sphinx-inline-tabs = "*" -sphinx-llm = ">=0.2.1" +sphinx-llm = ">=1.1" # for llms_txt_suppress_unknown_node_warnings sphinx = ">=8,<9" sphinxcontrib-mermaid = "*" sphinxcontrib-srclinks = "*" diff --git a/pyproject.toml b/pyproject.toml index ed12b823885..f22ad798c5c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,8 +29,8 @@ dependencies = ["numpy>=1.26", "packaging>=24.2", "pandas>=2.2"] accel = [ "scipy>=1.15", "bottleneck", - "numbagg>=0.9", - "numba>=0.62", # numba 0.62 added support for numpy 2.3 + "numbagg>=0.9,!=0.9.5", # 0.9.5 breaks dask.array.nanmedian + "numba>=0.62", # numba 0.62 added support for numpy 2.3 "flox>=0.10", "opt_einsum", ] @@ -172,6 +172,14 @@ module = [ "array_api_strict.*", ] +# pint>=0.26's annotations send mypy into infinite recursion (segfault / RecursionError) +# when optype is installed, so don't analyse pint at all. +# Fixed upstream in https://github.com/python/mypy/pull/22036; remove this override +# once we require mypy > 2.3.1. +[[tool.mypy.overrides]] +follow_imports = "skip" +module = ["pint.*"] + # Gradually we want to add more modules to this list, ratcheting up our total # coverage. Once a module is here, functions are checked by mypy regardless of # whether they have type annotations. It would be especially useful to have test diff --git a/xarray/backends/writers.py b/xarray/backends/writers.py index 77de8aa892d..8ec34ea3104 100644 --- a/xarray/backends/writers.py +++ b/xarray/backends/writers.py @@ -429,7 +429,11 @@ def to_netcdf( auto_complex=auto_complex, ) if group is not None: - store = store.get_child_store(group) + try: + store = store.get_child_store(group) + except Exception: + store.close() + raise writer = ArrayWriter() diff --git a/xarray/core/duck_array_ops.py b/xarray/core/duck_array_ops.py index a8d640ec734..9ce39b2ba6a 100644 --- a/xarray/core/duck_array_ops.py +++ b/xarray/core/duck_array_ops.py @@ -773,8 +773,11 @@ def mean(array, axis=None, skipna=None, **kwargs): if dtypes.is_datetime_like(array.dtype): dmin = _datetime_nanreduce(array, min).astype("datetime64[Y]").astype(int) dmax = _datetime_nanreduce(array, max).astype("datetime64[Y]").astype(int) + # midpoint computed without overflowing if both are NaT (i.e. int64 min) offset = ( - np.array((dmin + dmax) // 2).astype("datetime64[Y]").astype(array.dtype) + np.array(dmin + (dmax - dmin) // 2) + .astype("datetime64[Y]") + .astype(array.dtype) ) # From version 2025.01.2 xarray uses np.datetime64[unit], where unit # is one of "s", "ms", "us", "ns". diff --git a/xarray/tests/test_cftime_offsets.py b/xarray/tests/test_cftime_offsets.py index 1adf3eabfc2..50a8ba3da3d 100644 --- a/xarray/tests/test_cftime_offsets.py +++ b/xarray/tests/test_cftime_offsets.py @@ -405,7 +405,9 @@ def test_to_cftime_datetime_error_type_error(): ] -@pytest.mark.parametrize(("a", "b"), product(_EQ_TESTS_A, _EQ_TESTS_B), ids=_id_func) +@pytest.mark.parametrize( + ("a", "b"), list(product(_EQ_TESTS_A, _EQ_TESTS_B)), ids=_id_func +) def test_neq(a, b): assert a != b @@ -432,7 +434,7 @@ def test_neq(a, b): @pytest.mark.parametrize( - ("a", "b"), zip(_EQ_TESTS_B, _EQ_TESTS_B_COPY, strict=True), ids=_id_func + ("a", "b"), list(zip(_EQ_TESTS_B, _EQ_TESTS_B_COPY, strict=True)), ids=_id_func ) def test_eq(a, b): assert a == b @@ -602,7 +604,7 @@ def test_sub_error(offset, calendar): @pytest.mark.parametrize( - ("a", "b"), zip(_EQ_TESTS_A, _EQ_TESTS_B, strict=True), ids=_id_func + ("a", "b"), list(zip(_EQ_TESTS_A, _EQ_TESTS_B, strict=True)), ids=_id_func ) def test_minus_offset(a, b): result = b - a diff --git a/xarray/tests/test_coordinate_transform.py b/xarray/tests/test_coordinate_transform.py index b1666de7c35..3477715575f 100644 --- a/xarray/tests/test_coordinate_transform.py +++ b/xarray/tests/test_coordinate_transform.py @@ -212,8 +212,8 @@ def test_coordinate_transform_align_transposed() -> None: for join in ("exact", "outer", "inner"): actual1, actual2 = xr.align(ds1, ds2, join=join) - assert actual1.dims == ds1.dims - assert actual2.dims == ds2.dims + assert actual1.sizes == ds1.sizes + assert actual2.sizes == ds2.sizes assert_identical(actual1, ds1, check_default_indexes=False) assert_identical(actual2, ds2, check_default_indexes=False) diff --git a/xarray/tests/test_dask.py b/xarray/tests/test_dask.py index 1b2b2effef3..c4aa9fb1bf9 100644 --- a/xarray/tests/test_dask.py +++ b/xarray/tests/test_dask.py @@ -1418,6 +1418,8 @@ def change_name(obj): assert_identical(actual, expected) +# filling integer variables with NaN is intentional +@pytest.mark.filterwarnings("ignore:invalid value encountered in cast") @pytest.mark.parametrize("obj", [make_da(), make_ds()]) def test_map_blocks_kwargs(obj): expected = xr.full_like(obj, fill_value=np.nan) diff --git a/xarray/tests/test_dataarray.py b/xarray/tests/test_dataarray.py index f94d221a758..c0d4ec468e1 100644 --- a/xarray/tests/test_dataarray.py +++ b/xarray/tests/test_dataarray.py @@ -3212,7 +3212,12 @@ def test_reduce_out(self) -> None: @pytest.mark.parametrize("q", [0.25, [0.50], [0.25, 0.75]]) @pytest.mark.parametrize( "axis, dim", - zip([None, 0, [0], [0, 1]], [None, "x", ["x"], ["x", "y"]], strict=True), + [ + pytest.param(None, None, id="none"), + pytest.param(0, "x", id="x"), + pytest.param([0], ["x"], id="list-x"), + pytest.param([0, 1], ["x", "y"], id="list-x-y"), + ], ) def test_quantile(self, q, axis, dim, skipna, compute_backend) -> None: va = self.va.copy(deep=True) diff --git a/xarray/tests/test_duck_array_wrapping.py b/xarray/tests/test_duck_array_wrapping.py index 010127a6659..a3089364055 100644 --- a/xarray/tests/test_duck_array_wrapping.py +++ b/xarray/tests/test_duck_array_wrapping.py @@ -455,6 +455,8 @@ def test_argsort(self): result = self.x.argsort() assert isinstance(result.data, self.Array) + # only checks the array type, the data contains NaN + @pytest.mark.filterwarnings("ignore:invalid value encountered in cast") def test_astype(self): result = self.x.astype(int) assert isinstance(result.data, self.Array) diff --git a/xarray/tests/test_interp.py b/xarray/tests/test_interp.py index 7393eb3fcbb..085579f8ee2 100644 --- a/xarray/tests/test_interp.py +++ b/xarray/tests/test_interp.py @@ -950,7 +950,7 @@ def test_interpolate_chunk_1d( dest[dim] = cast( xr.DataArray, np.linspace( - before.item(), after.item(), len(da.coords[dim]) * 13 + before.item(), after.item(), len(da.coords[dim]) * 5 ), ) if chunked: @@ -1008,7 +1008,8 @@ def test_interpolate_chunk_advanced(method: InterpOptions) -> None: kwargs = {"fill_value": None} expected = da.interp(t=0.5, x=xda, y=yda, z=zda, kwargs=kwargs, method=method) - da = da.chunk(2) + # multiple chunks along every dimension, while keeping the task graph small + da = da.chunk(4) xda = xda.chunk(1) zda = zda.chunk(3) actual = da.interp(t=0.5, x=xda, y=yda, z=zda, kwargs=kwargs, method=method) diff --git a/xarray/tests/test_variable.py b/xarray/tests/test_variable.py index 1190d35613b..789aa99f16f 100644 --- a/xarray/tests/test_variable.py +++ b/xarray/tests/test_variable.py @@ -1921,7 +1921,12 @@ def raise_if_called(*args, **kwargs): @pytest.mark.parametrize("q", [0.25, [0.50], [0.25, 0.75]]) @pytest.mark.parametrize( "axis, dim", - zip([None, 0, [0], [0, 1]], [None, "x", ["x"], ["x", "y"]], strict=True), + [ + pytest.param(None, None, id="none"), + pytest.param(0, "x", id="x"), + pytest.param([0], ["x"], id="list-x"), + pytest.param([0, 1], ["x", "y"], id="list-x-y"), + ], ) def test_quantile(self, q, axis, dim, skipna): d = self.d.copy() From 6e135c993442bd8bb1fa5f751480f4a9e5537c22 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 25 Sep 2026 21:24:13 +0000 Subject: [PATCH 2/3] Update pre-commit hooks (#11499) Co-authored-by: Justus Magin Co-authored-by: Deepak Cherian --- .pre-commit-config.yaml | 12 ++-- ci/numpydoc-public-api.py | 0 ci/recipe/prepare_recipe.py | 0 pyproject.toml | 7 ++ xarray/backends/api.py | 2 +- xarray/backends/file_manager.py | 6 +- xarray/backends/locks.py | 2 +- xarray/backends/store.py | 4 -- xarray/backends/writers.py | 2 +- xarray/coding/strings.py | 2 +- xarray/coding/times.py | 2 +- xarray/core/dataarray.py | 4 +- xarray/core/dataset.py | 2 +- xarray/core/datatree.py | 4 +- xarray/core/datatree_mapping.py | 2 +- xarray/core/indexing.py | 6 +- xarray/structure/combine.py | 6 +- xarray/tests/test_backends.py | 104 ++++++++++++++++-------------- xarray/tests/test_coding_times.py | 2 +- xarray/tests/test_concat.py | 4 +- xarray/tests/test_conventions.py | 6 +- xarray/tests/test_dataarray.py | 43 ++++++------ xarray/tests/test_dataset.py | 20 +++--- xarray/tests/test_plot.py | 22 +++---- xarray/tests/test_variable.py | 4 +- 25 files changed, 141 insertions(+), 127 deletions(-) mode change 100644 => 100755 ci/numpydoc-public-api.py mode change 100644 => 100755 ci/recipe/prepare_recipe.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 679ac50e641..9caa6ea1f7b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: - id: rst-inline-touching-normal - id: text-unicode-replacement-char - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.20 + rev: v0.16.6 hooks: - id: ruff-check args: ["--fix", "--show-fixes"] @@ -37,12 +37,12 @@ repos: # make sure this is the most recent version of black additional_dependencies: ["black==25.11.0"] - repo: https://github.com/rbubley/mirrors-prettier - rev: v3.9.4 + rev: v3.9.6 hooks: - id: prettier args: ["--cache-location=.prettier_cache/cache"] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v2.1.0 + rev: v2.3.1 hooks: - id: mypy # Copied from setup.cfg @@ -71,16 +71,16 @@ repos: - id: taplo-lint args: ["--no-schema"] - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.25 + rev: "0.26" hooks: - id: validate-pyproject additional_dependencies: ["validate-pyproject-schema-store[all]"] - repo: https://github.com/adhtruong/mirrors-typos - rev: v1.48.0 + rev: v1.50.1 hooks: - id: typos - repo: https://github.com/zizmorcore/zizmor-pre-commit - rev: v1.26.1 + rev: v1.30.0 hooks: - id: zizmor args: ["--offline"] diff --git a/ci/numpydoc-public-api.py b/ci/numpydoc-public-api.py old mode 100644 new mode 100755 diff --git a/ci/recipe/prepare_recipe.py b/ci/recipe/prepare_recipe.py old mode 100644 new mode 100755 diff --git a/pyproject.toml b/pyproject.toml index f22ad798c5c..40f12b8ec20 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -298,6 +298,13 @@ ignore = [ "RUF003", # comment contains ambiguous no-break space unicode character "RUF005", # consider unpacking operator instead of concatenation "RUF012", # mutable class attributes + # rules added to the default set in ruff 0.16 + "BLE001", # blind `except Exception`: used on purpose, e.g. in print_versions + "DTZ001", # `datetime()` without `tzinfo`: xarray works with naive datetimes + "N999", # invalid module name: `netCDF4_` + "S110", # `try`-`except`-`pass` + "TRY002", # raising vanilla `Exception` + "TRY004", # prefer `TypeError`: switching would change the raised exceptions ] [tool.ruff.lint.per-file-ignores] diff --git a/xarray/backends/api.py b/xarray/backends/api.py index 4330eb21cc6..743890675b3 100644 --- a/xarray/backends/api.py +++ b/xarray/backends/api.py @@ -1400,7 +1400,7 @@ def open_mfdataset( preprocess: Callable[[Dataset], Dataset] | None = None, engine: T_Engine = None, data_vars: ( - Literal["all", "minimal", "different"] | None | list[str] | CombineKwargDefault + Literal["all", "minimal", "different"] | list[str] | CombineKwargDefault | None ) = _DATA_VARS_DEFAULT, coords=_COORDS_DEFAULT, combine: Literal["by_coords", "nested"] = "by_coords", diff --git a/xarray/backends/file_manager.py b/xarray/backends/file_manager.py index e6f94f93668..ec31b8aa04b 100644 --- a/xarray/backends/file_manager.py +++ b/xarray/backends/file_manager.py @@ -89,7 +89,7 @@ def __init__( *args: Any, mode: Any = _OMIT_MODE, kwargs: Mapping[str, Any] | None = None, - lock: Lock | None | Literal[False] = None, + lock: Lock | Literal[False] | None = None, cache: MutableMapping[Any, T_File] | None = None, manager_id: Hashable | None = None, ref_counts: dict[Any, int] | None = None, @@ -355,7 +355,7 @@ def __init__( opener: Callable[..., T_File], *args: Any, mode: Any = _OMIT_MODE, - lock: Lock | None | Literal[False] = None, + lock: Lock | Literal[False] | None = None, kwargs: Mapping[str, Any] | None = None, ): kwargs = {} if kwargs is None else dict(kwargs) @@ -458,7 +458,7 @@ def __init__( value: T_File, *, close: Callable[[], None] | None = None, - lock: Lock | None | Literal[False] = None, + lock: Lock | Literal[False] | None = None, ): if close is None: close = value.close diff --git a/xarray/backends/locks.py b/xarray/backends/locks.py index 2b84f932843..1c6d673cdad 100644 --- a/xarray/backends/locks.py +++ b/xarray/backends/locks.py @@ -276,7 +276,7 @@ def combine_locks(locks: Sequence[Lock]) -> Lock: return DummyLock() -def ensure_lock(lock: Lock | None | Literal[False]) -> Lock: +def ensure_lock(lock: Lock | Literal[False] | None) -> Lock: """Ensure that the given object is a lock.""" if lock is None or lock is False: return DummyLock() diff --git a/xarray/backends/store.py b/xarray/backends/store.py index 2c3cd42ae92..3f3bdcd277b 100644 --- a/xarray/backends/store.py +++ b/xarray/backends/store.py @@ -1,7 +1,6 @@ from __future__ import annotations from collections.abc import Iterable -from typing import TYPE_CHECKING from xarray import conventions from xarray.backends.common import ( @@ -13,9 +12,6 @@ from xarray.core.coordinates import Coordinates from xarray.core.dataset import Dataset -if TYPE_CHECKING: - pass - class StoreBackendEntrypoint(BackendEntrypoint): description = "Open AbstractDataStore instances in Xarray" diff --git a/xarray/backends/writers.py b/xarray/backends/writers.py index 8ec34ea3104..71ad98b9126 100644 --- a/xarray/backends/writers.py +++ b/xarray/backends/writers.py @@ -805,7 +805,7 @@ def _datatree_to_netcdf( compute: bool = True, invalid_netcdf: bool = False, auto_complex: bool | None = None, -) -> None | memoryview | Delayed: +) -> memoryview | Delayed | None: """Implementation of `DataTree.to_netcdf`.""" if format not in [None, *get_args(T_DataTreeNetcdfTypes)]: diff --git a/xarray/coding/strings.py b/xarray/coding/strings.py index 0869b3072b3..dfa02929e79 100644 --- a/xarray/coding/strings.py +++ b/xarray/coding/strings.py @@ -60,7 +60,7 @@ def encode(self, variable: Variable, name=None) -> Variable: # which all backends support natively (GH11199) if data.dtype.kind == "T": data = np.asarray(data, dtype=object) - data[data == None] = "" # noqa: E711 + data[data == None] = "" data = np.asarray(data, dtype="U") variable = Variable(dims, data, attrs, encoding) diff --git a/xarray/coding/times.py b/xarray/coding/times.py index 6298a9a92bd..8d89c347722 100644 --- a/xarray/coding/times.py +++ b/xarray/coding/times.py @@ -976,7 +976,7 @@ def _encode_datetime_with_cftime(dates, units: str, calendar: str) -> np.ndarray dates = np.atleast_1d(dates) # Find all the None position - none_position = dates == None # noqa: E711 + none_position = dates == None filtered_dates = dates[~none_position] # Since netCDF files do not support storing float128 values, we ensure diff --git a/xarray/core/dataarray.py b/xarray/core/dataarray.py index dfcbb6e18cd..8af786e1e56 100644 --- a/xarray/core/dataarray.py +++ b/xarray/core/dataarray.py @@ -3677,13 +3677,13 @@ def interpolate_na( limit: int | None = None, use_coordinate: bool | str = True, max_gap: ( - None - | int + int | float | str | pd.Timedelta | np.timedelta64 | datetime.timedelta + | None ) = None, keep_attrs: bool | None = None, **kwargs: Any, diff --git a/xarray/core/dataset.py b/xarray/core/dataset.py index 75fa6f8abeb..23b5e14d733 100644 --- a/xarray/core/dataset.py +++ b/xarray/core/dataset.py @@ -1491,7 +1491,7 @@ def __setitem__( f" been successfully updated:\n{processed}" ) from e else: - raise e + raise elif utils.hashable(key): if isinstance(value, Dataset): diff --git a/xarray/core/datatree.py b/xarray/core/datatree.py index 98934f29b92..1d75c887584 100644 --- a/xarray/core/datatree.py +++ b/xarray/core/datatree.py @@ -1811,7 +1811,7 @@ def map_over_datasets( def map_over_datasets( self, - func: Callable[..., Dataset | None | tuple[Dataset | None, ...]], + func: Callable[..., Dataset | tuple[Dataset | None, ...] | None], *args: Any, kwargs: Mapping[str, Any] | None = None, ) -> DataTree | tuple[DataTree, ...]: @@ -2034,7 +2034,7 @@ def to_netcdf( write_inherited_coords: bool = False, compute: bool = True, **kwargs, - ) -> None | memoryview | Delayed: + ) -> memoryview | Delayed | None: """ Write datatree contents to a netCDF file. diff --git a/xarray/core/datatree_mapping.py b/xarray/core/datatree_mapping.py index 2bed7c8f1ca..04741aa72ad 100644 --- a/xarray/core/datatree_mapping.py +++ b/xarray/core/datatree_mapping.py @@ -39,7 +39,7 @@ def map_over_datasets( def map_over_datasets( - func: Callable[..., Dataset | None | tuple[Dataset | None, ...]], + func: Callable[..., Dataset | tuple[Dataset | None, ...] | None], *args: Any, kwargs: Mapping[str, Any] | None = None, ) -> DataTree | tuple[DataTree, ...]: diff --git a/xarray/core/indexing.py b/xarray/core/indexing.py index 3001b3392cc..a96b102f928 100644 --- a/xarray/core/indexing.py +++ b/xarray/core/indexing.py @@ -1732,7 +1732,7 @@ def _safe_setitem(self, array, key: tuple[Any, ...], value: Any) -> None: "Do you want to .copy() array first?" ) from exc else: - raise exc + raise def _oindex_set(self, indexer: OuterIndexer, value: Any) -> None: key = _outer_to_numpy_indexer(indexer, self.array.shape) @@ -1850,7 +1850,7 @@ def _oindex_get(self, indexer: OuterIndexer): def _vindex_get(self, indexer: VectorizedIndexer): try: return self.array.vindex[indexer.tuple] - except IndexError as e: + except IndexError: # TODO: upstream to dask has_dask = any(is_duck_dask_array(i) for i in indexer.tuple) # this only works for "small" 1d coordinate arrays with one chunk @@ -1862,7 +1862,7 @@ def _vindex_get(self, indexer: VectorizedIndexer): or math.prod(self.array.numblocks) > 1 or self.array.ndim > 1 ): - raise e + raise (idxr,) = indexer.tuple if idxr.ndim == 0: return self.array[idxr.data] diff --git a/xarray/structure/combine.py b/xarray/structure/combine.py index 6699b32d8fa..6043cf9fcc7 100644 --- a/xarray/structure/combine.py +++ b/xarray/structure/combine.py @@ -356,7 +356,7 @@ def _combine_1d( "If you are intending to concatenate datasets, please specify the concatenation dimension explicitly. " "Using merge to concatenate is quite inefficient." ) - raise e + raise return combined @@ -799,9 +799,9 @@ def combine_by_coords( data_objects: Iterable[Dataset | DataArray] = [], compat: CompatOptions | CombineKwargDefault = _COMPAT_DEFAULT, data_vars: Literal["all", "minimal", "different"] - | None | list[str] - | CombineKwargDefault = _DATA_VARS_DEFAULT, + | CombineKwargDefault + | None = _DATA_VARS_DEFAULT, coords: str | CombineKwargDefault = _COORDS_DEFAULT, fill_value: object = dtypes.NA, join: JoinOptions | CombineKwargDefault = _JOIN_DEFAULT, diff --git a/xarray/tests/test_backends.py b/xarray/tests/test_backends.py index a0b93abf671..a56d024bdb6 100644 --- a/xarray/tests/test_backends.py +++ b/xarray/tests/test_backends.py @@ -835,7 +835,7 @@ def test_roundtrip_global_coordinates(self) -> None: original.attrs["coordinates"] = "foo" with pytest.warns(SerializationWarning): _, attrs = encode_dataset_coordinates(original) - assert attrs["coordinates"] == "foo" + assert attrs["coordinates"] == "foo" def test_roundtrip_coordinates_with_space(self) -> None: original = Dataset(coords={"x": 0, "y z": 1}) @@ -2860,9 +2860,9 @@ def test_warning_on_bad_chunks(self) -> None: kwargs = {"chunks": chunks} with pytest.warns(UserWarning): with self.roundtrip(original, open_kwargs=kwargs) as actual: - for k, v in actual.variables.items(): - # only index variables should be in memory - assert v._in_memory == (k in actual.dims) + in_memory = {k: v._in_memory for k, v in actual.variables.items()} + # only index variables should be in memory + assert in_memory == {k: k in actual.dims for k in actual.variables} good_chunks: tuple[dict[str, Any], ...] = ({"dim2": 3}, {"dim3": (6, 4)}, {}) for chunks in good_chunks: @@ -3424,42 +3424,44 @@ def test_to_zarr_compute_false_roundtrip(self) -> None: assert_identical(original, actual) @requires_dask + # whether appending also warns about the object dtype depends on the zarr format + @pytest.mark.filterwarnings( + "ignore:variable None has data in the form of a dask array with dtype=object" + ) def test_to_zarr_append_compute_false_roundtrip(self) -> None: from dask.delayed import Delayed ds, ds_to_append, _ = create_append_test_data() ds, ds_to_append = ds.chunk(), ds_to_append.chunk() - with pytest.warns(SerializationWarning): - with self.create_zarr_target() as store: + with self.create_zarr_target() as store: + with pytest.warns(SerializationWarning): delayed_obj = self.save(ds, store, compute=False, mode="w") - assert isinstance(delayed_obj, Delayed) - - with pytest.raises(AssertionError): - with self.open(store) as actual: - assert_identical(ds, actual) - - delayed_obj.compute() + assert isinstance(delayed_obj, Delayed) + with pytest.raises(AssertionError): with self.open(store) as actual: assert_identical(ds, actual) - delayed_obj = self.save( - ds_to_append, store, compute=False, append_dim="time" - ) - assert isinstance(delayed_obj, Delayed) + delayed_obj.compute() - with pytest.raises(AssertionError): - with self.open(store) as actual: - assert_identical( - xr.concat([ds, ds_to_append], dim="time"), actual - ) + with self.open(store) as actual: + assert_identical(ds, actual) - delayed_obj.compute() + delayed_obj = self.save( + ds_to_append, store, compute=False, append_dim="time" + ) + assert isinstance(delayed_obj, Delayed) + with pytest.raises(AssertionError): with self.open(store) as actual: assert_identical(xr.concat([ds, ds_to_append], dim="time"), actual) + delayed_obj.compute() + + with self.open(store) as actual: + assert_identical(xr.concat([ds, ds_to_append], dim="time"), actual) + @pytest.mark.parametrize("chunk", [False, True]) def test_save_emptydim(self, chunk) -> None: if chunk and not has_dask: @@ -5017,8 +5019,8 @@ def test_decode_utf8_warning(self) -> None: f.title = title with pytest.warns(UnicodeWarning, match="returning bytes undecoded") as w: ds = xr.load_dataset(tmp_file, engine="h5netcdf") - assert ds.title == title - assert "attribute 'title' of h5netcdf object '/'" in str(w[0].message) + assert ds.title == title + assert "attribute 'title' of h5netcdf object '/'" in str(w[0].message) def test_byte_attrs(self, byte_attrs_dataset: dict[str, Any]) -> None: with pytest.raises(ValueError, match=byte_attrs_dataset["h5netcdf_error"]): @@ -5785,10 +5787,11 @@ def test_open_mfdataset_warns_when_kwargs_set_to_different( FutureWarning, match="will change from compat='no_conflicts'" ): with expectation: - with open_mfdataset( + ds = open_mfdataset( files, combine=combine, concat_dim=concat_dim, **kwargs - ) as ds: - assert_identical(ds, ds_expect) + ) + with ds: + assert_identical(ds, ds_expect) @requires_dask @@ -5972,19 +5975,20 @@ def test_open_mfdataset_with_ignore(self) -> None: def test_open_mfdataset_with_warn(self) -> None: original = Dataset({"foo": ("x", np.random.randn(10))}) - with pytest.warns(UserWarning, match=r"Ignoring."): - with create_tmp_files(2) as (tmp1, tmp2): - ds1 = original.isel(x=slice(5)) - ds2 = original.isel(x=slice(5, 10)) - ds1.to_netcdf(tmp1) - ds2.to_netcdf(tmp2) - with open_mfdataset( + with create_tmp_files(2) as (tmp1, tmp2): + ds1 = original.isel(x=slice(5)) + ds2 = original.isel(x=slice(5, 10)) + ds1.to_netcdf(tmp1) + ds2.to_netcdf(tmp2) + with pytest.warns(UserWarning, match=r"Ignoring."): + actual = open_mfdataset( [tmp1, "non-existent-file.nc", tmp2], concat_dim="x", combine="nested", errors="warn", - ) as actual: - assert_identical(original, actual) + ) + with actual: + assert_identical(original, actual) def test_open_mfdataset_2d_with_ignore(self) -> None: original = Dataset({"foo": (["x", "y"], np.random.randn(10, 8))}) @@ -6003,19 +6007,20 @@ def test_open_mfdataset_2d_with_ignore(self) -> None: def test_open_mfdataset_2d_with_warn(self) -> None: original = Dataset({"foo": (["x", "y"], np.random.randn(10, 8))}) - with pytest.warns(UserWarning, match=r"Ignoring."): - with create_tmp_files(4) as (tmp1, tmp2, tmp3, tmp4): - original.isel(x=slice(5), y=slice(4)).to_netcdf(tmp1) - original.isel(x=slice(5, 10), y=slice(4)).to_netcdf(tmp2) - original.isel(x=slice(5), y=slice(4, 8)).to_netcdf(tmp3) - original.isel(x=slice(5, 10), y=slice(4, 8)).to_netcdf(tmp4) - with open_mfdataset( + with create_tmp_files(4) as (tmp1, tmp2, tmp3, tmp4): + original.isel(x=slice(5), y=slice(4)).to_netcdf(tmp1) + original.isel(x=slice(5, 10), y=slice(4)).to_netcdf(tmp2) + original.isel(x=slice(5), y=slice(4, 8)).to_netcdf(tmp3) + original.isel(x=slice(5, 10), y=slice(4, 8)).to_netcdf(tmp4) + with pytest.warns(UserWarning, match=r"Ignoring."): + actual = open_mfdataset( [[tmp1, tmp2, "non-existent-file.nc"], [tmp3, tmp4]], combine="nested", concat_dim=["y", "x"], errors="warn", - ) as actual: - assert_identical(original, actual) + ) + with actual: + assert_identical(original, actual) def test_attrs_mfdataset(self) -> None: original = Dataset({"foo": ("x", np.random.randn(10))}) @@ -6985,9 +6990,10 @@ def test_use_cftime_standard_calendar_default_out_of_range(calendar) -> None: with create_tmp_file() as tmp_file: original.to_netcdf(tmp_file) with pytest.warns(SerializationWarning): - with open_dataset(tmp_file) as ds: - assert_identical(expected_x, ds.x) - assert_identical(expected_time, ds.time) + ds = open_dataset(tmp_file) + with ds: + assert_identical(expected_x, ds.x) + assert_identical(expected_time, ds.time) @requires_cftime diff --git a/xarray/tests/test_coding_times.py b/xarray/tests/test_coding_times.py index b6d58df18ad..298154ea131 100644 --- a/xarray/tests/test_coding_times.py +++ b/xarray/tests/test_coding_times.py @@ -976,7 +976,7 @@ def test_use_cftime_default_standard_calendar_out_of_range( with pytest.warns(SerializationWarning): result = decode_cf_datetime(numerical_dates, units, calendar) - np.testing.assert_array_equal(result, expected) + np.testing.assert_array_equal(result, expected) @requires_cftime diff --git a/xarray/tests/test_concat.py b/xarray/tests/test_concat.py index bc98d72d50c..8bbf5df63eb 100644 --- a/xarray/tests/test_concat.py +++ b/xarray/tests/test_concat.py @@ -1507,7 +1507,7 @@ def test_concat_second_empty_with_scalar_data_var_only_on_first(self) -> None: actual = concat( [ds1, ds2], dim="y", coords="different", data_vars="different" ) - assert_identical(actual, expected) + assert_identical(actual, expected) with set_options(use_new_combine_kwarg_defaults=True): with pytest.raises(ValueError, match="might be related to new default"): concat([ds1, ds2], dim="y", coords="different", data_vars="different") @@ -1577,7 +1577,7 @@ def test_concat_promote_shape_for_scalars_with_mixed_lengths_along_concat_dim( match="will change from coords='different' to coords='minimal'", ): old = concat(objs, "x") - assert_identical(old, expected) + assert_identical(old, expected) with set_options(use_new_combine_kwarg_defaults=True): new = concat(objs, "x") with pytest.raises(AssertionError): diff --git a/xarray/tests/test_conventions.py b/xarray/tests/test_conventions.py index a0aac08c918..709eda4eb1e 100644 --- a/xarray/tests/test_conventions.py +++ b/xarray/tests/test_conventions.py @@ -85,7 +85,7 @@ def test_decode_cf_with_conflicting_fill_missing_value() -> None: ) with pytest.warns(SerializationWarning, match="has multiple fill"): actual = conventions.decode_cf_variable("t", var) - assert_identical(actual, expected) + assert_identical(actual, expected) expected = Variable(["t"], np.arange(10), {"units": "foobar"}) @@ -434,7 +434,7 @@ def test_decode_coordinates_with_key_values(self) -> None: _vars, _attrs, coords = conventions.decode_cf_variables( original.variables, {}, decode_coords="all" ) - assert coords == {"lat", "lon", "crs", "crs2"} + assert coords == {"lat", "lon", "crs", "crs2"} def test_0d_int32_encoding(self) -> None: original = Variable((), np.int32(0), encoding={"dtype": "int64"}) @@ -447,7 +447,7 @@ def test_decode_cf_with_multiple_missing_values(self) -> None: expected = Variable(["t"], [np.nan, np.nan, 2], {}) with pytest.warns(SerializationWarning, match="has multiple fill"): actual = conventions.decode_cf_variable("t", original) - assert_identical(expected, actual) + assert_identical(expected, actual) def test_decode_cf_with_drop_variables(self) -> None: original = Dataset( diff --git a/xarray/tests/test_dataarray.py b/xarray/tests/test_dataarray.py index c0d4ec468e1..55c1b1f1fab 100644 --- a/xarray/tests/test_dataarray.py +++ b/xarray/tests/test_dataarray.py @@ -967,15 +967,16 @@ def test_chunk(self) -> None: with pytest.warns(FutureWarning): blocked = unblocked.chunk(chunks=((2, 1), (2, 2))) # type: ignore[arg-type] - assert blocked.chunks == ((2, 1), (2, 2)) - assert blocked.data.name != first_dask_name + assert blocked.chunks == ((2, 1), (2, 2)) + assert blocked.data.name != first_dask_name + with pytest.warns(FutureWarning): blocked = unblocked.chunk(chunks=(3, 3)) - assert blocked.chunks == ((3,), (3, 1)) - assert blocked.data.name != first_dask_name + assert blocked.chunks == ((3,), (3, 1)) + assert blocked.data.name != first_dask_name - with pytest.raises(ValueError): - blocked.chunk(chunks=(3, 3, 3)) + with pytest.raises(ValueError), pytest.warns(FutureWarning): + blocked.chunk(chunks=(3, 3, 3)) # name doesn't change when rechunking by same amount # this fails if ReprObject doesn't have __dask_tokenize__ defined @@ -1516,7 +1517,7 @@ def test_concat_with_default_coords_warns(self) -> None: with pytest.warns(FutureWarning): original = xr.concat([da, db], dim="x") - assert original.y.size == 4 + assert original.y.size == 4 with set_options(use_new_combine_kwarg_defaults=True): # default compat="override" will pick the first one new = xr.concat([da, db], dim="x") @@ -6696,7 +6697,7 @@ def test_argmin_dim( minindices_x = { key: xr.where( - nanindices_x[key] == None, # noqa: E711 + nanindices_x[key] == None, minindices_x[key], nanindices_x[key], ) @@ -6714,7 +6715,7 @@ def test_argmin_dim( minindices_y = { key: xr.where( - nanindices_y[key] == None, # noqa: E711 + nanindices_y[key] == None, minindices_y[key], nanindices_y[key], ) @@ -6732,7 +6733,7 @@ def test_argmin_dim( minindices_z = { key: xr.where( - nanindices_z[key] == None, # noqa: E711 + nanindices_z[key] == None, minindices_z[key], nanindices_z[key], ) @@ -6750,7 +6751,7 @@ def test_argmin_dim( minindices_xy = { key: xr.where( - nanindices_xy[key] == None, # noqa: E711 + nanindices_xy[key] == None, minindices_xy[key], nanindices_xy[key], ) @@ -6768,7 +6769,7 @@ def test_argmin_dim( minindices_xz = { key: xr.where( - nanindices_xz[key] == None, # noqa: E711 + nanindices_xz[key] == None, minindices_xz[key], nanindices_xz[key], ) @@ -6786,7 +6787,7 @@ def test_argmin_dim( minindices_yz = { key: xr.where( - nanindices_yz[key] == None, # noqa: E711 + nanindices_yz[key] == None, minindices_yz[key], nanindices_yz[key], ) @@ -6804,7 +6805,7 @@ def test_argmin_dim( minindices_xyz = { key: xr.where( - nanindices_xyz[key] == None, # noqa: E711 + nanindices_xyz[key] == None, minindices_xyz[key], nanindices_xyz[key], ) @@ -6935,7 +6936,7 @@ def test_argmax_dim( maxindices_x = { key: xr.where( - nanindices_x[key] == None, # noqa: E711 + nanindices_x[key] == None, maxindices_x[key], nanindices_x[key], ) @@ -6953,7 +6954,7 @@ def test_argmax_dim( maxindices_y = { key: xr.where( - nanindices_y[key] == None, # noqa: E711 + nanindices_y[key] == None, maxindices_y[key], nanindices_y[key], ) @@ -6971,7 +6972,7 @@ def test_argmax_dim( maxindices_z = { key: xr.where( - nanindices_z[key] == None, # noqa: E711 + nanindices_z[key] == None, maxindices_z[key], nanindices_z[key], ) @@ -6989,7 +6990,7 @@ def test_argmax_dim( maxindices_xy = { key: xr.where( - nanindices_xy[key] == None, # noqa: E711 + nanindices_xy[key] == None, maxindices_xy[key], nanindices_xy[key], ) @@ -7007,7 +7008,7 @@ def test_argmax_dim( maxindices_xz = { key: xr.where( - nanindices_xz[key] == None, # noqa: E711 + nanindices_xz[key] == None, maxindices_xz[key], nanindices_xz[key], ) @@ -7025,7 +7026,7 @@ def test_argmax_dim( maxindices_yz = { key: xr.where( - nanindices_yz[key] == None, # noqa: E711 + nanindices_yz[key] == None, maxindices_yz[key], nanindices_yz[key], ) @@ -7043,7 +7044,7 @@ def test_argmax_dim( maxindices_xyz = { key: xr.where( - nanindices_xyz[key] == None, # noqa: E711 + nanindices_xyz[key] == None, maxindices_xyz[key], nanindices_xyz[key], ) diff --git a/xarray/tests/test_dataset.py b/xarray/tests/test_dataset.py index 883a6dc89b7..3c4c9edcb34 100644 --- a/xarray/tests/test_dataset.py +++ b/xarray/tests/test_dataset.py @@ -639,13 +639,17 @@ def test_constructor_with_coords(self) -> None: mindex = pd.MultiIndex.from_product( [["a", "b"], [1, 2]], names=("level_1", "level_2") ) - with pytest.raises(ValueError, match=r"conflicting MultiIndex"): - with pytest.warns( - FutureWarning, - match=r".*`pandas.MultiIndex`.*no longer be implicitly promoted.*", - ): - Dataset({}, {"x": mindex, "y": mindex}) - Dataset({}, {"x": mindex, "level_1": range(4)}) + conflicting_coords: list[dict[str, Any]] = [ + {"x": mindex, "y": mindex}, + {"x": mindex, "level_1": range(4)}, + ] + for coords in conflicting_coords: + with pytest.raises(ValueError, match=r"conflicting MultiIndex"): + with pytest.warns( + FutureWarning, + match=r".*`pandas.MultiIndex`.*no longer be implicitly promoted.*", + ): + Dataset({}, coords) def test_constructor_no_default_index(self) -> None: # explicitly passing a Coordinates object skips the creation of default index @@ -6916,7 +6920,7 @@ def test_dataset_transpose(self) -> None: # test missing dimension, raise warning with pytest.warns(UserWarning): actual = ds.transpose(..., "not_a_dim", missing_dims="warn") - assert_identical(expected_ell, actual) + assert_identical(expected_ell, actual) assert "T" not in dir(ds) diff --git a/xarray/tests/test_plot.py b/xarray/tests/test_plot.py index d1531c16d8a..87ca6610e42 100644 --- a/xarray/tests/test_plot.py +++ b/xarray/tests/test_plot.py @@ -1696,7 +1696,7 @@ def test_convenient_facetgrid_4d(self) -> None: def test_facetgrid_col_wrap_auto( self, n: int, - figsize: None | tuple[int, int], + figsize: tuple[int, int] | None, aspect: int, expected_shape: tuple[int, int], ) -> None: @@ -3496,16 +3496,16 @@ def test_plot_empty_raises(val: list | float, method: str) -> None: @requires_matplotlib def test_facetgrid_axes_raises_deprecation_warning() -> None: - with pytest.warns( - FutureWarning, - match=( - "self.axes is deprecated since 2022.11 in order to align with " - "matplotlibs plt.subplots, use self.axs instead." - ), - ): - with figure_context(): - ds = xr.tutorial.scatter_example_dataset() - g = ds.plot.scatter(x="A", y="B", col="x") + with figure_context(): + ds = xr.tutorial.scatter_example_dataset() + g = ds.plot.scatter(x="A", y="B", col="x") + with pytest.warns( + FutureWarning, + match=( + "self.axes is deprecated since 2022.11 in order to align with " + "matplotlibs plt.subplots, use self.axs instead." + ), + ): _ = g.axes diff --git a/xarray/tests/test_variable.py b/xarray/tests/test_variable.py index 789aa99f16f..26fba9fcc7d 100644 --- a/xarray/tests/test_variable.py +++ b/xarray/tests/test_variable.py @@ -1599,8 +1599,8 @@ def test_transpose(self): # test missing dimension, raise warning with pytest.warns(UserWarning): - v.transpose(..., "not_a_dim", missing_dims="warn") - assert_identical(expected_ell, actual) + actual = v.transpose(..., "not_a_dim", missing_dims="warn") + assert_identical(expected_ell, actual) def test_transpose_0d(self): for value in [ From a2dc5dcd5df630014ea095a64412e036fee6f2d9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 25 Sep 2026 21:29:03 +0000 Subject: [PATCH 3/3] Bump the actions group across 1 directory with 4 updates (#11604) Bumps the actions group with 4 updates in the / directory: [WyriHaximus/github-action-get-previous-tag](https://github.com/wyrihaximus/github-action-get-previous-tag), [codecov/codecov-action](https://github.com/codecov/codecov-action), [zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action) and [scientific-python/upload-nightly-action](https://github.com/scientific-python/upload-nightly-action). Updates `WyriHaximus/github-action-get-previous-tag` from 2.0.0 to 2.1.0 - [Release notes](https://github.com/wyrihaximus/github-action-get-previous-tag/releases) - [Commits](https://github.com/wyrihaximus/github-action-get-previous-tag/compare/61819f33034117e6c686e6a31dba995a85afc9de...83f26fea93bc7efcbca2eb5591f5eaaf66b8f206) Updates `codecov/codecov-action` from 7.0.0 to 7.1.1 - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/fb8b3582c8e4def4969c97caa2f19720cb33a72f...303a32d7a59b442fa8d48b6a1cc6825c09c847a5) Updates `zizmorcore/zizmor-action` from 0.6.3 to 0.6.4 - [Release notes](https://github.com/zizmorcore/zizmor-action/releases) - [Commits](https://github.com/zizmorcore/zizmor-action/compare/70fb788f84895a7701f5643d103d587e460b5c99...cc914d7f3750a2d13d75c7f184a1060aa0e9d482) Updates `scientific-python/upload-nightly-action` from 0.6.4 to 0.6.5 - [Release notes](https://github.com/scientific-python/upload-nightly-action/releases) - [Commits](https://github.com/scientific-python/upload-nightly-action/compare/e76cfec8a4611fd02808a801b0ff5a7d7c1b2d99...16fa02eacee1655195143de09f03676e60ef2bf5) --- updated-dependencies: - dependency-name: WyriHaximus/github-action-get-previous-tag dependency-version: 2.1.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: codecov/codecov-action dependency-version: 7.1.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: zizmorcore/zizmor-action dependency-version: 0.6.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: scientific-python/upload-nightly-action dependency-version: 0.6.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Michael Niklas --- .github/workflows/benchmarks-last-release.yml | 2 +- .github/workflows/ci-additional.yaml | 8 ++++---- .github/workflows/ci.yaml | 2 +- .github/workflows/nightly-wheels.yml | 2 +- .github/workflows/upstream-dev-ci.yaml | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/benchmarks-last-release.yml b/.github/workflows/benchmarks-last-release.yml index dac512f2c61..e6f89c3e656 100644 --- a/.github/workflows/benchmarks-last-release.yml +++ b/.github/workflows/benchmarks-last-release.yml @@ -37,7 +37,7 @@ jobs: - name: "Get Previous tag" id: previoustag - uses: WyriHaximus/github-action-get-previous-tag@61819f33034117e6c686e6a31dba995a85afc9de # v2.0.0 + uses: WyriHaximus/github-action-get-previous-tag@83f26fea93bc7efcbca2eb5591f5eaaf66b8f206 # v2.1.0 # with: # fallback: 1.0.0 # Optional fallback tag to use when no tag can be found diff --git a/.github/workflows/ci-additional.yaml b/.github/workflows/ci-additional.yaml index 37aa24236c0..93fbd10b845 100644 --- a/.github/workflows/ci-additional.yaml +++ b/.github/workflows/ci-additional.yaml @@ -139,7 +139,7 @@ jobs: pixi run -e ${{env.PIXI_ENV}} -- python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report - name: Upload mypy coverage to Codecov - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 + uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1 with: files: mypy_report/cobertura.xml flags: mypy @@ -185,7 +185,7 @@ jobs: pixi run -e ${{env.PIXI_ENV}} -- python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report - name: Upload mypy coverage to Codecov - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 + uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1 with: files: mypy_report/cobertura.xml flags: mypy-min @@ -286,7 +286,7 @@ jobs: pixi run -e ${{ matrix.pixi-env }} -- python -m pyright xarray/ - name: Upload pyright coverage to Codecov - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 + uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1 with: files: pyright_report/cobertura.xml flags: pyright @@ -348,4 +348,4 @@ jobs: persist-credentials: false - name: Run zizmor - uses: zizmorcore/zizmor-action@70fb788f84895a7701f5643d103d587e460b5c99 # v0.6.3 + uses: zizmorcore/zizmor-action@cc914d7f3750a2d13d75c7f184a1060aa0e9d482 # v0.6.4 diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 85f74354938..ccbf7a10dfc 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -193,7 +193,7 @@ jobs: path: pytest.xml - name: Upload code coverage to Codecov - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 + uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: diff --git a/.github/workflows/nightly-wheels.yml b/.github/workflows/nightly-wheels.yml index 45a422ff112..f7dd1dee4e4 100644 --- a/.github/workflows/nightly-wheels.yml +++ b/.github/workflows/nightly-wheels.yml @@ -69,7 +69,7 @@ jobs: - name: Upload wheel id: upload - uses: scientific-python/upload-nightly-action@e76cfec8a4611fd02808a801b0ff5a7d7c1b2d99 # 0.6.4 + uses: scientific-python/upload-nightly-action@16fa02eacee1655195143de09f03676e60ef2bf5 # 0.6.5 with: anaconda_nightly_upload_token: ${{ secrets.ANACONDA_NIGHTLY }} artifacts_path: dist diff --git a/.github/workflows/upstream-dev-ci.yaml b/.github/workflows/upstream-dev-ci.yaml index 7e4b0a1132c..d1fa4a93d61 100644 --- a/.github/workflows/upstream-dev-ci.yaml +++ b/.github/workflows/upstream-dev-ci.yaml @@ -220,7 +220,7 @@ jobs: run: | pixi run --manifest-path "$MANIFEST_PATH" -e $ENV -- python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report - name: Upload mypy coverage to Codecov - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 + uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1 with: files: mypy_report/cobertura.xml flags: mypy