Update numpy #2923
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: Tests | |
on: [push, pull_request, workflow_dispatch] | |
env: | |
DOWNLOAD_CACHE_DIR: /home/runner/scikit_learn_data | |
LALE_DOWNLOAD_CACHE_DIR: /home/runner/scikit_learn_data/lale | |
jobs: | |
static: | |
name: static checks / linters | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [3.9, '3.10', '3.11', '3.12'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
cache: 'pip' | |
cache-dependency-path: setup.py | |
python-version: ${{ matrix.python-version }} | |
- name: Install numpy | |
run: pip install -U numpy | |
- name: Install dependencies | |
run: pip install --upgrade --upgrade-strategy eager .[full,test,dev] | |
- name: Force newest numpy | |
run: pip install --upgrade --upgrade-strategy eager numpy | |
- name: Force newest numpy | |
run: pip install --upgrade --upgrade-strategy eager numpy | |
- name: pip list packages | |
run: pip list | |
- name: show pip dependencies | |
run: | | |
pip install pipdeptree | |
pipdeptree -fl | |
- name: pre-commit checks | |
run: pre-commit run -a | |
docs: | |
name: Documentation build | |
runs-on: ubuntu-latest | |
needs: [static] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9 | |
cache: 'pip' | |
cache-dependency-path: setup.py | |
- name: Install doc dependencies | |
run: pip install -r docs/requirements.txt | |
- name: Install lale | |
run: pip install --no-dependencies -e . | |
- name: Force newest numpy | |
run: pip install --upgrade --upgrade-strategy eager numpy | |
- name: pip list packages | |
run: pip list | |
- name: Install latex (used for math notation in sphinx) | |
run: > | |
sudo apt-get update -y && | |
sudo apt-get install -y | |
latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended | |
dvipng librsvg2-bin | |
- name: Run sphinx | |
run: sphinx-build "." "_build" -W --keep-going | |
working-directory: ./docs | |
download_data: | |
name: Download data used for tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
cache: 'pip' | |
cache-dependency-path: setup.py | |
- name: Install numpy | |
run: pip install -U numpy | |
- name: Install dependencies | |
run: pip install --upgrade --upgrade-strategy eager .[full,test,dev] | |
- name: Force newest numpy | |
run: pip install --upgrade --upgrade-strategy eager numpy | |
- name: pip list packages | |
run: pip list | |
- name: show pip dependencies | |
run: | | |
pip install pipdeptree | |
pipdeptree -fl | |
- name: Cache test data restore | |
uses: actions/cache/restore@v4 | |
with: | |
path: ${{ env.DOWNLOAD_CACHE_DIR }} | |
key: ${{ runner.os }}-dcache-new3-${{ env.DOWNLOAD_CACHE_DIR }}-${{ hashFiles('lale/datasets/prefetch.py') }} | |
restore-keys: | | |
${{ runner.os }}-dcache-new3-${{ env.DOWNLOAD_CACHE_DIR }}- | |
${{ runner.os }}-dcache-new3 | |
- name: Download the test data | |
run: python lale/datasets/prefetch.py | |
- name: Cache test data save | |
uses: actions/cache/save@v4 | |
with: | |
path: ${{ env.DOWNLOAD_CACHE_DIR }} | |
key: ${{ runner.os }}-dcache-new3-${{ env.DOWNLOAD_CACHE_DIR }}-${{ hashFiles('lale/datasets/prefetch.py') }} | |
# test_matrix_pr and test_matrix_master have a lot of redundancy | |
# If GitHub actions adds support for conditional matrix expressions | |
# these should be combined, but current workarounds seem overly complex | |
test_matrix_pr: | |
name: Test (PR) | |
runs-on: ubuntu-latest | |
if: ${{github.event_name == 'pull_request' }} | |
needs: [static, download_data] | |
strategy: | |
fail-fast: false | |
matrix: | |
test-case: | |
- test/test_core_classifiers.py | |
- test/test_core_regressors.py | |
- test/test_core_transformers.py | |
- test/test_core_pipeline.py | |
- test/test_custom_schemas.py | |
- test/test_json_pretty_viz.py | |
- test/test_grammar.py | |
- test/test_type_checking.py | |
- test/test_interoperability.py | |
- test/test_optimizers.py | |
- test/test_pipeline.py | |
- test/test_autogen_lib.py | |
- test/test_snapml.py | |
- test/test_relational.py | |
- test/test_category_encoders.py | |
python-version: ['3.10'] | |
setup-target: ['.[full,test]'] | |
include: | |
- test-case: test/test_core_misc.py | |
python-version: 3.9 | |
setup-target: '.[full,test]' | |
- test-case: test/test_core_misc.py | |
python-version: '3.10' | |
setup-target: '.[full,test]' | |
- test-case: test/test_core_misc.py | |
python-version: '3.10' | |
setup-target: '.[full,test]' | |
- test-case: test/test_core_misc.py | |
python-version: '3.11' | |
setup-target: '.[full,test]' | |
- test-case: test/test_core_misc.py | |
python-version: '3.12' | |
setup-target: '.[full,test]' | |
- test-case: test/test_autogen_lib.py | |
python-version: '3.11' | |
setup-target: '.[test]' | |
- test-case: test/test_halving_gridsearchcv.py | |
python-version: 3.9 | |
setup-target: '.[full,test]' | |
- test-case: test/test_aif360.py | |
python-version: 3.9 | |
setup-target: '.[full,test]' | |
- test-case: test/test_relational_sklearn.py | |
python-version: '3.11' | |
setup-target: '.[full,test]' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
cache-dependency-path: setup.py | |
- name: Install system packages | |
run: sudo apt-get install graphviz swig | |
- name: Cache test data restore | |
uses: actions/cache/restore@v4 | |
with: | |
path: ${{ env.DOWNLOAD_CACHE_DIR }} | |
key: ${{ runner.os }}-dcache-new3-${{ env.DOWNLOAD_CACHE_DIR }}-${{ hashFiles('lale/datasets/prefetch.py') }} | |
restore-keys: | | |
${{ runner.os }}-dcache-new3-${{ env.DOWNLOAD_CACHE_DIR }}- | |
${{ runner.os }}-dcache-new3 | |
- name: Install numpy | |
run: pip install -U numpy | |
- name: Install dependencies | |
run: pip install --upgrade --upgrade-strategy eager ${{matrix.setup-target}} | |
- name: Force newest numpy | |
run: pip install --upgrade --upgrade-strategy eager numpy | |
- name: Install deps for test_relational_sklearn | |
if: ${{ matrix.test-case == 'test/test_relational_sklearn.py' }} | |
run: pip install 'scikit-learn>=1.0' | |
- name: Install deps for test_snapml | |
if: ${{ matrix.test-case == 'test/test_snapml.py' }} | |
run: pip install 'numpy>=1.20.1,<1.24' | |
- name: pip list packages | |
run: pip list | |
- name: show pip dependencies | |
run: | | |
pip install pipdeptree | |
pipdeptree -fl | |
- name: Run test | |
run: py.test -v --capture=tee-sys ${{matrix.test-case}} | |
test_matrix_master: | |
name: Test (master) | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'push' }} | |
needs: [static, download_data] | |
strategy: | |
fail-fast: false | |
matrix: | |
test-case: | |
- test/test_core_classifiers.py | |
- test/test_core_regressors.py | |
- test/test_core_misc.py | |
- test/test_core_pipeline.py | |
- test/test_custom_schemas.py | |
- test/test_json_pretty_viz.py | |
- test/test_grammar.py | |
- test/test_type_checking.py | |
- test/test_interoperability.py | |
- test/test_optimizers.py | |
- test/test_pipeline.py | |
- test/test_relational.py | |
- test/test_category_encoders.py | |
python-version: [3.9, '3.10', '3.11', '3.12'] | |
setup-target: ['.[full,test]'] | |
include: | |
- test-case: test/test_core_transformers.py | |
python-version: '3.10' | |
setup-target: '.[full,test]' | |
- test-case: test/test_core_transformers.py | |
python-version: '3.10' | |
setup-target: '.[full,test]' | |
- test-case: test/test_core_transformers.py | |
python-version: '3.11' | |
setup-target: '.[full,test]' | |
- test-case: test/test_autogen_lib.py | |
python-version: '3.11' | |
setup-target: '.[test]' | |
- test-case: test/test_halving_gridsearchcv.py | |
python-version: 3.9 | |
setup-target: '.[full,test]' | |
- test-case: test/test_aif360.py | |
python-version: 3.9 | |
setup-target: '.[full,test]' | |
- test-case: test/test_relational_sklearn.py | |
python-version: '3.11' | |
setup-target: '.[full,test]' | |
- test-case: test/test_snapml.py | |
python-version: 3.9 | |
setup-target: '.[full,test]' | |
- test-case: test/test_snapml.py | |
python-version: '3.10' | |
setup-target: '.[full,test]' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
cache-dependency-path: setup.py | |
- name: Install system packages | |
run: sudo apt-get install graphviz swig | |
- name: Cache test data restore | |
uses: actions/cache/restore@v4 | |
with: | |
path: ${{ env.DOWNLOAD_CACHE_DIR }} | |
key: ${{ runner.os }}-dcache-new3-${{ env.DOWNLOAD_CACHE_DIR }}-${{ hashFiles('lale/datasets/prefetch.py') }} | |
restore-keys: | | |
${{ runner.os }}-dcache-new3-${{ env.DOWNLOAD_CACHE_DIR }}- | |
${{ runner.os }}-dcache-new3 | |
- name: Install numpy | |
run: pip install -U numpy | |
- name: Install dependencies | |
run: pip install --upgrade --upgrade-strategy eager ${{matrix.setup-target}} | |
- name: Force newest numpy | |
run: pip install --upgrade --upgrade-strategy eager numpy | |
- name: Install deps for test_relational_sklearn | |
if: ${{ matrix.test-case == 'test/test_relational_sklearn.py' }} | |
run: pip install 'scikit-learn>=1.0' | |
- name: Install deps for test_snapml | |
if: ${{ matrix.test-case == 'test/test_snapml.py' }} | |
run: pip install 'numpy>=1.20.1,<1.24' | |
- name: pip list packages | |
run: pip list | |
- name: show pip dependencies | |
run: | | |
pip install pipdeptree | |
pipdeptree -fl | |
- name: Run test | |
run: py.test -v --capture=tee-sys ${{matrix.test-case}} | |
test_newer: | |
name: Test with newest sklearn | |
runs-on: ubuntu-latest | |
needs: [static, download_data] | |
strategy: | |
fail-fast: false | |
matrix: | |
test-case: | |
- test/test_core_classifiers.py | |
- test/test_core_regressors.py | |
- test/test_core_transformers.py | |
python-version: ['3.10', '3.11', '3.12'] | |
setup-target: ['.'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
cache-dependency-path: setup.py | |
- name: Install system packages | |
run: sudo apt-get install graphviz swig | |
- name: Cache test data restore | |
uses: actions/cache/restore@v4 | |
with: | |
path: ${{ env.DOWNLOAD_CACHE_DIR }} | |
key: ${{ runner.os }}-dcache-new3-${{ env.DOWNLOAD_CACHE_DIR }}-${{ hashFiles('lale/datasets/prefetch.py') }} | |
restore-keys: | | |
${{ runner.os }}-dcache-new3-${{ env.DOWNLOAD_CACHE_DIR }}- | |
${{ runner.os }}-dcache-new3 | |
- name: Install numpy | |
run: pip install -U numpy | |
- name: Install dependencies | |
run: pip install --upgrade --upgrade-strategy eager ${{matrix.setup-target}} | |
- name: Install pytest | |
run: pip install pytest | |
- name: Install latest scikit-learn, xgboost, and lightgbm | |
run: pip install --upgrade --upgrade-strategy eager scikit-learn xgboost lightgbm | |
- name: Force newest numpy | |
run: pip install --upgrade --upgrade-strategy eager numpy | |
- name: pip list packages | |
run: pip list | |
- name: show pip dependencies | |
run: | | |
pip install pipdeptree | |
pipdeptree -fl | |
- name: Run test | |
run: py.test -v --capture=tee-sys ${{matrix.test-case}} | |
continue-on-error: true # we may not yet support the latest scikit-learn version | |
test_notebooks_pr: | |
name: Test Notebooks (PR) | |
needs: [static, download_data] | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'pull_request' }} | |
env: | |
ALL_NOTEBOOK_CATEGORIES: demo_ docs_ talk_ | |
strategy: | |
fail-fast: false | |
matrix: | |
category: | |
- demo_ | |
- docs_ | |
- talk_ | |
python-version: [3.9] | |
setup-target: ['.[full,test]'] | |
test-case: ['test/test_notebooks.py'] | |
dir: ['examples'] | |
nbexcludes: [''] | |
include: | |
- dir: 'examples/kdd22' | |
python-version: 3.9 | |
setup-target: '.[tutorial,test]' | |
test-case: 'test/test_notebooks.py' | |
# nbexcludes: '06_multobj.ipynb' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
cache-dependency-path: setup.py | |
- name: Cache test data restore | |
uses: actions/cache/restore@v4 | |
with: | |
path: ${{ env.DOWNLOAD_CACHE_DIR }} | |
key: ${{ runner.os }}-dcache-new3-${{ env.DOWNLOAD_CACHE_DIR }}-${{ hashFiles('lale/datasets/prefetch.py') }} | |
restore-keys: | | |
${{ runner.os }}-dcache-new3-${{ env.DOWNLOAD_CACHE_DIR }}- | |
${{ runner.os }}-dcache-new3 | |
- name: Install packages | |
run: sudo apt-get install graphviz swig | |
- name: Install numpy | |
run: pip install -U numpy | |
- name: Install dependencies | |
run: pip install --upgrade --upgrade-strategy eager ${{matrix.setup-target}} | |
- name: Force newest numpy | |
run: pip install --upgrade --upgrade-strategy eager numpy | |
- name: Fix tutorial dependencies | |
if: ${{ matrix.dir == 'examples/kdd22' }} | |
run: | | |
pip install "numpy<2.0.0" "pandas<2.0.0" "xgboost<=1.5.1" | |
- name: pip list packages | |
run: pip list | |
- name: show pip dependencies | |
run: | | |
pip install pipdeptree | |
pipdeptree -fl | |
- name: Run test | |
run: > | |
NOTEBOOK_EXCLUDES="${{matrix.nbexcludes}}" | |
NOTEBOOK_DIR=${{matrix.dir}} | |
NOTEBOOK_CATEGORY=${{matrix.category}} | |
py.test -v --capture=tee-sys ${{matrix.test-case}} | |
test_notebooks_master: | |
name: Test Notebooks (master) | |
needs: [static, download_data] | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'push' }} | |
env: | |
ALL_NOTEBOOK_CATEGORIES: demo_ docs_ talk_ | |
strategy: | |
fail-fast: false | |
matrix: | |
category: | |
- demo_ | |
- docs_ | |
- talk_ | |
python-version: [3.9, '3.10', '3.11', '3.12'] | |
setup-target: ['.[full,test]'] | |
test-case: ['test/test_notebooks.py'] | |
dir: ['examples'] | |
nbexcludes: [''] | |
include: | |
- dir: 'examples' | |
python-version: 3.9 | |
setup-target: '.[full,test]' | |
test-case: 'test/test_notebooks.py' | |
nbexcludes: 'demo_auto_pipeline.ipynb' | |
- dir: 'examples/kdd22' | |
python-version: 3.9 | |
setup-target: '.[tutorial,test]' | |
test-case: 'test/test_notebooks.py' | |
nbexcludes: '02_total.ipynb' | |
- dir: 'examples/kdd22' | |
python-version: '3.9' | |
setup-target: '.[tutorial,test]' | |
test-case: 'test/test_notebooks.py' | |
# nbexcludes: '06_multobj.ipynb' | |
- dir: 'examples/kdd22' | |
python-version: '3.10' | |
setup-target: '.[tutorial,test]' | |
test-case: 'test/test_notebooks.py' | |
# nbexcludes: '06_multobj.ipynb' | |
- dir: 'examples/kdd22' | |
python-version: '3.11' | |
setup-target: '.[tutorial,test]' | |
test-case: 'test/test_notebooks.py' | |
# nbexcludes: '06_multobj.ipynb' | |
- dir: 'examples/kdd22' | |
python-version: '3.12' | |
setup-target: '.[tutorial,test]' | |
test-case: 'test/test_notebooks.py' | |
# nbexcludes: '06_multobj.ipynb' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
cache-dependency-path: setup.py | |
- name: Cache test data restore | |
uses: actions/cache/restore@v4 | |
with: | |
path: ${{ env.DOWNLOAD_CACHE_DIR }} | |
key: ${{ runner.os }}-dcache-new3-${{ env.DOWNLOAD_CACHE_DIR }}-${{ hashFiles('lale/datasets/prefetch.py') }} | |
restore-keys: | | |
${{ runner.os }}-dcache-new3-${{ env.DOWNLOAD_CACHE_DIR }}- | |
${{ runner.os }}-dcache-new3 | |
- name: Install packages | |
run: sudo apt-get install graphviz swig | |
- name: Install numpy | |
run: pip install -U numpy | |
- name: Install dependencies | |
run: pip install --upgrade --upgrade-strategy eager ${{matrix.setup-target}} | |
- name: Force newest numpy | |
run: pip install --upgrade --upgrade-strategy eager numpy | |
- name: Fix tutorial dependencies | |
if: ${{ matrix.dir == 'examples/kdd22' }} | |
run: | | |
pip install "numpy<2.0.0" "pandas<2.0.0" "xgboost<=1.5.1" | |
- name: pip list packages | |
run: pip list | |
- name: show pip dependencies | |
run: | | |
pip install pipdeptree | |
pipdeptree -fl | |
- name: Run test | |
run: > | |
NOTEBOOK_EXCLUDES="${{matrix.nbexcludes}}" | |
NOTEBOOK_DIR=${{matrix.dir}} | |
NOTEBOOK_CATEGORY=${{matrix.category}} | |
py.test -v --capture=tee-sys ${{matrix.test-case}} | |
test_fairness: | |
name: Test fairness install | |
runs-on: ubuntu-latest | |
needs: [static, download_data] | |
strategy: | |
fail-fast: false | |
matrix: | |
test-case: | |
- test/test_aif360.py | |
- test/test_aif360_ensembles.py | |
python-version: [3.9] | |
setup-target: ['.[fairness]'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install system packages | |
run: sudo apt-get install graphviz swig | |
- name: Install pytest | |
run: pip install pytest | |
- name: Install dependencies | |
run: pip install --upgrade --upgrade-strategy eager ${{matrix.setup-target}} | |
- name: Force newest numpy | |
run: pip install --upgrade --upgrade-strategy eager numpy | |
- name: pip list packages | |
run: pip list | |
- name: show pip dependencies | |
run: | | |
pip install pipdeptree | |
pipdeptree -fl | |
- name: Cache test data restore | |
uses: actions/cache/restore@v4 | |
with: | |
path: ${{ env.DOWNLOAD_CACHE_DIR }} | |
key: ${{ runner.os }}-dcache-new3-${{ env.DOWNLOAD_CACHE_DIR }}-${{ hashFiles('lale/datasets/prefetch.py') }} | |
restore-keys: | | |
${{ runner.os }}-dcache-new3-${{ env.DOWNLOAD_CACHE_DIR }}- | |
${{ runner.os }}-dcache-new3 | |
- name: Run test | |
run: py.test -v --capture=tee-sys ${{matrix.test-case}} | |
deploy: | |
name: Deploy to TestPyPI | |
runs-on: ubuntu-latest | |
# This should run only on the master branch of the main repo | |
if: github.repository == 'IBM/lale' && github.ref == 'refs/heads/master' && success() | |
needs: [static, test_matrix_master, test_newer, test_fairness, test_notebooks_master, docs] | |
strategy: | |
matrix: | |
python-version: [3.9] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: pip install wheel twine | |
- name: Build distribution | |
env: | |
# integrate with the current system for timestamping versions | |
TRAVIS: " " | |
run: python setup.py sdist bdist_wheel | |
- name: Publish package to TestPyPI | |
run: twine upload -u "__token__" -p "${{ secrets.test_pypi_password }}" -r testpypi dist/* |