Skip to content

Port project to pixi and QuantCo OSS copier template #1595

Port project to pixi and QuantCo OSS copier template

Port project to pixi and QuantCo OSS copier template #1595

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- "main"
- "pre-commit-autoupdate"
- "update-pixi"
tags:
- "*"
schedule:
# daily (`@daily` not supported, see
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events )
#
# Runs on default/base branch (see
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onschedule )
- cron: "0 0 * * *"
jobs:
pre-commit:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Set up pixi
uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659 # v0.8.1
with:
environments: default lint
- name: pre-commit
run: pixi run pre-commit-run --color=always --show-diff-on-failure
tests:
strategy:
fail-fast: false
matrix:
numfocus_nightly: [false]
os: ["ubuntu-latest"]
pandas: [""]
pyarrow: ["4.0.1", "nightly"]
python: ["py311"]
include:
- numfocus_nightly: true
os: "ubuntu-latest"
pandas: ""
pyarrow: "nightly"
python: "py311"
- numfocus_nightly: false
os: "ubuntu-latest"
pandas: "1.5.3"
pyarrow: "13.0.0"
python: "py311"
- numfocus_nightly: false
os: "ubuntu-latest"
pandas: ""
pyarrow: "7.0.0"
python: "py311"
- numfocus_nightly: false
os: "ubuntu-latest"
pandas: ""
pyarrow: "8.0.1"
python: "py311"
- numfocus_nightly: false
os: "ubuntu-latest"
pandas: ""
pyarrow: "9.0.0"
python: "py311"
- numfocus_nightly: false
os: "ubuntu-latest"
pandas: ""
pyarrow: "10.0.1"
python: "py311"
- numfocus_nightly: false
os: "ubuntu-latest"
pandas: ""
pyarrow: "11.0.0"
python: "py311"
- numfocus_nightly: false
os: "ubuntu-latest"
pandas: ""
pyarrow: "12.0.0"
python: "py311"
- numfocus_nightly: false
os: "ubuntu-latest"
pandas: ""
pyarrow: "13.0.0"
python: "py311"
- numfocus_nightly: false
os: "ubuntu-latest"
pandas: ""
pyarrow: "13.0.0"
python: "py312"
- numfocus_nightly: false
os: "ubuntu-latest"
pandas: ""
pyarrow: "14.0.1"
python: "py312"
- numfocus_nightly: false
os: "ubuntu-latest"
pandas: ""
pyarrow: "15.0.0"
python: "py312"
- numfocus_nightly: false
os: "ubuntu-latest"
pandas: ""
pyarrow: "18.1.0"
python: "py312"
continue-on-error: ${{ matrix.numfocus_nightly || matrix.pyarrow == 'nightly' }}
runs-on: ${{ matrix.os }}
defaults:
run:
# see https://github.com/conda-incubator/setup-miniconda/#important
shell: bash -l {0}
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Set up pixi
uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659 # v0.8.1
with:
environments: ${{ matrix.python }} # References the environments defined in pixi.toml
- name: Install Pyarrow (non-nightly)
run: pixi add pyarrow=${{ matrix.pyarrow }}
if: matrix.pyarrow != 'nightly' && matrix.pandas == ''
- name: Install Pyarrow (nightly)
# Install both arrow-cpp and pyarrow to make sure that we have the
# latest nightly of both packages. It is sadly not guaranteed that the
# nightlies and the latest release would otherwise work together.
# FIXME: The nightlies channel is currently empty: https://github.com/apache/arrow/issues/41856
run: pixi update arrow-cpp pyarrow
if: matrix.pyarrow == 'nightly'
- name: Install Pyarrow (downgrade pandas)
run: pixi add pyarrow==${{ matrix.pyarrow }} pandas==${{ matrix.pandas }}
if: matrix.pyarrow != 'nightly' && matrix.pandas != ''
- name: Pip Install NumFOCUS nightly
# NumFOCUS nightly wheels, contains numpy and pandas
# TODO(gh-45): Re-add numpy
run: pixi run python -m pip install --pre --upgrade --timeout=60 --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple/ pandas
if: matrix.numfocus_nightly
- name: Install repository
run: pixi run postinstall
- name: Test import
run: |
pixi run python -c "import plateau"
pixi run python -c "import plateau.api"
pixi run python -c "import plateau.api.dataset"
pixi run python -c "import plateau.api.serialization"
pixi run python -c "import plateau.core"
pixi run python -c "import plateau.io"
pixi run python -c "import plateau.io_components"
pixi run python -c "import plateau.serialization"
pixi run python -c "import plateau.utils"
- name: Pytest
# FIXME: Add `-n auto` again to allow for parallelism here.
run: pixi run test-coverage
- name: Codecov
uses: codecov/codecov-action@v5.1.1
with:
file: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
name: pytest-numfocus_nightly_${{ matrix.numfocus_nightly }}-os_${{ matrix.os }}-pyarrow_${{ matrix.pyarrow }}-${{ matrix.python }}