Skip to content

Python pytest

Python pytest #530

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python pytest
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
# since * is a special character in YAML you have to quote this string
- cron: '0 5 * * 5'
jobs:
test_full:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest]
python-version: ["3.7", "3.8", "3.9", "3.10"]
include:
- os: ubuntu-20.04
python-version: 3.6
- os: ubuntu-latest
python-version: 3.11
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -q -r requirements.txt "numpy<2.0.0" gcastle pgmpy cython urllib3 igraph pytest-cov==2.4.0 python-coveralls codacy-coverage
pip list
- name: Build extensions
run: |
python setup.py build_ext --inplace
# - name: set environment variables
# uses: allenevans/[email protected]
# with:
# FOO_PYTHONPATH: '.'
- name: Dump environment variables
run: |
python -c "import os;list(map(print,os.environ.items()))"
- name: Test with pytest
run: |
pytest --cov=ylearn --durations=30
test_without_extension:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest,]
python-version: [3.8, ]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -q -r requirements.txt igraph pytest-cov==2.4.0 python-coveralls codacy-coverage
pip list
# - name: Build extensions
# run: |
# python setup.py build_ext --inplace
- name: Dump environment variables
run: |
python -c "import os;list(map(print,os.environ.items()))"
- name: Test with pytest
run: |
pytest --cov=ylearn --durations=30
test_without_torch:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest,]
python-version: [3.8, ]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -q "numpy>=1.16.5" "pandas>=0.25.3" "scikit-learn>=0.22.1" scipy networkx ipython joblib pydot cython urllib3 igraph pytest-cov==2.4.0 python-coveralls codacy-coverage
pip list
- name: Build extensions
run: |
python setup.py build_ext --inplace
- name: Dump environment variables
run: |
python -c "import os;list(map(print,os.environ.items()))"
- name: Test with pytest
run: |
pytest --cov=ylearn --durations=30
test_with_lightgbm:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest,windows-latest, macos-11,]
python-version: [3.8, ]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -q -r requirements.txt lightgbm cython urllib3 igraph pytest-cov==2.4.0 python-coveralls codacy-coverage
pip list
- name: Build extensions
run: |
python setup.py build_ext --inplace
- name: Dump environment variables
run: |
python -c "import os;list(map(print,os.environ.items()))"
- name: Test with pytest
run: |
pytest --cov=ylearn --durations=30
test_with_xgboost:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest,windows-latest,]
python-version: [3.8, ]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -q -r requirements.txt xgboost cython urllib3 igraph pytest-cov==2.4.0 python-coveralls codacy-coverage
pip list
- name: Build extensions
run: |
python setup.py build_ext --inplace
- name: Dump environment variables
run: |
python -c "import os;list(map(print,os.environ.items()))"
- name: Test with pytest
run: |
pytest --cov=ylearn --durations=30