Make tests independent of implementation #573
Workflow file for this run
This file contains 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: ci | |
on: | |
pull_request: | |
push: | |
branches: [main] | |
jobs: | |
tox: | |
strategy: | |
matrix: | |
python-version: ["3.9", "3.10", "3.11"] | |
os: [windows-latest, ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Cache multiple paths | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/pip | |
$RUNNER_TOOL_CACHE/Python/* | |
~\AppData\Local\pip\Cache | |
key: ${{ runner.os }}-build-${{ matrix.python-version }} | |
- name: install-reqs | |
run: python -m pip install --upgrade tox virtualenv setuptools pip -r requirements-dev.txt | |
- name: Run pytest | |
run: | | |
pytest tests --cov=dataframe_api_compat/pandas_standard --cov=tests --cov-append --cov-report= --library pandas-numpy | |
pytest tests --cov=dataframe_api_compat/pandas_standard --cov=tests --cov-append --cov-report= --library pandas-nullable | |
pytest tests --cov=dataframe_api_compat/polars_standard --cov=tests --cov-append --cov-report= --cov-fail-under=100 --library polars-lazy | |
- name: install type-checking reqs | |
run: python -m pip install 'git+https://github.com/data-apis/dataframe-api.git#egg=dataframe_api&subdirectory=spec/API_specification' mypy typing-extensions | |
- name: run mypy | |
run: mypy dataframe_api_compat tests | |
- name: run polars integration tests | |
run: pip uninstall pandas -y && pytest tests/integration/upstream_test.py::TestPolars && pip install -U pandas | |
- name: run pandas integration tests | |
run: pip uninstall polars -y && pytest tests/integration/upstream_test.py::TestPandas | |
tox-all-supported: | |
strategy: | |
matrix: | |
python-version: ["3.8"] | |
os: [windows-latest, ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Cache multiple paths | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/pip | |
$RUNNER_TOOL_CACHE/Python/* | |
~\AppData\Local\pip\Cache | |
key: ${{ runner.os }}-build-${{ matrix.python-version }} | |
- name: install package | |
run: pip install -e . | |
- name: install-reqs | |
run: python -m pip install --pre --upgrade tox virtualenv setuptools pip -r requirements-dev.txt | |
- name: Run pytest | |
run: pytest tests --cov=dataframe_api_compat --cov=tests --cov-fail-under=50 | |
# todo: add mypy here too! | |
- name: run polars integration tests | |
run: pip uninstall pandas -y && pytest tests/integration/upstream_test.py::TestPolars && pip install -U pandas && pip uninstall polars -y && pytest tests/integration/upstream_test.py::TestPandas |