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

ci: downstream test for formulaic #1817

Merged
merged 14 commits into from
Jan 17, 2025
233 changes: 138 additions & 95 deletions .github/workflows/downstream_tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Test Downstream Libraries - Fast

on:
on:
pull_request:
push:
branches: [main]
Expand All @@ -26,31 +26,31 @@ jobs:
cache-dependency-glob: "pyproject.toml"
- name: clone-altair
run: |
git clone https://github.com/vega/altair.git --depth=1
cd altair
git log
git clone https://github.com/vega/altair.git --depth=1
cd altair
git log
- name: install-basics
run: uv pip install --upgrade tox virtualenv setuptools --system
- name: install-altair-dev
run: |
cd altair
uv pip install -e ".[dev, all]" --system
# temporary pin to get ci green
uv pip install "numpy<2.2" --system
cd altair
uv pip install -e ".[dev, all]" --system
# temporary pin to get ci green
uv pip install "numpy<2.2" --system
- name: install-narwhals-dev
run: |
uv pip uninstall narwhals --system
uv pip install -e . --system
uv pip uninstall narwhals --system
uv pip install -e . --system
- name: show-deps
run: uv pip freeze
- name: Run pytest
run: |
cd altair
pytest tests
cd altair
pytest tests
- name: Run mypy
run: |
cd altair
mypy altair tests
cd altair
mypy altair tests

marimo:
strategy:
Expand All @@ -73,45 +73,45 @@ jobs:
cache-dependency-glob: "pyproject.toml"
- name: clone-marimo
run: |
git clone https://github.com/marimo-team/marimo.git --depth=1
cd marimo
uv venv -p 3.12
git log
git clone https://github.com/marimo-team/marimo.git --depth=1
cd marimo
uv venv -p 3.12
git log
- name: install-basics
run: uv pip install --upgrade tox virtualenv setuptools hatch --system
- name: install-marimo-dev
run: |
cd marimo
. .venv/bin/activate
uv pip install -e ".[dev]"
which python
cd marimo
. .venv/bin/activate
uv pip install -e ".[dev]"
which python
- name: install-narwhals-dev
run: |
cd marimo
. .venv/bin/activate
uv pip uninstall narwhals
uv pip install -e ./..
cd marimo
. .venv/bin/activate
uv pip uninstall narwhals
uv pip install -e ./..
- name: show-deps
run: |
cd marimo
. .venv/bin/activate
uv pip freeze
cd marimo
. .venv/bin/activate
uv pip freeze
- name: Create assets directory, copy over index.html
continue-on-error: true
run: |
mkdir -p marimo/marimo/_static/assets
cp marimo/frontend/index.html marimo/marimo/_static/index.html
cp marimo/frontend/public/favicon.ico marimo/marimo/_static/favicon.ico
mkdir -p marimo/marimo/_static/assets
cp marimo/frontend/index.html marimo/marimo/_static/index.html
cp marimo/frontend/public/favicon.ico marimo/marimo/_static/favicon.ico
- name: Run tests with full dependencies
if: ${{ matrix.dependencies == 'core,optional' }}
run: |
cd marimo
. .venv/bin/activate
# make sure that we use the .venv when running tests, so that
# the local narwhals install is picked up
sed -i '/^\[tool.hatch.envs.default\]/a path = ".venv"' pyproject.toml
hatch run python -c "import narwhals; print(narwhals.__file__)"
hatch run test-optional:test-narwhals
cd marimo
. .venv/bin/activate
# make sure that we use the .venv when running tests, so that
# the local narwhals install is picked up
sed -i '/^\[tool.hatch.envs.default\]/a path = ".venv"' pyproject.toml
hatch run python -c "import narwhals; print(narwhals.__file__)"
hatch run test-optional:test-narwhals
timeout-minutes: 15

scikit-lego:
Expand All @@ -138,18 +138,18 @@ jobs:
run: uv pip install --upgrade tox virtualenv setuptools --system
- name: install-scikit-lego-dev
run: |
cd scikit-lego
uv pip install -e ".[test]" --system
cd scikit-lego
uv pip install -e ".[test]" --system
- name: install-narwhals-dev
run: |
uv pip uninstall narwhals --system
uv pip install -e . --system
uv pip uninstall narwhals --system
uv pip install -e . --system
- name: show-deps
run: uv pip freeze
- name: Run pytest
run: |
cd scikit-lego
pytest -n auto --disable-warnings --cov=sklego -m "not cvxpy and not formulaic and not umap"
cd scikit-lego
pytest -n auto --disable-warnings --cov=sklego -m "not cvxpy and not formulaic and not umap"

shiny:
strategy:
Expand All @@ -171,28 +171,28 @@ jobs:
cache-dependency-glob: "pyproject.toml"
- name: clone-shiny
run: |
git clone https://github.com/posit-dev/py-shiny.git
cd py-shiny
git log
git clone https://github.com/posit-dev/py-shiny.git
cd py-shiny
git log
- name: install-basics
run: uv pip install --upgrade tox virtualenv setuptools --system
- name: install-shiny-dev
env:
UV_SYSTEM_PYTHON: 1
run: |
cd py-shiny
make narwhals-install-shiny
cd py-shiny
make narwhals-install-shiny
- name: install-narwhals-dev
run: |
uv pip uninstall narwhals --system
uv pip install -e . --system
uv pip uninstall narwhals --system
uv pip install -e . --system
- name: show-deps
run: uv pip freeze
- name: Run `make narwhals-test-integration`
run: |
cd py-shiny
make narwhals-test-integration
cd py-shiny
make narwhals-test-integration

