chore: Support @requires.backend_version
in namespaces
#12156
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Min, old, and nightly versions | |
on: | |
pull_request: | |
push: | |
branches: [main] | |
env: | |
PY_COLORS: 1 | |
PYTEST_ADDOPTS: "--numprocesses=logical" | |
jobs: | |
minimum_versions: | |
strategy: | |
matrix: | |
python-version: ["3.9"] | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v5 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install uv | |
uses: astral-sh/setup-uv@v6 | |
with: | |
enable-cache: "true" | |
cache-suffix: min-versions-${{ matrix.python-version }} | |
cache-dependency-glob: "pyproject.toml" | |
- name: install-minimum-versions | |
run: uv pip install pipdeptree tox virtualenv setuptools pandas==1.1.3 polars==0.20.4 numpy==1.19.3 pyarrow==13.0.0 "pyarrow-stubs<17" scipy==1.6.0 scikit-learn==1.1.0 duckdb==1.0 tzdata --system | |
- name: install-reqs | |
run: | | |
uv pip install -e . --group tests --system | |
- name: show-deps | |
run: uv pip freeze | |
- name: Assert dependencies | |
run: | | |
DEPS=$(uv pip freeze) | |
echo "$DEPS" | grep 'pandas==1.1.3' | |
echo "$DEPS" | grep 'polars==0.20.4' | |
echo "$DEPS" | grep 'numpy==1.19.3' | |
echo "$DEPS" | grep 'pyarrow==13.0.0' | |
echo "$DEPS" | grep 'scipy==1.6.0' | |
echo "$DEPS" | grep 'scikit-learn==1.1.0' | |
echo "$DEPS" | grep 'duckdb==1.0' | |
- name: Run pytest | |
run: pytest tests --cov=narwhals --cov=tests --cov-fail-under=50 --runslow --constructors=pandas,pyarrow,polars[eager],polars[lazy] | |
pretty_old_versions: | |
strategy: | |
matrix: | |
python-version: ["3.9"] | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v5 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install uv | |
uses: astral-sh/setup-uv@v6 | |
with: | |
enable-cache: "true" | |
cache-suffix: pretty-old-versions-${{ matrix.python-version }} | |
cache-dependency-glob: "pyproject.toml" | |
- name: install-pretty-old-versions | |
run: uv pip install pipdeptree tox virtualenv setuptools pandas==1.1.5 polars==0.20.4 numpy==1.19.3 pyarrow==14.0.0 "pyarrow-stubs<17" scipy==1.6.0 scikit-learn==1.1.0 duckdb==1.0 tzdata --system | |
- name: install-reqs | |
run: uv pip install -e . --group tests --system | |
- name: show-deps | |
run: uv pip freeze | |
- name: show-deptree | |
run: pipdeptree | |
- name: Assert pretty old versions dependencies | |
run : | | |
DEPS=$(uv pip freeze) | |
echo "$DEPS" | grep 'pandas==1.1.5' | |
echo "$DEPS" | grep 'polars==0.20.4' | |
echo "$DEPS" | grep 'numpy==1.19.3' | |
echo "$DEPS" | grep 'pyarrow==14.0.0' | |
echo "$DEPS" | grep 'scipy==1.6.0' | |
echo "$DEPS" | grep 'scikit-learn==1.1.0' | |
echo "$DEPS" | grep 'duckdb==1.0' | |
- name: Run pytest | |
run: pytest tests --cov=narwhals --cov=tests --cov-fail-under=50 --runslow --constructors=pandas,pyarrow,polars[eager],polars[lazy] | |
not_so_old_versions: | |
strategy: | |
matrix: | |
python-version: ["3.10"] | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v5 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install uv | |
uses: astral-sh/setup-uv@v6 | |
with: | |
enable-cache: "true" | |
cache-suffix: not-so-old-versions-${{ matrix.python-version }} | |
cache-dependency-glob: "pyproject.toml" | |
- name: install-not-so-old-versions | |
run: uv pip install tox virtualenv setuptools pandas==2.0.3 polars==0.20.8 numpy==1.24.4 pyarrow==15.0.0 "pyarrow-stubs<17" scipy==1.8.0 scikit-learn==1.3.0 duckdb==1.0 dask[dataframe]==2024.10 tzdata --system | |
- name: install-reqs | |
run: uv pip install -e . --group tests --system | |
- name: show-deps | |
run: uv pip freeze | |
- name: Assert not so old versions dependencies | |
run : | | |
DEPS=$(uv pip freeze) | |
echo "$DEPS" | grep 'pandas==2.0.3' | |
echo "$DEPS" | grep 'polars==0.20.8' | |
echo "$DEPS" | grep 'numpy==1.24.4' | |
echo "$DEPS" | grep 'pyarrow==15.0.0' | |
echo "$DEPS" | grep 'scipy==1.8.0' | |
echo "$DEPS" | grep 'scikit-learn==1.3.0' | |
echo "$DEPS" | grep 'dask==2024.10' | |
echo "$DEPS" | grep 'duckdb==1.0' | |
- name: Run pytest | |
run: pytest tests --cov=narwhals --cov=tests --cov-fail-under=50 --runslow --constructors=pandas,pyarrow,polars[eager],polars[lazy],dask | |
nightlies: | |
strategy: | |
matrix: | |
python-version: ["3.12"] | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v5 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install uv | |
uses: astral-sh/setup-uv@v6 | |
with: | |
enable-cache: "true" | |
cache-suffix: nightlies-${{ matrix.python-version }} | |
cache-dependency-glob: "pyproject.toml" | |
- name: install-reqs | |
run: uv pip install -e . --group tests --system | |
- name: install polars pre-release | |
run: | | |
uv pip uninstall polars --system | |
uv pip install -U --pre polars --system | |
- name: install-pandas-nightly | |
run: | | |
uv pip uninstall pandas --system | |
uv pip install pandas --pre --index https://pypi.anaconda.org/scientific-python-nightly-wheels/simple --system -U | |
- name: install pyarrow nightly | |
run: | | |
# commented out nightly whilst it fails to install | |
uv pip install -U pyarrow --system | |
# uv pip uninstall pyarrow --system | |
# uv pip install pyarrow --pre --index https://pypi.fury.io/arrow-nightlies/ --system -U | |
- name: install numpy nightly | |
run: | | |
uv pip uninstall numpy --system | |
uv pip install numpy --pre --index https://pypi.anaconda.org/scientific-python-nightly-wheels/simple --system -U | |
- name: install dask | |
run: | | |
uv pip uninstall dask dask-expr --system | |
python -m pip install git+https://github.com/dask/distributed git+https://github.com/dask/dask | |
- name: install duckdb nightly | |
run: | | |
uv pip uninstall duckdb --system | |
uv pip install -U --pre duckdb --system | |
- name: show-deps | |
run: uv pip freeze | |
- name: Assert nightlies dependencies | |
run: | | |
DEPS=$(uv pip freeze) | |
echo "$DEPS" | grep 'pandas.*dev' | |
# echo "$DEPS" | grep 'pyarrow.*dev' | |
echo "$DEPS" | grep 'numpy.*dev' | |
echo "$DEPS" | grep 'dask.*@' | |
- name: Run pytest | |
run: | | |
pytest tests --cov=narwhals --cov=tests --cov-fail-under=50 --runslow \ | |
--constructors=pandas,pandas[nullable],pandas[pyarrow],pyarrow,polars[eager],polars[lazy],dask,duckdb |