Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into read_grid_mapping…
Browse files Browse the repository at this point in the history
…_and_bounds_as_coords

* upstream/master: (51 commits)
  Ensure maximum accuracy when encoding and decoding cftime.datetime values (pydata#4758)
  Fix `bounds_error=True` ignored with 1D interpolation (pydata#4855)
  add a drop_conflicts strategy for merging attrs (pydata#4827)
  update pre-commit hooks (mypy) (pydata#4883)
  ensure warnings cannot become errors in assert_ (pydata#4864)
  update pre-commit hooks (pydata#4874)
  small fixes for the docstrings of swap_dims and integrate (pydata#4867)
  Modify _encode_datetime_with_cftime for compatibility with cftime > 1.4.0 (pydata#4871)
  vélin (pydata#4872)
  don't skip the doctests CI (pydata#4869)
  fix da.pad example for numpy 1.20 (pydata#4865)
  temporarily pin dask (pydata#4873)
  Add units if "unit" is in the attrs. (pydata#4850)
  speed up the repr for big MultiIndex objects (pydata#4846)
  dim -> coord in DataArray.integrate (pydata#3993)
  WIP: backend interface, now it uses subclassing  (pydata#4836)
  weighted: small improvements (pydata#4818)
  Update related-projects.rst (pydata#4844)
  iris update doc url (pydata#4845)
  Faster unstacking (pydata#4746)
  ...
  • Loading branch information
dcherian committed Feb 11, 2021
2 parents 9ee7c3a + 10f0227 commit b65e579
Show file tree
Hide file tree
Showing 117 changed files with 2,794 additions and 1,578 deletions.
4 changes: 1 addition & 3 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ contact_links:
url: https://github.com/pydata/xarray/discussions
about: |
Ask questions and discuss with other community members here.
If you have a question like "How do I concatenate a list of datasets?" then
If you have a question like "How do I concatenate a list of datasets?" then
please include a self-contained reproducible example if possible.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

- [ ] Closes #xxxx
- [ ] Tests added
- [ ] Passes `isort . && black . && mypy . && flake8`
- [ ] Passes `pre-commit run --all-files`
- [ ] User visible changes (including notable bug fixes) are documented in `whats-new.rst`
- [ ] New functions/methods are listed in `api.rst`
29 changes: 29 additions & 0 deletions .github/actions/detect-ci-trigger/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Detect CI Trigger
description: |
Detect a keyword used to control the CI in the subject line of a commit message.
inputs:
keyword:
description: |
The keyword to detect.
required: true
outputs:
trigger-found:
description: |
true if the keyword has been found in the subject line of the commit message
value: ${{ steps.detect-trigger.outputs.CI_TRIGGERED }}
runs:
using: "composite"
steps:
- name: detect trigger
id: detect-trigger
run: |
bash $GITHUB_ACTION_PATH/script.sh ${{ github.event_name }} ${{ inputs.keyword }}
shell: bash
- name: show detection result
run: |
echo "::group::final summary"
echo "commit message: ${{ steps.detect-trigger.outputs.COMMIT_MESSAGE }}"
echo "trigger keyword: ${{ inputs.keyword }}"
echo "trigger found: ${{ steps.detect-trigger.outputs.CI_TRIGGERED }}"
echo "::endgroup::"
shell: bash
47 changes: 47 additions & 0 deletions .github/actions/detect-ci-trigger/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/usr/bin/env bash
event_name="$1"
keyword="$2"

echo "::group::fetch a sufficient number of commits"
echo "skipped"
# git log -n 5 2>&1
# if [[ "$event_name" == "pull_request" ]]; then
# ref=$(git log -1 --format='%H')
# git -c protocol.version=2 fetch --deepen=2 --no-tags --prune --progress -q origin $ref 2>&1
# git log FETCH_HEAD
# git checkout FETCH_HEAD
# else
# echo "nothing to do."
# fi
# git log -n 5 2>&1
echo "::endgroup::"

echo "::group::extracting the commit message"
echo "event name: $event_name"
if [[ "$event_name" == "pull_request" ]]; then
ref="HEAD^2"
else
ref="HEAD"
fi

commit_message="$(git log -n 1 --pretty=format:%s "$ref")"

if [[ $(echo $commit_message | wc -l) -le 1 ]]; then
echo "commit message: '$commit_message'"
else
echo -e "commit message:\n--- start ---\n$commit_message\n--- end ---"
fi
echo "::endgroup::"

echo "::group::scanning for the keyword"
echo "searching for: '$keyword'"
if echo "$commit_message" | grep -qF "$keyword"; then
result="true"
else
result="false"
fi
echo "keyword detected: $result"
echo "::endgroup::"

echo "::set-output name=COMMIT_MESSAGE::$commit_message"
echo "::set-output name=CI_TRIGGERED::$result"
2 changes: 1 addition & 1 deletion .github/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ limitPerRun: 1 # start with a small number

# issues:
# exemptLabels:
# - confirmed
# - confirmed
189 changes: 189 additions & 0 deletions .github/workflows/ci-additional.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
name: CI Additional
on:
push:
branches:
- "*"
pull_request:
branches:
- "*"
workflow_dispatch: # allows you to trigger manually

jobs:
detect-ci-trigger:
name: detect ci trigger
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event_name == 'pull_request'
outputs:
triggered: ${{ steps.detect-trigger.outputs.trigger-found }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- uses: ./.github/actions/detect-ci-trigger
id: detect-trigger
with:
keyword: "[skip-ci]"

test:
name: ${{ matrix.os }} ${{ matrix.env }}
runs-on: ${{ matrix.os }}
needs: detect-ci-trigger
if: needs.detect-ci-trigger.outputs.triggered == 'false'
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
env:
[
"py37-bare-minimum",
"py37-min-all-deps",
"py37-min-nep18",
"py38-all-but-dask",
"py38-backend-api-v2",
"py38-flaky",
]
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Fetch all history for all branches and tags.

- name: Set environment variables
run: |
if [[ ${{ matrix.env }} == "py38-backend-api-v2" ]] ;
then
echo "CONDA_ENV_FILE=ci/requirements/environment.yml" >> $GITHUB_ENV
echo "XARRAY_BACKEND_API=v2" >> $GITHUB_ENV
elif [[ ${{ matrix.env }} == "py38-flaky" ]] ;
then
echo "CONDA_ENV_FILE=ci/requirements/environment.yml" >> $GITHUB_ENV
echo "PYTEST_EXTRA_FLAGS=--run-flaky --run-network-tests" >> $GITHUB_ENV
else
echo "CONDA_ENV_FILE=ci/requirements/${{ matrix.env }}.yml" >> $GITHUB_ENV
fi
- name: Cache conda
uses: actions/cache@v2
with:
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-conda-${{ matrix.env }}-${{
hashFiles('ci/requirements/**.yml') }}

- uses: conda-incubator/setup-miniconda@v2
with:
channels: conda-forge
channel-priority: strict
mamba-version: "*"
activate-environment: xarray-tests
auto-update-conda: false
python-version: 3.8
use-only-tar-bz2: true

- name: Install conda dependencies
run: |
mamba env update -f $CONDA_ENV_FILE
- name: Install xarray
run: |
python -m pip install --no-deps -e .
- name: Version info
run: |
conda info -a
conda list
python xarray/util/print_versions.py
- name: Import xarray
run: |
python -c "import xarray"
- name: Run tests
run: |
python -m pytest -n 4 \
--cov=xarray \
--cov-report=xml \
$PYTEST_EXTRA_FLAGS
- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
flags: unittests,${{ matrix.env }}
env_vars: RUNNER_OS
name: codecov-umbrella
fail_ci_if_error: false
doctest:
name: Doctests
runs-on: "ubuntu-latest"
defaults:
run:
shell: bash -l {0}

steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
- uses: conda-incubator/setup-miniconda@v2
with:
channels: conda-forge
channel-priority: strict
mamba-version: "*"
activate-environment: xarray-tests
auto-update-conda: false
python-version: "3.8"

- name: Install conda dependencies
run: |
mamba env update -f ci/requirements/environment.yml
- name: Install xarray
run: |
python -m pip install --no-deps -e .
- name: Version info
run: |
conda info -a
conda list
python xarray/util/print_versions.py
- name: Run doctests
run: |
python -m pytest --doctest-modules xarray --ignore xarray/tests
min-version-policy:
name: Minimum Version Policy
runs-on: "ubuntu-latest"
needs: detect-ci-trigger
if: needs.detect-ci-trigger.outputs.triggered == 'false'
defaults:
run:
shell: bash -l {0}

steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
- uses: conda-incubator/setup-miniconda@v2
with:
channels: conda-forge
channel-priority: strict
mamba-version: "*"
auto-update-conda: false
python-version: "3.8"

- name: minimum versions policy
run: |
mamba install -y pyyaml conda
python ci/min_deps_check.py ci/requirements/py37-bare-minimum.yml
python ci/min_deps_check.py ci/requirements/py37-min-all-deps.yml
16 changes: 16 additions & 0 deletions .github/workflows/ci-pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: linting

on:
push:
branches: "*"
pull_request:
branches: "*"

jobs:
linting:
name: "pre-commit hooks"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/[email protected]
Loading

0 comments on commit b65e579

Please sign in to comment.