From 4b7612e5649058475223cdfbb1bf50910b70ff5b Mon Sep 17 00:00:00 2001 From: Tom Nicholas Date: Sun, 20 Oct 2024 14:29:06 -0600 Subject: [PATCH] Add CI job for testing upstream versions of dependencies (#264) * add new CI workflow * add environment with various bleeding edge branches * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix bad yaml formatting * install pip via conda and correct indentation again * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * formatting again * Note about kerchunk * Add comments about zarr-python v3 compatibility branches * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .github/workflows/upstream.yml | 60 ++++++++++++++++++++++++++++++++++ ci/upstream.yml | 30 +++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 .github/workflows/upstream.yml create mode 100644 ci/upstream.yml diff --git a/.github/workflows/upstream.yml b/.github/workflows/upstream.yml new file mode 100644 index 00000000..9140896b --- /dev/null +++ b/.github/workflows/upstream.yml @@ -0,0 +1,60 @@ +name: upstream + +on: + push: + branches: [ "main" ] + paths-ignore: + - 'docs/**' + pull_request: + branches: [ "main" ] + paths-ignore: + - 'docs/**' + schedule: + - cron: "0 0 * * *" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + + test: + name: ${{ matrix.python-version }}-build + runs-on: ubuntu-latest + defaults: + run: + shell: bash -l {0} + strategy: + matrix: + python-version: ["3.12"] + steps: + - uses: actions/checkout@v4 + + - name: Setup micromamba + uses: mamba-org/setup-micromamba@v1 + with: + environment-file: ci/upstream.yml + cache-environment: true + create-args: >- + python=${{matrix.python-version}} + + - name: Install virtualizarr + run: | + python -m pip install -e . --no-deps + - name: Conda list information + run: | + conda env list + conda list + + - name: Running Tests + run: | + python -m pytest ./virtualizarr --cov=./ --cov-report=xml --verbose + + - name: Upload code coverage to Codecov + uses: codecov/codecov-action@v3.1.4 + with: + file: ./coverage.xml + flags: unittests + env_vars: OS,PYTHON + name: codecov-umbrella + fail_ci_if_error: false diff --git a/ci/upstream.yml b/ci/upstream.yml new file mode 100644 index 00000000..184c6710 --- /dev/null +++ b/ci/upstream.yml @@ -0,0 +1,30 @@ +name: virtualizarr-min-deps +channels: + - conda-forge + - nodefaults +dependencies: + - h5netcdf + - h5py + - hdf5 + - netcdf4 + - numpy>=2.0.0 + - packaging + - ujson + - universal_pathlib + # Testing + - codecov + - pre-commit + - mypy + - ruff + - pandas-stubs + - pytest-mypy + - pytest-cov + - pytest + - pooch + - fsspec + - pip + - pip: + - zarr==3.0.0b1 # beta release of zarr-python v3 + - git+https://github.com/pydata/xarray@zarr-v3 # zarr-v3 compatibility branch + - git+https://github.com/zarr-developers/numcodecs@zarr3-codecs # zarr-v3 compatibility branch + # - git+https://github.com/fsspec/kerchunk@main # kerchunk is currently incompatible with zarr-python v3 (https://github.com/fsspec/kerchunk/pull/516)