Skip to content

Commit

Permalink
Add workshow without Pycsou to test more versions of Python.
Browse files Browse the repository at this point in the history
  • Loading branch information
ebezzam committed Apr 25, 2023
1 parent fb2534b commit 71f3635
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
max-parallel: 12
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.8, 3.9, "3.10"]
python-version: [3.9, "3.10"]
steps:
- uses: actions/checkout@v3
- name: Checkout submodules
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/python_no_pycsou.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: lensless

on: [push, pull_request]

jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
max-parallel: 12
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.8, 3.9, "3.10", "3.11"]
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 uninstall pycsou
pytest
14 changes: 9 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,22 @@ install the library locally.
python scripts/recon/admm.py
Note (25-04-2023): Pycsou V2 is installed by ``recon_requirements.txt``. If PyTorch
is installed, you will need to be sure to have PyTorch 2.0 or higher, as Pycsou V2
is not compatible with earlier version of PyTorch.
Note (25-04-2023): Pycsou V2 is installed by ``recon_requirements.txt``. If PyTorch is installed, you will
need to be sure to have PyTorch 2.0 or higher, as Pycsou V2 is not compatible with earlier
version of PyTorch. Moreover, Pycsou requires Python within
`[3.9, 3.11) <https://github.com/matthieumeo/pycsou/blob/v2-dev/setup.cfg#L28>`__.

Setup for PyTorch 2.0:

.. code:: bash
# GPU
# default should be PyTorch 2.0
pip install torch torchvision torchaudio
# nightly build for GPU
pip install numpy --pre torch --force-reinstall --extra-index-url https://download.pytorch.org/whl/nightly/cu117
# CPU
# nightly build for CPU
pip install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cpu
Expand Down

0 comments on commit 71f3635

Please sign in to comment.