Skip to content

Commit 9bee765

Browse files
authored
small changes to the pixi env definitions (#10976)
* rename environments to include the python version * upgrade `black` to 25.11 * use basic strings, not literal strings * deduplicate the minimum versions * move the environments below the features * use the new names in CI * forgotten env name * also rename the min-versions envs and ci jobs * cleanly separate pixi options from python options * more separation of options * use a yaml code block * keep the min-versions features in one place * chain the command with backslashes * use the matrix variable
1 parent 1b0b9e2 commit 9bee765

File tree

6 files changed

+153
-155
lines changed

6 files changed

+153
-155
lines changed

.github/workflows/ci-additional.yaml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
run:
4949
shell: bash -l {0}
5050
env:
51-
PIXI_ENV: test
51+
PIXI_ENV: "test-py313"
5252
steps:
5353
- uses: actions/checkout@v6
5454
with:
@@ -75,7 +75,7 @@ jobs:
7575

7676
- name: Version info
7777
run: |
78-
pixi run -e ${{env.PIXI_ENV}} python xarray/util/print_versions.py
78+
pixi run -e ${{env.PIXI_ENV}} -- python xarray/util/print_versions.py
7979
- name: Run doctests
8080
run: |
8181
# Raise an error if there are warnings in the doctests, with `-Werror`.
@@ -84,7 +84,7 @@ jobs:
8484
#
8585
# If dependencies emit warnings we can't do anything about, add ignores to
8686
# `xarray/tests/__init__.py`.
87-
pixi run -e ${{env.PIXI_ENV}} python -m pytest --doctest-modules xarray --ignore xarray/tests -Werror
87+
pixi run -e ${{env.PIXI_ENV}} -- python -m pytest --doctest-modules xarray --ignore xarray/tests -Werror
8888
8989
mypy:
9090
name: Mypy
@@ -94,7 +94,7 @@ jobs:
9494
run:
9595
shell: bash -l {0}
9696
env:
97-
PIXI_ENV: test-with-typing
97+
PIXI_ENV: test-py313-with-typing
9898

9999
steps:
100100
- uses: actions/checkout@v6
@@ -117,14 +117,14 @@ jobs:
117117
- name: set environment variables
118118
run: |
119119
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
120-
echo "PYTHON_VERSION=$(pixi run -e ${{env.PIXI_ENV}} python --version | cut -d' ' -f2 | cut -d. -f1,2)" >> $GITHUB_ENV
120+
echo "PYTHON_VERSION=$(pixi run -e ${{env.PIXI_ENV}} -- python --version | cut -d' ' -f2 | cut -d. -f1,2)" >> $GITHUB_ENV
121121
- name: Version info
122122
run: |
123-
pixi run -e ${{env.PIXI_ENV}} python xarray/util/print_versions.py
123+
pixi run -e ${{env.PIXI_ENV}} -- python xarray/util/print_versions.py
124124
125125
- name: Run mypy
126126
run: |
127-
pixi run -e ${{env.PIXI_ENV}} python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report
127+
pixi run -e ${{env.PIXI_ENV}} -- python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report
128128
129129
- name: Upload mypy coverage to Codecov
130130
uses: codecov/[email protected]
@@ -166,14 +166,14 @@ jobs:
166166
- name: set environment variables
167167
run: |
168168
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
169-
echo "PYTHON_VERSION=$(pixi run -e ${{env.PIXI_ENV}} python --version | cut -d' ' -f2 | cut -d. -f1,2)" >> $GITHUB_ENV
169+
echo "PYTHON_VERSION=$(pixi run -e ${{env.PIXI_ENV}} -- python --version | cut -d' ' -f2 | cut -d. -f1,2)" >> $GITHUB_ENV
170170
- name: Version info
171171
run: |
172-
pixi run -e ${{env.PIXI_ENV}} python xarray/util/print_versions.py
172+
pixi run -e ${{env.PIXI_ENV}} -- python xarray/util/print_versions.py
173173
174174
- name: Run mypy
175175
run: |
176-
pixi run -e ${{env.PIXI_ENV}} python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report
176+
pixi run -e ${{env.PIXI_ENV}} -- python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report
177177
178178
- name: Upload mypy coverage to Codecov
179179
uses: codecov/[email protected]
@@ -191,7 +191,7 @@ jobs:
191191
strategy:
192192
fail-fast: false
193193
matrix:
194-
pixi-env: ["test-with-typing", "test-py311-with-typing"]
194+
pixi-env: ["test-py313-with-typing", "test-py311-with-typing"]
195195
if: |
196196
always()
197197
&& (
@@ -223,14 +223,14 @@ jobs:
223223
- name: set environment variables
224224
run: |
225225
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
226-
echo "PYTHON_VERSION=$(pixi run -e ${{ matrix.pixi-env }} python --version | cut -d' ' -f2 | cut -d. -f1,2)" >> $GITHUB_ENV
226+
echo "PYTHON_VERSION=$(pixi run -e ${{ matrix.pixi-env }} -- python --version | cut -d' ' -f2 | cut -d. -f1,2)" >> $GITHUB_ENV
227227
- name: Version info
228228
run: |
229-
pixi run -e ${{ matrix.pixi-env }} python xarray/util/print_versions.py
229+
pixi run -e ${{ matrix.pixi-env }} -- python xarray/util/print_versions.py
230230
231231
- name: Run pyright
232232
run: |
233-
pixi run -e ${{ matrix.pixi-env }} python -m pyright xarray/
233+
pixi run -e ${{ matrix.pixi-env }} -- python -m pyright xarray/
234234
235235
- name: Upload pyright coverage to Codecov
236236
uses: codecov/[email protected]

.github/workflows/ci.yaml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -52,22 +52,22 @@ jobs:
5252
matrix:
5353
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
5454
# Bookend python versions
55-
pixi-env: ["test-py311", "test"]
55+
pixi-env: ["test-py311", "test-py313"]
5656
pytest-addopts: [""]
5757
include:
5858
# Minimum python version:
59-
- pixi-env: "test-bare-minimum"
59+
- pixi-env: "test-py311-bare-minimum"
6060
os: ubuntu-latest
61-
- pixi-env: "test-bare-min-and-scipy"
61+
- pixi-env: "test-py311-bare-min-and-scipy"
6262
os: ubuntu-latest
63-
- pixi-env: "test-min-versions"
63+
- pixi-env: "test-py311-min-versions"
6464
os: ubuntu-latest
6565
# Latest python version:
66-
- pixi-env: "test-no-numba"
66+
- pixi-env: "test-py313-no-numba"
6767
os: ubuntu-latest
68-
- pixi-env: "test-no-dask"
68+
- pixi-env: "test-py313-no-dask"
6969
os: ubuntu-latest
70-
- pixi-env: "test"
70+
- pixi-env: "test-py313"
7171
pytest-addopts: "flaky"
7272
os: ubuntu-latest
7373
# The mypy tests must be executed using only 1 process in order to guarantee
@@ -76,7 +76,7 @@ jobs:
7676
pytest-addopts: "mypy"
7777
numprocesses: 1
7878
os: ubuntu-latest
79-
- pixi-env: "test-with-typing"
79+
- pixi-env: "test-py313-with-typing"
8080
numprocesses: 1
8181
os: ubuntu-latest
8282
steps:
@@ -101,7 +101,7 @@ jobs:
101101
- name: Set environment variables
102102
run: |
103103
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
104-
echo "PYTHON_VERSION=$(pixi run -e ${{env.PIXI_ENV}} python --version | cut -d' ' -f2 | cut -d. -f1,2)" >> $GITHUB_ENV
104+
echo "PYTHON_VERSION=$(pixi run -e ${{ matrix.pixi-env }} -- python --version | cut -d' ' -f2 | cut -d. -f1,2)" >> $GITHUB_ENV
105105
106106
if [[ "${{ matrix.pytest-addopts }}" != "" ]] ;
107107
then
@@ -128,11 +128,11 @@ jobs:
128128
129129
- name: Version info
130130
run: |
131-
pixi run -e ${{ matrix.pixi-env }} python xarray/util/print_versions.py
131+
pixi run -e ${{ matrix.pixi-env }} -- python xarray/util/print_versions.py
132132
133133
- name: Import xarray
134134
run: |
135-
pixi run -e ${{ matrix.pixi-env }} python -c "import xarray"
135+
pixi run -e ${{ matrix.pixi-env }} -- python -c "import xarray"
136136
137137
- name: Restore cached hypothesis directory
138138
uses: actions/cache@v4
@@ -143,12 +143,12 @@ jobs:
143143
save-always: true
144144

145145
- name: Run tests
146-
run:
147-
pixi run -e ${{ matrix.pixi-env }} python -m pytest -n ${{ matrix.numprocesses || 4 }}
148-
--timeout 180
149-
--cov=xarray
150-
--cov-report=xml
151-
--junitxml=pytest.xml
146+
run: |
147+
pixi run -e ${{ matrix.pixi-env }} -- python -m pytest -n ${{ matrix.numprocesses || 4 }} \
148+
--timeout 180 \
149+
--cov=xarray \
150+
--cov-report=xml \
151+
--junitxml=pytest.xml
152152
153153
- name: Upload test results
154154
if: always()

.github/workflows/hypothesis.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
shell: bash -l {0}
5656

5757
env:
58-
PIXI_ENV: test
58+
PIXI_ENV: "test-py313"
5959

6060
steps:
6161
- uses: actions/checkout@v6

.github/workflows/upstream-dev-ci.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,15 @@ jobs:
7979
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
8080
- name: Version info
8181
run: |
82-
pixi run -e ${{matrix.pixi-env}} python xarray/util/print_versions.py
82+
pixi run -e ${{matrix.pixi-env}} -- python xarray/util/print_versions.py
8383
- name: Import xarray
8484
run: |
85-
pixi run -e ${{matrix.pixi-env}} python -c 'import xarray'
85+
pixi run -e ${{matrix.pixi-env}} -- python -c 'import xarray'
8686
- name: Run Tests
8787
if: success()
8888
id: status
8989
run: |
90-
pixi run -e ${{matrix.pixi-env}} python -m pytest --timeout=60 -rf -nauto \
90+
pixi run -e ${{matrix.pixi-env}} -- python -m pytest --timeout=60 -rf -nauto \
9191
--report-log output-${{ matrix.pixi-env }}-log.jsonl
9292
- name: Generate and publish the report
9393
if: |
@@ -138,13 +138,13 @@ jobs:
138138
- name: set environment variables
139139
run: |
140140
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
141-
echo "PYTHON_VERSION=$(pixi run -e ${{matrix.pixi-env}} python --version | cut -d' ' -f2 | cut -d. -f1,2)" >> $GITHUB_ENV
141+
echo "PYTHON_VERSION=$(pixi run -e ${{matrix.pixi-env}} -- python --version | cut -d' ' -f2 | cut -d. -f1,2)" >> $GITHUB_ENV
142142
- name: Version info
143143
run: |
144-
pixi run -e ${{matrix.pixi-env}} python xarray/util/print_versions.py
144+
pixi run -e ${{matrix.pixi-env}} -- python xarray/util/print_versions.py
145145
- name: Run mypy
146146
run: |
147-
pixi run -e ${{matrix.pixi-env}} python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report
147+
pixi run -e ${{matrix.pixi-env}} -- python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report
148148
- name: Upload mypy coverage to Codecov
149149
uses: codecov/[email protected]
150150
with:

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ repos:
3535
- id: blackdoc
3636
exclude: "generate_aggregations.py"
3737
# make sure this is the most recent version of black
38-
additional_dependencies: ["black==25.9.0"]
38+
additional_dependencies: ["black==25.11.0"]
3939
- repo: https://github.com/rbubley/mirrors-prettier
4040
rev: v3.7.3
4141
hooks:

0 commit comments

Comments
 (0)