From b0e150e02acd55dcbe589582be5e70f4fbeb66d9 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Fri, 17 May 2024 14:48:03 +0200 Subject: [PATCH 1/5] attempt to get colour output in CI (#9031) * set the TERM environment variable in CI * set the environment variable at the top level * try `FORCE_COLOR` instead --- .github/workflows/ci-additional.yaml | 3 +++ .github/workflows/ci.yaml | 3 +++ .github/workflows/hypothesis.yaml | 3 +++ .github/workflows/upstream-dev-ci.yaml | 3 +++ 4 files changed, 12 insertions(+) diff --git a/.github/workflows/ci-additional.yaml b/.github/workflows/ci-additional.yaml index c0f978fb0d8..c350c646901 100644 --- a/.github/workflows/ci-additional.yaml +++ b/.github/workflows/ci-additional.yaml @@ -18,6 +18,9 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +env: + FORCE_COLOR: 3 + jobs: detect-ci-trigger: name: detect ci trigger diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b9b15d867a7..32d571bfc24 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -18,6 +18,9 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +env: + FORCE_COLOR: 3 + jobs: detect-ci-trigger: name: detect ci trigger diff --git a/.github/workflows/hypothesis.yaml b/.github/workflows/hypothesis.yaml index 2772dac22b1..6ef71cde0ff 100644 --- a/.github/workflows/hypothesis.yaml +++ b/.github/workflows/hypothesis.yaml @@ -11,6 +11,9 @@ on: - cron: "0 0 * * *" # Daily “At 00:00” UTC workflow_dispatch: # allows you to trigger manually +env: + FORCE_COLOR: 3 + jobs: detect-ci-trigger: name: detect ci trigger diff --git a/.github/workflows/upstream-dev-ci.yaml b/.github/workflows/upstream-dev-ci.yaml index a216dfd7428..4d08cb8f6a9 100644 --- a/.github/workflows/upstream-dev-ci.yaml +++ b/.github/workflows/upstream-dev-ci.yaml @@ -15,6 +15,9 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +env: + FORCE_COLOR: 3 + jobs: detect-ci-trigger: name: detect upstream-dev ci trigger From 93b7a9e0baf58a14b858c83cb498bedbe8f4309e Mon Sep 17 00:00:00 2001 From: Mathias Hauser Date: Fri, 17 May 2024 18:30:11 +0200 Subject: [PATCH 2/5] [skip-ci] min_deps_check: show age of required pkg on error (#9025) --- ci/min_deps_check.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ci/min_deps_check.py b/ci/min_deps_check.py index 5ec7bff0a30..6981a69d96c 100755 --- a/ci/min_deps_check.py +++ b/ci/min_deps_check.py @@ -23,12 +23,12 @@ "isort", "mypy", "pip", - "setuptools", "pytest", "pytest-cov", "pytest-env", - "pytest-xdist", "pytest-timeout", + "pytest-xdist", + "setuptools", } POLICY_MONTHS = {"python": 30, "numpy": 18} @@ -162,11 +162,11 @@ def process_pkg( status = "<" elif (req_major, req_minor) > (policy_major, policy_minor): status = "> (!)" - delta = relativedelta(datetime.now(), policy_published_actual).normalized() + delta = relativedelta(datetime.now(), req_published).normalized() n_months = delta.years * 12 + delta.months warning( - f"Package is too new: {pkg}={policy_major}.{policy_minor} was " - f"published on {versions[policy_major, policy_minor]:%Y-%m-%d} " + f"Package is too new: {pkg}={req_major}.{req_minor} was " + f"published on {req_published:%Y-%m-%d} " f"which was {n_months} months ago (policy is {policy_months} months)" ) else: From d0e96b2f46d5295bea6dbfa31b97ecb14fb7a10f Mon Sep 17 00:00:00 2001 From: Mark Harfouche Date: Sat, 18 May 2024 17:28:37 -0400 Subject: [PATCH 3/5] Fix numbagg or bottlekneck skip (#9034) --- xarray/tests/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xarray/tests/__init__.py b/xarray/tests/__init__.py index 23fd590f4dc..d5730b1c77b 100644 --- a/xarray/tests/__init__.py +++ b/xarray/tests/__init__.py @@ -145,7 +145,7 @@ def _importorskip( ) has_numbagg_or_bottleneck = has_numbagg or has_bottleneck requires_numbagg_or_bottleneck = pytest.mark.skipif( - not has_scipy_or_netCDF4, reason="requires scipy or netCDF4" + not has_numbagg_or_bottleneck, reason="requires numbagg or bottlekneck" ) has_numpy_array_api, requires_numpy_array_api = _importorskip("numpy", "1.26.0") has_numpy_2, requires_numpy_2 = _importorskip("numpy", "2.0.0") From 5fa8d6dc277f3147afa9cbbc006a96a72bde042c Mon Sep 17 00:00:00 2001 From: Mark Harfouche Date: Sun, 19 May 2024 09:14:42 -0400 Subject: [PATCH 4/5] Use ME in test_plot instead of M (#9035) ``` pytest xarray/tests/test_plot.py::TestNcAxisNotInstalled::test_ncaxis_notinstalled_line_plot ``` would return the following error ``` xarray/tests/test_plot.py E [100%] ======================================= ERRORS ======================================= ____ ERROR at setup of TestNcAxisNotInstalled.test_ncaxis_notinstalled_line_plot _____ self = @pytest.fixture(autouse=True) def setUp(self) -> None: """ Create a DataArray with a time-axis that contains cftime.datetime objects. """ month = np.arange(1, 13, 1) data = np.sin(2 * np.pi * month / 12.0) darray = DataArray(data, dims=["time"]) > darray.coords["time"] = xr.cftime_range( start="2017", periods=12, freq="1M", calendar="noleap" ) /home/mark/git/xarray/xarray/tests/test_plot.py:3004: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/mark/git/xarray/xarray/coding/cftime_offsets.py:1129: in cftime_range offset = to_offset(freq) /home/mark/git/xarray/xarray/coding/cftime_offsets.py:767: in to_offset _emit_freq_deprecation_warning(freq) /home/mark/git/xarray/xarray/coding/cftime_offsets.py:751: in _emit_freq_deprecation_warning emit_user_level_warning(message, FutureWarning) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ message = "'M' is deprecated and will be removed in a future version. Please use 'ME' instead of 'M'." category = def emit_user_level_warning(message, category=None) -> None: """Emit a warning at the user level by inspecting the stack trace.""" stacklevel = find_stack_level() > return warnings.warn(message, category=category, stacklevel=stacklevel) E FutureWarning: 'M' is deprecated and will be removed in a future version. Please use 'ME' instead of 'M'. /home/mark/git/xarray/xarray/core/utils.py:1112: FutureWarning ============================== short test summary info =============================== ERROR xarray/tests/test_plot.py::TestNcAxisNotInstalled::test_ncaxis_notinstalled_line_plot - FutureWarning: 'M' is deprecated and will be removed in a future version. Please ... ================================== 1 error in 0.64s ================================== ``` --- xarray/tests/test_plot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xarray/tests/test_plot.py b/xarray/tests/test_plot.py index e636be5589f..27f4ded5646 100644 --- a/xarray/tests/test_plot.py +++ b/xarray/tests/test_plot.py @@ -3002,7 +3002,7 @@ def setUp(self) -> None: data = np.sin(2 * np.pi * month / 12.0) darray = DataArray(data, dims=["time"]) darray.coords["time"] = xr.cftime_range( - start="2017", periods=12, freq="1M", calendar="noleap" + start="2017", periods=12, freq="1ME", calendar="noleap" ) self.darray = darray From 12123be8608f3a90c6a6d8a1cdc4845126492364 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 May 2024 06:23:28 +0000 Subject: [PATCH 5/5] Bump codecov/codecov-action from 4.3.1 to 4.4.0 in the actions group (#9036) Bumps the actions group with 1 update: [codecov/codecov-action](https://github.com/codecov/codecov-action). Updates `codecov/codecov-action` from 4.3.1 to 4.4.0 - [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/v4.3.1...v4.4.0) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci-additional.yaml | 8 ++++---- .github/workflows/ci.yaml | 2 +- .github/workflows/upstream-dev-ci.yaml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-additional.yaml b/.github/workflows/ci-additional.yaml index c350c646901..e264b6aee96 100644 --- a/.github/workflows/ci-additional.yaml +++ b/.github/workflows/ci-additional.yaml @@ -136,7 +136,7 @@ jobs: python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report xarray/ - name: Upload mypy coverage to Codecov - uses: codecov/codecov-action@v4.3.1 + uses: codecov/codecov-action@v4.4.0 with: file: mypy_report/cobertura.xml flags: mypy @@ -190,7 +190,7 @@ jobs: python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report xarray/ - name: Upload mypy coverage to Codecov - uses: codecov/codecov-action@v4.3.1 + uses: codecov/codecov-action@v4.4.0 with: file: mypy_report/cobertura.xml flags: mypy39 @@ -251,7 +251,7 @@ jobs: python -m pyright xarray/ - name: Upload pyright coverage to Codecov - uses: codecov/codecov-action@v4.3.1 + uses: codecov/codecov-action@v4.4.0 with: file: pyright_report/cobertura.xml flags: pyright @@ -310,7 +310,7 @@ jobs: python -m pyright xarray/ - name: Upload pyright coverage to Codecov - uses: codecov/codecov-action@v4.3.1 + uses: codecov/codecov-action@v4.4.0 with: file: pyright_report/cobertura.xml flags: pyright39 diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 32d571bfc24..2ad58509ae4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -165,7 +165,7 @@ jobs: path: pytest.xml - name: Upload code coverage to Codecov - uses: codecov/codecov-action@v4.3.1 + uses: codecov/codecov-action@v4.4.0 with: file: ./coverage.xml flags: unittests diff --git a/.github/workflows/upstream-dev-ci.yaml b/.github/workflows/upstream-dev-ci.yaml index 4d08cb8f6a9..731a9c3ff55 100644 --- a/.github/workflows/upstream-dev-ci.yaml +++ b/.github/workflows/upstream-dev-ci.yaml @@ -146,7 +146,7 @@ jobs: run: | python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report - name: Upload mypy coverage to Codecov - uses: codecov/codecov-action@v4.3.1 + uses: codecov/codecov-action@v4.4.0 with: file: mypy_report/cobertura.xml flags: mypy