-
Notifications
You must be signed in to change notification settings - Fork 26
63 lines (60 loc) · 2.11 KB
/
python_pycsou.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: lensless
on:
push:
paths:
- 'lensless/**'
- 'setup.py'
- 'recon_requirements.txt'
pull_request:
paths:
- 'lensless/**'
- 'setup.py'
- 'recon_requirements.txt'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
max-parallel: 12
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.9, "3.10"]
steps:
- uses: actions/checkout@v3
- name: Checkout submodules
shell: bash
run: |
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies and build package
run: |
python -m pip install --upgrade pip
python -m pip install -e .
- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=B,C,E,F,W,T4,B9 --show-source --statistics --max-complexity=18 --max-line-length=100 --ignore=E203,E266,E501,W503,F403,F401,C901 --exclude=profile,scripts,docs
# 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: Format with black
run: |
pip install black
black *.py -l 100
black lensless/*.py -l 100
black scripts/*.py -l 100
black scripts/recon/*.py -l 100
black profile/*.py -l 100
black test/*.py -l 100
- name: Test with pytest
run: |
pip install -U pytest
pip install -r recon_requirements.txt
pip install -r mask_requirements.txt
pip install git+https://github.com/matthieumeo/pycsou.git@38e9929c29509d350a7ff12c514e2880fdc99d6e
pytest