Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-wieser authored Jul 19, 2021
2 parents 248d26e + 659f75b commit bfbd85e
Show file tree
Hide file tree
Showing 38 changed files with 1,444 additions and 918 deletions.
172 changes: 172 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
name: Python package

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
release:
types: [ created ]

jobs:
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.8]
name: "lint | Python ${{ matrix.python-version }}"
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 flake8
pip install .
- name: Setup flake8 annotations
uses: rbialon/flake8-annotations@v1
- name: Run flake8
run: |
flake8 clifford --show-source --statistics
test:
defaults:
run:
# conda needs this to activate environments properly
shell: bash -l {0}
needs: lint
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# fastest jobs first
# This job currently fails
# - python-version: 3.8
# name: without JIT
# disable_jit: 1
- python-version: 3.8
name: doctests
mode: doctests
# really slow job next, so it runs in parallel with the others
- python-version: 3.8
name: slow tests
mode: very_slow
- python-version: 3.5
name: default
- python-version: 3.8
name: default
- python-version: 3.8
name: conda
conda: true
- python-version: 3.8
name: benchmarks
mode: bench

name: "build | ${{ matrix.name }} | Python ${{matrix.python-version}}"
steps:
- uses: actions/checkout@v2

# python / pip
- name: Set up Python ${{ matrix.python-version }}
if: "!matrix.conda"
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
if: "!matrix.conda"
run: |
python -m pip install --upgrade pip;
pip install . --prefer-binary;
# test dependencies
pip install --upgrade pytest pytest-cov pytest-benchmark IPython
# conda
- name: Set up Python ${{ matrix.python-version }} (conda)
if: matrix.conda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
- name: Install dependencies (conda)
if: matrix.conda
run: |
echo $CONDA/bin >> $GITHUB_PATH;
conda install \
"numpy>=1.17.0" \
scipy \
pip \
IPython \
h5py;
conda install -c conda-forge sparse;
conda install -c numba "numba>=0.45.1";
# make sure in conda we do not overwrite dependencies with pip
python setup.py develop --no-deps;
# test dependencies
python -m pip install --upgrade pytest pytest-cov pytest-benchmark;
- name: Test with pytest
env:
MODE: ${{ matrix.mode }}
NUMBA_DISABLE_JIT: ${{ matrix.disable_jit }}
run: |
PYTEST_ARGS=();
if [[ "${MODE}" == "bench" ]]; then
PYTEST_ARGS+=(--benchmark-only);
else
PYTEST_ARGS+=(--benchmark-skip);
fi;
if [[ "${MODE}" == "very_slow" ]]; then
PYTEST_ARGS+=(-m "veryslow");
else
PYTEST_ARGS+=(-m "not veryslow");
fi;
if [[ "${MODE}" == "doctests" ]]; then
PYTEST_ARGS+=(--doctest-modules --ignore clifford/test);
fi;
# `python -m` ensures we dispatch to conda if appropriate
python -m pytest \
"${PYTEST_ARGS[@]}" \
--color=yes \
-o junit_family=legacy \
--junitxml=junit/test-results.xml \
--durations=25 \
--cov=clifford \
--cov-branch;
# This only publishes result for the last run right now
# - name: Publish Test Report
# uses: mikepenz/action-junit-report@v2
# if: ${{ always() }}
# with:
# report_paths: 'junit/test-results.xml'
- uses: codecov/codecov-action@v1

deploy:
needs: test
runs-on: ubuntu-latest
name: deploy
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"
run: |
python -m pip install --upgrade pip;
python -m pip install build
python -m build --sdist --wheel --outdir dist/
- uses: actions/upload-artifact@v2
with:
name: dist
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
if: startsWith(github.ref, 'refs/tags/v')
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
147 changes: 0 additions & 147 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![DOI](https://zenodo.org/badge/26588915.svg)](https://zenodo.org/badge/latestdoi/26588915)
[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/pygae/clifford/master?filepath=examples%2Fg3c.ipynb)
[![Documentation Status](https://readthedocs.org/projects/clifford/badge/?version=latest)](http://clifford.readthedocs.io/en/latest/?badge=latest)
[![Build Status](https://travis-ci.org/pygae/clifford.svg?branch=master)](https://travis-ci.org/pygae/clifford)
[![Build Status](https://github.com/pygae/clifford/actions/workflows/python-package.yml/badge.svg?branch=master)](https://github.com/pygae/clifford/actions/workflows/python-package.yml)
[![Build Status](https://dev.azure.com/hadfieldhugo/clifford/_apis/build/status/pygae.clifford?branchName=master)](https://dev.azure.com/hadfieldhugo/clifford/_build/latest?definitionId=1&branchName=master)
[![codecov](https://codecov.io/gh/pygae/clifford/branch/master/graph/badge.svg)](https://codecov.io/gh/pygae/clifford)

Expand Down
15 changes: 0 additions & 15 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ jobs:
- job: 'Test'
strategy:
matrix:
linuxPython35:
imageName: 'ubuntu-16.04'
python.version: '3.5'
numbacommand: '-c numba numba'
installPackageCommand: 'sudo apt-get install python3-setuptools && sudo python3 setup.py develop --no-deps'
linuxPython36:
imageName: 'ubuntu-16.04'
python.version: '3.6'
Expand All @@ -38,11 +33,6 @@ jobs:
installPackageCommand: 'sudo apt-get install python3-setuptools && sudo python3 setup.py develop --no-deps'


macPython35:
imageName: 'macos-10.13'
python.version: '3.5'
numbacommand: '-c numba numba'
installPackageCommand: 'sudo python setup.py develop --no-deps'
macPython36:
imageName: 'macos-10.13'
python.version: '3.6'
Expand All @@ -62,11 +52,6 @@ jobs:
installPackageCommand: 'sudo python setup.py develop --no-deps'


windowsPython35:
imageName: 'vs2017-win2016'
python.version: '3.5'
numbacommand: '-c numba numba'
installPackageCommand: 'python setup.py install'
windowsPython36:
imageName: 'vs2017-win2016'
python.version: '3.6'
Expand Down
Loading

0 comments on commit bfbd85e

Please sign in to comment.