Skip to content

hook maintenance #296

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
May 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .flake8

This file was deleted.

56 changes: 28 additions & 28 deletions .github/workflows/ci-additional.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,31 +27,31 @@ jobs:
FORCE_COLOR: 3

steps:
- name: checkout
uses: actions/checkout@v4
- name: setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: initialize cache
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-py${{ matrix.python-version }}-${{ hashFiles('ci/requirements/**.txt') }}
restore-keys: |
${{ runner.os }}-pip-py${{ matrix.python-version }}-
- name: upgrade pip
run: |
python -m pip install --upgrade pip setuptools wheel
- name: install dependencies
run: |
python -m pip install -r ci/requirements.txt
- name: install pint-xarray
run: |
python -m pip install .
- name: show versions
run: |
python -c 'import pint_xarray'
- name: run doctests
run: |
python -m pytest --doctest-modules pint_xarray --ignore pint_xarray/tests
- name: checkout
uses: actions/checkout@v4
- name: setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: initialize cache
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-py${{ matrix.python-version }}-${{ hashFiles('ci/requirements/**.txt') }}
restore-keys: |
${{ runner.os }}-pip-py${{ matrix.python-version }}-
- name: upgrade pip
run: |
python -m pip install --upgrade pip setuptools wheel
- name: install dependencies
run: |
python -m pip install -r ci/requirements.txt
- name: install pint-xarray
run: |
python -m pip install .
- name: show versions
run: |
python -c 'import pint_xarray'
- name: run doctests
run: |
python -m pytest --doctest-modules pint_xarray --ignore pint_xarray/tests
118 changes: 59 additions & 59 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: CI

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]
workflow_dispatch:

concurrency:
Expand All @@ -20,13 +20,13 @@ jobs:
outputs:
triggered: ${{ steps.detect-trigger.outputs.trigger-found }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: xarray-contrib/ci-trigger@v1
id: detect-trigger
with:
keyword: "[skip-ci]"
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: xarray-contrib/ci-trigger@v1
id: detect-trigger
with:
keyword: "[skip-ci]"

ci:
name: ${{ matrix.os }} py${{ matrix.python-version }}
Expand Down Expand Up @@ -54,53 +54,53 @@ jobs:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]

steps:
- name: checkout the repository
uses: actions/checkout@v4
with:
# need to fetch all tags to get a correct version
fetch-depth: 0 # fetch all branches and tags

- name: cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: pip-py${{ matrix.python-version }}
restore-keys: |
pip-

- name: setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: upgrade pip
run: python -m pip install --upgrade pip setuptools wheel

- name: install dependencies
run: |
python -m pip install -r ci/requirements.txt

- name: install pint-xarray
run: python -m pip install --no-deps .

- name: show versions
run: python -m pip list

- name: import pint-xarray
run: |
python -c 'import pint_xarray'

- name: run tests
if: success()
id: status
run: |
python -m pytest --cov=pint_xarray --cov-report=xml

- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v5.4.2
with:
file: ./coverage.xml
flags: unittests
env_vars: RUNNER_OS,PYTHON_VERSION
name: codecov-umbrella
fail_ci_if_error: false
- name: checkout the repository
uses: actions/checkout@v4
with:
# need to fetch all tags to get a correct version
fetch-depth: 0 # fetch all branches and tags

- name: cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: pip-py${{ matrix.python-version }}
restore-keys: |
pip-

- name: setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: upgrade pip
run: python -m pip install --upgrade pip setuptools wheel

- name: install dependencies
run: |
python -m pip install -r ci/requirements.txt

- name: install pint-xarray
run: python -m pip install --no-deps .

- name: show versions
run: python -m pip list

- name: import pint-xarray
run: |
python -c 'import pint_xarray'

- name: run tests
if: success()
id: status
run: |
python -m pytest --cov=pint_xarray --cov-report=xml

- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v5.4.2
with:
file: ./coverage.xml
flags: unittests
env_vars: RUNNER_OS,PYTHON_VERSION
name: codecov-umbrella
fail_ci_if_error: false
104 changes: 52 additions & 52 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ name: Nightly CI

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]
schedule:
- cron: "0 0 * * *" # Daily "At 00:00" UTC
- cron: "0 0 * * *" # Daily "At 00:00" UTC

workflow_dispatch:

Expand All @@ -25,13 +25,13 @@ jobs:
outputs:
triggered: ${{ steps.detect-trigger.outputs.trigger-found }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: xarray-contrib/ci-trigger@v1.2
id: detect-trigger
with:
keyword: "[test-upstream]"
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: xarray-contrib/ci-trigger@v1.2
id: detect-trigger
with:
keyword: "[test-upstream]"

upstream-dev:
name: upstream-dev
Expand Down Expand Up @@ -62,45 +62,45 @@ jobs:
FORCE_COLOR: 3

steps:
- name: checkout the repository
uses: actions/checkout@v4
with:
# need to fetch all tags to get a correct version
fetch-depth: 0 # fetch all branches and tags

- name: setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: upgrade pip
run: python -m pip install --upgrade pip

- name: install dependencies
run: |
python -m pip install -r ci/requirements.txt
python -m pip install pytest-reportlog

- name: install upstream-dev dependencies
run: bash ci/install-upstream-dev.sh

- name: install pint-xarray
run: python -m pip install .

- name: show versions
run: python -m pip list

- name: run tests
if: success()
id: status
run: |
python -m pytest -rf --report-log=pytest-log.jsonl

- name: report failures
if: |
failure()
&& steps.tests.outcome == 'failure'
&& github.event_name == 'schedule'
uses: xarray-contrib/issue-from-pytest-log@v1
with:
log-path: pytest-log.jsonl
- name: checkout the repository
uses: actions/checkout@v4
with:
# need to fetch all tags to get a correct version
fetch-depth: 0 # fetch all branches and tags

- name: setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: upgrade pip
run: python -m pip install --upgrade pip

- name: install dependencies
run: |
python -m pip install -r ci/requirements.txt
python -m pip install pytest-reportlog

- name: install upstream-dev dependencies
run: bash ci/install-upstream-dev.sh

- name: install pint-xarray
run: python -m pip install .

- name: show versions
run: python -m pip list

- name: run tests
if: success()
id: status
run: |
python -m pytest -rf --report-log=pytest-log.jsonl

- name: report failures
if: |
failure()
&& steps.tests.outcome == 'failure'
&& github.event_name == 'schedule'
uses: xarray-contrib/issue-from-pytest-log@v1
with:
log-path: pytest-log.jsonl
3 changes: 0 additions & 3 deletions .pep8speaks.yml

This file was deleted.

29 changes: 20 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,24 @@ repos:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-docstring-first
- id: check-yaml
# isort should run before black as black sometimes tweaks the isort output
- repo: https://github.com/pycqa/isort
rev: 6.0.1
- repo: https://github.com/rbubley/mirrors-prettier
rev: v3.5.3
hooks:
- id: isort
- id: prettier
args: ["--cache-location=.prettier_cache/cache"]
- repo: https://github.com/ComPWA/taplo-pre-commit
rev: v0.9.3
hooks:
- id: taplo-format
args: [--option, array_auto_collapse=false]
- id: taplo-lint
args: [--no-schema]
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.24.1
hooks:
- id: validate-pyproject
# https://github.com/python/black#version-control-integration
- repo: https://github.com/psf/black
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 25.1.0
hooks:
- id: black-jupyter
Expand All @@ -26,10 +36,11 @@ repos:
- id: blackdoc
additional_dependencies: ["black==25.1.0"]
- id: blackdoc-autoupdate-black
- repo: https://github.com/pycqa/flake8
rev: 7.2.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.9
hooks:
- id: flake8
- id: ruff
args: [--fix]
- repo: https://github.com/kynan/nbstripout
rev: 0.8.1
hooks:
Expand Down
Loading
Loading