tea-tasting:
strategy:
matrix:
Expand All @@ -203,9 +203,9 @@ jobs:
- uses: actions/checkout@v4
- name: clone-tea-tasting
run: |
git clone https://github.com/e10v/tea-tasting.git --depth=1
cd tea-tasting
git log
git clone https://github.com/e10v/tea-tasting.git --depth=1
cd tea-tasting
git log
- name: install-pdm
uses: pdm-project/setup-pdm@v4
with:
Expand All @@ -214,22 +214,22 @@ jobs:
cache-dependency-path: tea-tasting/pdm.lock
- name: install-tea-tasting-test
run: |
cd tea-tasting
pdm sync -G test
cd tea-tasting
pdm sync -G test
- name: install-narwhals-dev
run: |
cd tea-tasting
pdm remove narwhals
pdm add ./..[dev]
cd tea-tasting
pdm remove narwhals
pdm add ./..[dev]
- name: show-deps
run: |
cd tea-tasting
pdm list
cd tea-tasting
pdm list
- name: run-pytest
run: |
cd tea-tasting
pdm run test
cd tea-tasting
pdm run test

tubular:
strategy:
matrix:
Expand All @@ -250,25 +250,25 @@ jobs:
cache-dependency-glob: "pyproject.toml"
- name: clone-tubular
run: |
git clone https://github.com/lvgig/tubular --depth=1
cd tubular
git log
git clone https://github.com/lvgig/tubular --depth=1
cd tubular
git log
- name: install-basics
run: uv pip install --upgrade tox virtualenv setuptools pytest-env --system
- name: install-tubular-dev
run: |
cd tubular
uv pip install -e ".[dev]" --system
cd tubular
uv pip install -e ".[dev]" --system
- name: install-narwhals-dev
run: |
uv pip uninstall narwhals --system
uv pip install -e . --system
uv pip uninstall narwhals --system
uv pip install -e . --system
- name: show-deps
run: uv pip freeze
- name: Run pytest
run: |
cd tubular
pytest tests --config-file=pyproject.toml
cd tubular
pytest tests --config-file=pyproject.toml

plotly:
strategy:
Expand All @@ -290,25 +290,25 @@ jobs:
cache-dependency-glob: "pyproject.toml"
- name: clone-plotly
run: |
git clone https://github.com/plotly/plotly.py --depth=1
cd plotly.py
git log
git clone https://github.com/plotly/plotly.py --depth=1
cd plotly.py
git log
- name: install-basics
run: uv pip install --upgrade tox virtualenv setuptools --system
- name: install-deps
run: |
cd plotly.py
uv pip install -r packages/python/plotly/test_requirements/requirements_312_optional.txt --system
cd plotly.py
uv pip install -r packages/python/plotly/test_requirements/requirements_312_optional.txt --system
- name: install-narwhals-dev
run: |
uv pip uninstall narwhals --system
uv pip install -e . --system
uv pip uninstall narwhals --system
uv pip install -e . --system
- name: show-deps
run: uv pip freeze
- name: Run pytest on plotly express
run: |
cd plotly.py
pytest packages/python/plotly/plotly/tests/test_optional/test_px
cd plotly.py
pytest packages/python/plotly/plotly/tests/test_optional/test_px

hierarchicalforecast:
strategy:
Expand All @@ -330,22 +330,65 @@ jobs:
cache-dependency-glob: "pyproject.toml"
- name: clone-hierarchicalforecast
run: |
git clone https://github.com/Nixtla/hierarchicalforecast --depth=1
cd hierarchicalforecast
git log
git clone https://github.com/Nixtla/hierarchicalforecast --depth=1
cd hierarchicalforecast
git log
- name: install-basics
run: uv pip install --upgrade tox virtualenv setuptools --system
- name: install-deps
run: |
cd hierarchicalforecast
uv pip install --system ".[dev]"
cd hierarchicalforecast
uv pip install --system ".[dev]"
- name: install-narwhals-dev
run: |
uv pip uninstall narwhals --system
uv pip install -e . --system
uv pip uninstall narwhals --system
uv pip install -e . --system
- name: show-deps
run: uv pip freeze
- name: Run tests
run: |
cd hierarchicalforecast
nbdev_test --do_print --timing --n_workers 0
cd hierarchicalforecast
nbdev_test --do_print --timing --n_workers 0

formulaic:
strategy:
matrix:
python-version: ["3.12"]
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: "true"
cache-suffix: ${{ matrix.python-version }}
cache-dependency-glob: "pyproject.toml"
- name: clone-formulaic
run: |
git clone https://github.com/matthewwardrop/formulaic.git --depth=1
cd formulaic
git log
- name: create-hatch-env
run: |
cd formulaic
uv pip install hatch hatch-vcs --system
- name: install-formulaic-dev
run: |
cd formulaic
hatch run uv pip install -e ".[arrow,calculus]"
- name: install-narwhals-dev
run: |
cd formulaic
hatch run uv pip uninstall narwhals
hatch run uv pip install -e ./..
- name: show-deps
run: hatch run uv pip freeze
- name: run test
run: |
cd formulaic
hatch run tests --config-file=pyproject.toml
Loading