|
82 | 82 | name: Mypy |
83 | 83 | runs-on: "ubuntu-latest" |
84 | 84 | needs: detect-ci-trigger |
85 | | - # temporarily skipping due to https://github.com/pydata/xarray/issues/6551 |
86 | | - if: needs.detect-ci-trigger.outputs.triggered == 'false' |
87 | 85 | defaults: |
88 | 86 | run: |
89 | 87 | shell: bash -l {0} |
@@ -190,6 +188,126 @@ jobs: |
190 | 188 |
|
191 | 189 |
|
192 | 190 |
|
| 191 | + pyright: |
| 192 | + name: Pyright |
| 193 | + runs-on: "ubuntu-latest" |
| 194 | + needs: detect-ci-trigger |
| 195 | + if: | |
| 196 | + always() |
| 197 | + && ( |
| 198 | + contains( github.event.pull_request.labels.*.name, 'run-pyright') |
| 199 | + ) |
| 200 | + defaults: |
| 201 | + run: |
| 202 | + shell: bash -l {0} |
| 203 | + env: |
| 204 | + CONDA_ENV_FILE: ci/requirements/environment.yml |
| 205 | + PYTHON_VERSION: "3.10" |
| 206 | + |
| 207 | + steps: |
| 208 | + - uses: actions/checkout@v4 |
| 209 | + with: |
| 210 | + fetch-depth: 0 # Fetch all history for all branches and tags. |
| 211 | + |
| 212 | + - name: set environment variables |
| 213 | + run: | |
| 214 | + echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV |
| 215 | + - name: Setup micromamba |
| 216 | + uses: mamba-org/setup-micromamba@v1 |
| 217 | + with: |
| 218 | + environment-file: ${{env.CONDA_ENV_FILE}} |
| 219 | + environment-name: xarray-tests |
| 220 | + create-args: >- |
| 221 | + python=${{env.PYTHON_VERSION}} |
| 222 | + conda |
| 223 | + cache-environment: true |
| 224 | + cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}" |
| 225 | + - name: Install xarray |
| 226 | + run: | |
| 227 | + python -m pip install --no-deps -e . |
| 228 | + - name: Version info |
| 229 | + run: | |
| 230 | + conda info -a |
| 231 | + conda list |
| 232 | + python xarray/util/print_versions.py |
| 233 | + - name: Install pyright |
| 234 | + run: | |
| 235 | + python -m pip install pyright --force-reinstall |
| 236 | +
|
| 237 | + - name: Run pyright |
| 238 | + run: | |
| 239 | + python -m pyright xarray/ |
| 240 | +
|
| 241 | + - name: Upload pyright coverage to Codecov |
| 242 | + uses: codecov/codecov-action@v3.1.4 |
| 243 | + with: |
| 244 | + file: pyright_report/cobertura.xml |
| 245 | + flags: pyright |
| 246 | + env_vars: PYTHON_VERSION |
| 247 | + name: codecov-umbrella |
| 248 | + fail_ci_if_error: false |
| 249 | + |
| 250 | + pyright39: |
| 251 | + name: Pyright 3.9 |
| 252 | + runs-on: "ubuntu-latest" |
| 253 | + needs: detect-ci-trigger |
| 254 | + if: | |
| 255 | + always() |
| 256 | + && ( |
| 257 | + contains( github.event.pull_request.labels.*.name, 'run-pyright') |
| 258 | + ) |
| 259 | + defaults: |
| 260 | + run: |
| 261 | + shell: bash -l {0} |
| 262 | + env: |
| 263 | + CONDA_ENV_FILE: ci/requirements/environment.yml |
| 264 | + PYTHON_VERSION: "3.9" |
| 265 | + |
| 266 | + steps: |
| 267 | + - uses: actions/checkout@v4 |
| 268 | + with: |
| 269 | + fetch-depth: 0 # Fetch all history for all branches and tags. |
| 270 | + |
| 271 | + - name: set environment variables |
| 272 | + run: | |
| 273 | + echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV |
| 274 | + - name: Setup micromamba |
| 275 | + uses: mamba-org/setup-micromamba@v1 |
| 276 | + with: |
| 277 | + environment-file: ${{env.CONDA_ENV_FILE}} |
| 278 | + environment-name: xarray-tests |
| 279 | + create-args: >- |
| 280 | + python=${{env.PYTHON_VERSION}} |
| 281 | + conda |
| 282 | + cache-environment: true |
| 283 | + cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}" |
| 284 | + - name: Install xarray |
| 285 | + run: | |
| 286 | + python -m pip install --no-deps -e . |
| 287 | + - name: Version info |
| 288 | + run: | |
| 289 | + conda info -a |
| 290 | + conda list |
| 291 | + python xarray/util/print_versions.py |
| 292 | + - name: Install pyright |
| 293 | + run: | |
| 294 | + python -m pip install pyright --force-reinstall |
| 295 | +
|
| 296 | + - name: Run pyright |
| 297 | + run: | |
| 298 | + python -m pyright xarray/ |
| 299 | +
|
| 300 | + - name: Upload pyright coverage to Codecov |
| 301 | + uses: codecov/codecov-action@v3.1.4 |
| 302 | + with: |
| 303 | + file: pyright_report/cobertura.xml |
| 304 | + flags: pyright39 |
| 305 | + env_vars: PYTHON_VERSION |
| 306 | + name: codecov-umbrella |
| 307 | + fail_ci_if_error: false |
| 308 | + |
| 309 | + |
| 310 | + |
193 | 311 | min-version-policy: |
194 | 312 | name: Minimum Version Policy |
195 | 313 | runs-on: "ubuntu-latest" |
|
0 commit comments