diff --git a/.github/workflows/ci-additional.yaml b/.github/workflows/ci-additional.yaml index 9fc245db0ba..567c830b8bd 100644 --- a/.github/workflows/ci-additional.yaml +++ b/.github/workflows/ci-additional.yaml @@ -48,7 +48,7 @@ jobs: run: shell: bash -l {0} env: - PIXI_ENV: test + PIXI_ENV: "test-py313" steps: - uses: actions/checkout@v6 with: @@ -75,7 +75,7 @@ jobs: - name: Version info run: | - pixi run -e ${{env.PIXI_ENV}} python xarray/util/print_versions.py + pixi run -e ${{env.PIXI_ENV}} -- python xarray/util/print_versions.py - name: Run doctests run: | # Raise an error if there are warnings in the doctests, with `-Werror`. @@ -84,7 +84,7 @@ jobs: # # If dependencies emit warnings we can't do anything about, add ignores to # `xarray/tests/__init__.py`. - pixi run -e ${{env.PIXI_ENV}} python -m pytest --doctest-modules xarray --ignore xarray/tests -Werror + pixi run -e ${{env.PIXI_ENV}} -- python -m pytest --doctest-modules xarray --ignore xarray/tests -Werror mypy: name: Mypy @@ -94,7 +94,7 @@ jobs: run: shell: bash -l {0} env: - PIXI_ENV: test-with-typing + PIXI_ENV: test-py313-with-typing steps: - uses: actions/checkout@v6 @@ -117,14 +117,14 @@ jobs: - name: set environment variables run: | echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV - echo "PYTHON_VERSION=$(pixi run -e ${{env.PIXI_ENV}} python --version | cut -d' ' -f2 | cut -d. -f1,2)" >> $GITHUB_ENV + echo "PYTHON_VERSION=$(pixi run -e ${{env.PIXI_ENV}} -- python --version | cut -d' ' -f2 | cut -d. -f1,2)" >> $GITHUB_ENV - name: Version info run: | - pixi run -e ${{env.PIXI_ENV}} python xarray/util/print_versions.py + pixi run -e ${{env.PIXI_ENV}} -- python xarray/util/print_versions.py - name: Run mypy run: | - pixi run -e ${{env.PIXI_ENV}} python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report + 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@v5.5.1 @@ -166,14 +166,14 @@ jobs: - name: set environment variables run: | echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV - echo "PYTHON_VERSION=$(pixi run -e ${{env.PIXI_ENV}} python --version | cut -d' ' -f2 | cut -d. -f1,2)" >> $GITHUB_ENV + echo "PYTHON_VERSION=$(pixi run -e ${{env.PIXI_ENV}} -- python --version | cut -d' ' -f2 | cut -d. -f1,2)" >> $GITHUB_ENV - name: Version info run: | - pixi run -e ${{env.PIXI_ENV}} python xarray/util/print_versions.py + pixi run -e ${{env.PIXI_ENV}} -- python xarray/util/print_versions.py - name: Run mypy run: | - pixi run -e ${{env.PIXI_ENV}} python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report + 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@v5.5.1 @@ -191,7 +191,7 @@ jobs: strategy: fail-fast: false matrix: - pixi-env: ["test-with-typing", "test-py311-with-typing"] + pixi-env: ["test-py313-with-typing", "test-py311-with-typing"] if: | always() && ( @@ -223,14 +223,14 @@ jobs: - name: set environment variables run: | echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV - echo "PYTHON_VERSION=$(pixi run -e ${{ matrix.pixi-env }} python --version | cut -d' ' -f2 | cut -d. -f1,2)" >> $GITHUB_ENV + echo "PYTHON_VERSION=$(pixi run -e ${{ matrix.pixi-env }} -- python --version | cut -d' ' -f2 | cut -d. -f1,2)" >> $GITHUB_ENV - name: Version info run: | - pixi run -e ${{ matrix.pixi-env }} python xarray/util/print_versions.py + pixi run -e ${{ matrix.pixi-env }} -- python xarray/util/print_versions.py - name: Run pyright run: | - pixi run -e ${{ matrix.pixi-env }} python -m pyright xarray/ + pixi run -e ${{ matrix.pixi-env }} -- python -m pyright xarray/ - name: Upload pyright coverage to Codecov uses: codecov/codecov-action@v5.5.1 diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 00a7ef4f7ca..456c4034a59 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -52,22 +52,22 @@ jobs: matrix: os: ["ubuntu-latest", "macos-latest", "windows-latest"] # Bookend python versions - pixi-env: ["test-py311", "test"] + pixi-env: ["test-py311", "test-py313"] pytest-addopts: [""] include: # Minimum python version: - - pixi-env: "test-bare-minimum" + - pixi-env: "test-py311-bare-minimum" os: ubuntu-latest - - pixi-env: "test-bare-min-and-scipy" + - pixi-env: "test-py311-bare-min-and-scipy" os: ubuntu-latest - - pixi-env: "test-min-versions" + - pixi-env: "test-py311-min-versions" os: ubuntu-latest # Latest python version: - - pixi-env: "test-no-numba" + - pixi-env: "test-py313-no-numba" os: ubuntu-latest - - pixi-env: "test-no-dask" + - pixi-env: "test-py313-no-dask" os: ubuntu-latest - - pixi-env: "test" + - pixi-env: "test-py313" pytest-addopts: "flaky" os: ubuntu-latest # The mypy tests must be executed using only 1 process in order to guarantee @@ -76,7 +76,7 @@ jobs: pytest-addopts: "mypy" numprocesses: 1 os: ubuntu-latest - - pixi-env: "test-with-typing" + - pixi-env: "test-py313-with-typing" numprocesses: 1 os: ubuntu-latest steps: @@ -101,7 +101,7 @@ jobs: - name: Set environment variables run: | echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV - echo "PYTHON_VERSION=$(pixi run -e ${{env.PIXI_ENV}} python --version | cut -d' ' -f2 | cut -d. -f1,2)" >> $GITHUB_ENV + echo "PYTHON_VERSION=$(pixi run -e ${{ matrix.pixi-env }} -- python --version | cut -d' ' -f2 | cut -d. -f1,2)" >> $GITHUB_ENV if [[ "${{ matrix.pytest-addopts }}" != "" ]] ; then @@ -128,11 +128,11 @@ jobs: - name: Version info run: | - pixi run -e ${{ matrix.pixi-env }} python xarray/util/print_versions.py + pixi run -e ${{ matrix.pixi-env }} -- python xarray/util/print_versions.py - name: Import xarray run: | - pixi run -e ${{ matrix.pixi-env }} python -c "import xarray" + pixi run -e ${{ matrix.pixi-env }} -- python -c "import xarray" - name: Restore cached hypothesis directory uses: actions/cache@v4 @@ -143,12 +143,12 @@ jobs: save-always: true - name: Run tests - run: - pixi run -e ${{ matrix.pixi-env }} python -m pytest -n ${{ matrix.numprocesses || 4 }} - --timeout 180 - --cov=xarray - --cov-report=xml - --junitxml=pytest.xml + run: | + pixi run -e ${{ matrix.pixi-env }} -- python -m pytest -n ${{ matrix.numprocesses || 4 }} \ + --timeout 180 \ + --cov=xarray \ + --cov-report=xml \ + --junitxml=pytest.xml - name: Upload test results if: always() diff --git a/.github/workflows/hypothesis.yaml b/.github/workflows/hypothesis.yaml index 5ccf9c5be9e..3787077f0da 100644 --- a/.github/workflows/hypothesis.yaml +++ b/.github/workflows/hypothesis.yaml @@ -55,7 +55,7 @@ jobs: shell: bash -l {0} env: - PIXI_ENV: test + PIXI_ENV: "test-py313" steps: - uses: actions/checkout@v6 diff --git a/.github/workflows/upstream-dev-ci.yaml b/.github/workflows/upstream-dev-ci.yaml index a3052957b0b..75ffddfda0c 100644 --- a/.github/workflows/upstream-dev-ci.yaml +++ b/.github/workflows/upstream-dev-ci.yaml @@ -79,15 +79,15 @@ jobs: cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }} - name: Version info run: | - pixi run -e ${{matrix.pixi-env}} python xarray/util/print_versions.py + pixi run -e ${{matrix.pixi-env}} -- python xarray/util/print_versions.py - name: Import xarray run: | - pixi run -e ${{matrix.pixi-env}} python -c 'import xarray' + pixi run -e ${{matrix.pixi-env}} -- python -c 'import xarray' - name: Run Tests if: success() id: status run: | - pixi run -e ${{matrix.pixi-env}} python -m pytest --timeout=60 -rf -nauto \ + pixi run -e ${{matrix.pixi-env}} -- python -m pytest --timeout=60 -rf -nauto \ --report-log output-${{ matrix.pixi-env }}-log.jsonl - name: Generate and publish the report if: | @@ -138,13 +138,13 @@ jobs: - name: set environment variables run: | echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV - echo "PYTHON_VERSION=$(pixi run -e ${{matrix.pixi-env}} python --version | cut -d' ' -f2 | cut -d. -f1,2)" >> $GITHUB_ENV + echo "PYTHON_VERSION=$(pixi run -e ${{matrix.pixi-env}} -- python --version | cut -d' ' -f2 | cut -d. -f1,2)" >> $GITHUB_ENV - name: Version info run: | - pixi run -e ${{matrix.pixi-env}} python xarray/util/print_versions.py + pixi run -e ${{matrix.pixi-env}} -- python xarray/util/print_versions.py - name: Run mypy run: | - pixi run -e ${{matrix.pixi-env}} python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report + pixi run -e ${{matrix.pixi-env}} -- python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report - name: Upload mypy coverage to Codecov uses: codecov/codecov-action@v5.5.1 with: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b216fdf6775..a891a84a6a3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -35,7 +35,7 @@ repos: - id: blackdoc exclude: "generate_aggregations.py" # make sure this is the most recent version of black - additional_dependencies: ["black==25.9.0"] + additional_dependencies: ["black==25.11.0"] - repo: https://github.com/rbubley/mirrors-prettier rev: v3.7.3 hooks: diff --git a/pixi.toml b/pixi.toml index e77edb26c9f..531d829340b 100644 --- a/pixi.toml +++ b/pixi.toml @@ -3,104 +3,6 @@ preview = ["pixi-build"] channels = ["conda-forge", "nodefaults"] platforms = ["win-64", "linux-64", "osx-arm64"] -[environments] -# Testing -# test-just-xarray = { features = ["test"] } # https://github.com/pydata/xarray/pull/10888/files#r2511336147 -test-no-numba = { features = [ - "py313", - "test", - "backends", - "accel", - "dask", - "viz", - "extras", -] } -test-no-dask = { features = [ - "py312", - "test", - "backends", - "accel", - "numba", - "viz", - "extras", -] } -test = { features = [ - "py313", - "test", - "backends", - "accel", - "numba", - "dask", - "viz", - "extras", -] } -test-nightly = { features = [ - "py313", - "nightly", - "test", - # "typing", -], no-default-feature = true } - - -test-py311 = { features = [ - "py311", - "test", - "backends", - "accel", - "numba", - "dask", - "viz", - "extras", -] } - -test-py311-with-typing = { features = [ - "py311", - "test", - "backends", - "accel", - "numba", - "dask", - "viz", - "extras", - "typing", -] } - -test-with-typing = { features = [ - "py313", - "test", - "backends", - "accel", - "numba", - "dask", - "viz", - "extras", - "typing", -] } - -test-bare-minimum = { features = ["test", "minimal"] } -test-bare-min-and-scipy = { features = [ - "test", - "minimal", - "minimum-scipy", -] } -test-min-versions = { features = [ - "test", - "min-versions", -] } - - -# Extra -typing = { features = ["typing"] } -doc = { features = [ - "doc", - "backends", - "test", - "accel", - "viz", - "extras", -] } -pre-commit = { features = ["pre-commit"], no-default-feature = true } - [package] name = "xarray" version = "dynamic" # dynamic versioning needs better support in pixi https://github.com/prefix-dev/pixi/issues/2923#issuecomment-2598460666 . Putting `version = "dynamic"` here for now until pixi recommends something else. @@ -126,15 +28,6 @@ xarray = { path = "." } [target.linux-64.dependencies] pydap-server = "*" -[feature.minimal.dependencies] -# minimal versions -python = "3.11.*" -numpy = "1.26.*" -pandas = "2.2.*" - -[feature.minimum-scipy.dependencies] -scipy = "1.13.*" - [feature.py311.dependencies] python = "3.11.*" @@ -203,13 +96,21 @@ iris = "*" # array jax = "*" # no way to get cpu-only jaxlib from conda if gpu is present +[feature.minimal.dependencies] +# minimal versions +python = "3.11.*" +numpy = "1.26.*" +pandas = "2.2.*" + +[feature.minimum-scipy.dependencies] +scipy = "1.13.*" + [feature.min-versions.dependencies] # minimal versions for all dependencies # Note that when you update min-supported versions, you should: # - Update the min version lower-bound in the corresponding feature(s) where applicable # - Update this section to pin to the min version -python = "3.11.*" array-api-strict = "1.1.*" # dependency for testing the array api compat boto3 = "1.34.*" bottleneck = "1.4.*" @@ -233,13 +134,10 @@ nc-time-axis = "1.4.*" netcdf4 = "1.6.*" numba = "0.60.*" numbagg = "0.8.*" -numpy = "1.26.*" packaging = "24.1.*" -pandas = "2.2.*" pint = "0.24.*" pydap = "3.5.*" rasterio = "1.3.*" -scipy = "1.13.*" seaborn = "0.13.*" sparse = "0.15.*" toolz = "0.12.*" @@ -320,11 +218,11 @@ test = { cmd = "pytest" } kerchunk = "*" ipykernel = "*" ipywidgets = "*" # silence nbsphinx warning -ipython = '*' -jupyter_client = '*' -jupyter_sphinx = '*' -nbsphinx = '*' -ncdata = '*' +ipython = "*" +jupyter_client = "*" +jupyter_sphinx = "*" +nbsphinx = "*" +ncdata = "*" pydata-sphinx-theme = "*" pyproj = "*" rich = "*" # for Zarr tree() @@ -379,3 +277,103 @@ pre-commit = "*" [feature.pre-commit.tasks] pre-commit = { cmd = "pre-commit" } + +[environments] +# Testing +# test-just-xarray = { features = ["test"] } # https://github.com/pydata/xarray/pull/10888/files#r2511336147 +test-py313-no-numba = { features = [ + "py313", + "test", + "backends", + "accel", + "dask", + "viz", + "extras", +] } +test-py313-no-dask = { features = [ + "py312", + "test", + "backends", + "accel", + "numba", + "viz", + "extras", +] } +test-py313 = { features = [ + "py313", + "test", + "backends", + "accel", + "numba", + "dask", + "viz", + "extras", +] } +test-nightly = { features = [ + "py313", + "nightly", + "test", + # "typing", +], no-default-feature = true } + + +test-py311 = { features = [ + "py311", + "test", + "backends", + "accel", + "numba", + "dask", + "viz", + "extras", +] } + +test-py311-with-typing = { features = [ + "py311", + "test", + "backends", + "accel", + "numba", + "dask", + "viz", + "extras", + "typing", +] } + +test-py313-with-typing = { features = [ + "py313", + "test", + "backends", + "accel", + "numba", + "dask", + "viz", + "extras", + "typing", +] } + +test-py311-bare-minimum = { features = ["test", "minimal"] } +test-py311-bare-min-and-scipy = { features = [ + "test", + "minimal", + "minimum-scipy", +] } +test-py311-min-versions = { features = [ + "test", + "minimal", + "minimum-scipy", + "min-versions", +] } + + +# Extra +typing = { features = ["typing"] } +doc = { features = [ + "doc", + "backends", + "test", + "accel", + "viz", + "extras", +] } +pre-commit = { features = ["pre-commit"], no-default-feature = true }