Skip to content
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

Upstream CI #20

Merged
merged 3 commits into from
Mar 10, 2024
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
24 changes: 24 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ on:
pull_request:
branches: ['*']

# When this workflow is queued, automatically cancel any previous running
# or pending jobs from the same branch
concurrency:
group: tests-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
shell: bash -l {0}
Expand Down Expand Up @@ -63,6 +69,10 @@ jobs:
- os: windows
python-version: '3.12'
requirements: no_optionals
# Test on nightly builds of requirements
- os: ubuntu
python-version: '3.12'
requirements: upstream

steps:
- name: Checkout
Expand All @@ -80,6 +90,20 @@ jobs:
environment-file: ci/requirements-${{ matrix.requirements }}.yml
activate-environment: recursive_diff

- name: Install nightly builds
if: ${{ matrix.requirements == 'upstream' }}
run: |
# Pick up https://github.com/mamba-org/mamba/pull/2903
mamba install -n base 'mamba>=1.5.2'

mamba uninstall --force numpy pandas scipy pyarrow
python -m pip install --no-deps --pre --prefer-binary \
--extra-index-url https://pypi.fury.io/arrow-nightlies/ \
pyarrow
python -m pip install --no-deps --pre \
-i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple \
numpy pandas scipy

- name: Show conda options
run: conda config --show

Expand Down
19 changes: 19 additions & 0 deletions ci/requirements-upstream.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: recursive_diff
channels:
- conda-forge
dependencies:
- pytest
- pytest-cov
- packaging

- xarray
- dask
- h5netcdf # NetCDF engine
- scipy # NetCDF engine

- pip
- pip:
- git+https://github.com/dask/dask
- git+https://github.com/dask/distributed
- git+https://github.com/pydata/xarray
# numpy, pandas, pyarrow, and scipy are upgraded to nightly builds by pytest.yml
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ python_files = ["test_*.py"]
testpaths = ["recursive_diff/tests"]
filterwarnings = [
"error",
# Raised internally by pandas
'ignore:datetime.datetime.utcfromtimestamp\(\) is deprecated:DeprecationWarning',
# numpy <1.26 only
'ignore:elementwise comparison failed:DeprecationWarning',
'ignore:elementwise comparison failed:FutureWarning',
Expand Down
7 changes: 5 additions & 2 deletions recursive_diff/tests/test_recursive_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,13 +534,16 @@ def test_xarray():
ds2.attrs["some2"] = 2
ds2.attrs["other"] = "someval"

# Older versions of xarray don't have the 'Size 24B' bit
d1_str = str(ds1["d1"].stack({"__stacked__": ["x"]})).splitlines()[0].strip()

check(
ds1,
ds2,
"[attrs]: Pair other:someval is in RHS only",
"[attrs][some2]: 1 != 2 (abs: 1.0e+00, rel: 1.0e+00)",
"[coords][nonindex][x=x2]: ni2 != ni4",
"[data_vars]: Pair d1:<xarray.DataArray 'd1' (__stacked__: 3)> ... is in LHS only", # noqa: E501
f"[data_vars]: Pair d1:{d1_str} ... is in LHS only",
"[data_vars][d2][x=x1, y=y1]: 4 != 10 (abs: 6.0e+00, rel: 1.5e+00)",
)

Expand All @@ -549,7 +552,7 @@ def test_xarray():
ds2,
"[attrs]: Pair other:someval is in RHS only",
"[coords][nonindex][x=x2]: ni2 != ni4",
"[data_vars]: Pair d1:<xarray.DataArray 'd1' (__stacked__: 3)> ... is in LHS only", # noqa: E501
f"[data_vars]: Pair d1:{d1_str} ... is in LHS only",
abs_tol=7,
)

Expand Down
Loading