Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 37 additions & 34 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,49 +6,52 @@ name: Running tests
on:
push:
branches:
- main
- develop
- main
- develop
pull_request:
workflow_dispatch:
jobs:
lint_flake8:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Lint with flake8
run: |
pip install flake8
flake8 . --count --show-source --statistics
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Lint with flake8
run: |
pip install flake8
flake8 . --count --show-source --statistics

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Search for severe code errors with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
pip install flake8
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Install dependencies
run: |
$CONDA/bin/conda env update --file environment_all_backends.yml --name base
- name: Test with pytest
run: |
cd torchquad/tests
conda install pytest
$CONDA/bin/pip3 install pytest-error-for-skips
$CONDA/bin/pytest -ra --error-for-skips
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Search for severe code errors with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
pip install flake8
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: provision-with-micromamba
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: environment_all_backends.yml
environment-name: torchquad
cache-downloads: true
- name: Test with pytest
shell: bash -l {0}
run: |
micromamba activate torchquad
cd torchquad/tests
pip install pytest
pip install pytest-error-for-skips
pytest -ra --error-for-skips
41 changes: 21 additions & 20 deletions environment_all_backends.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
# A conda environment file to install all supported numerical backends
name: torchquad
channels:
- conda-forge
- pytorch
- conda-forge
- pytorch
dependencies:
- autoray>=0.2.5
- loguru>=0.5.3
- matplotlib>=3.3.3
- pytest>=6.2.1
- python>=3.8
- scipy>=1.6.0
- sphinx>=3.4.3
- sphinx_rtd_theme>=0.5.1
- tqdm>=4.56.0
# Numerical backend installations with CUDA support where possible:
- numpy>=1.19.5
- cudatoolkit>=11.1
- pytorch>=1.9=*cuda*
- tensorflow-gpu>=2.6.0
# jaxlib with CUDA support is not available for conda
- pip:
- --find-links https://storage.googleapis.com/jax-releases/jax_releases.html
- jax[cuda]>=0.2.22 # this will only work on linux. for win see e.g. https://github.com/cloudhan/jax-windows-builder
- autoray>=0.2.5
- loguru>=0.5.3
- matplotlib>=3.3.3
- pytest>=6.2.1
- python>=3.8
- scipy>=1.6.0
- sphinx>=3.4.3
- sphinx_rtd_theme>=0.5.1
- tqdm>=4.56.0
# Numerical backend installations with CUDA support where possible:
- numpy>=1.19.5
- cudatoolkit>=11.1
- pytorch>=1.9 # CPU version
- tensorflow>=2.10.0 # CPU version
# jaxlib with CUDA support is not available for conda
- pip:
- --find-links https://storage.googleapis.com/jax-releases/jax_releases.html
- jax[cpu]>=0.2.22 # this will only work on linux. for win see e.g. https://github.com/cloudhan/jax-windows-builder
# CPU version