Skip to content

Restrict numpy to <2.0.0 #379

Restrict numpy to <2.0.0

Restrict numpy to <2.0.0 #379

name: Tests
on:
pull_request:
types: [opened, synchronize]
push:
branches:
- main
workflow_dispatch:
jobs:
tests:
name: ${{ matrix.python_version }} unit tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python_version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Build featuretools package
run: make package
- name: Set up pip and graphviz
run: |
pip config --site set global.progress_bar off
python -m pip install --upgrade pip
sudo apt update && sudo apt install -y graphviz
- name: Install featuretools with test requirements
run: |
python -m pip install -e unpacked_sdist/
python -m pip install -e unpacked_sdist/[test,dask]
- if: ${{ matrix.python_version == 3.9 }}
name: Generate coverage args
run: echo "coverage_args=--cov=featuretools --cov-config=../pyproject.toml --cov-report=xml:../coverage.xml" >> $GITHUB_ENV
- if: ${{ env.coverage_args }}
name: Erase coverage files
run: |
cd unpacked_sdist
coverage erase
- name: Run unit tests
run: |
cd unpacked_sdist
pytest featuretools/ -n auto ${{ env.coverage_args }}
- if: ${{ env.coverage_args }}
name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
files: ${{ github.workspace }}/coverage.xml
verbose: true
win_unit_tests:
name: ${{ matrix.python_version }} windows unit tests
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python_version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- name: Download miniconda
shell: pwsh
run: |
$File = "Miniconda3-latest-Windows-x86_64.exe"
$Uri = "https://repo.anaconda.com/miniconda/$File"
$ProgressPreference = "silentlyContinue"
Invoke-WebRequest -Uri $Uri -Outfile "$env:USERPROFILE/$File"
$hashFromFile = Get-FileHash "$env:USERPROFILE/$File" -Algorithm SHA256
$hashFromUrl = "f4d6147b40ea6822255c2dcec8bb0d357c09e230976213f70d7b8c4a10d86bb0"
if ($hashFromFile.Hash -ne "$hashFromUrl") {
Throw "$File hashes do not match"
}
- name: Install miniconda
shell: cmd
run: start /wait "" %UserProfile%\Miniconda3-latest-Windows-x86_64.exe /InstallationType=JustMe /RegisterPython=0 /S /D=%UserProfile%\Miniconda3
- name: Create python ${{ matrix.python_version }} environment
shell: pwsh
run: |
. $env:USERPROFILE\Miniconda3\shell\condabin\conda-hook.ps1
conda create -n featuretools python=${{ matrix.python_version }}
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Install featuretools with test requirements
shell: pwsh
run: |
. $env:USERPROFILE\Miniconda3\shell\condabin\conda-hook.ps1
conda activate featuretools
conda config --add channels conda-forge
conda install -q -y -c conda-forge python-graphviz graphviz
python -m pip install --upgrade pip
python -m pip install .[test,dask]
- name: Run unit tests
run: |
. $env:USERPROFILE\Miniconda3\shell\condabin\conda-hook.ps1
conda activate featuretools
pytest featuretools\ -n auto