Skip to content

Commit

Permalink
ci: add pipeline to test torch wrapper, regroup cfg file in a single …
Browse files Browse the repository at this point in the history
…setup and adapt worflows for the wrapper
  • Loading branch information
lucashervier committed Aug 22, 2023
1 parent 95ac086 commit 82231f4
Show file tree
Hide file tree
Showing 8 changed files with 133 additions and 53 deletions.
8 changes: 0 additions & 8 deletions .bumpversion.cfg

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/python-lints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: [3.6, 3.7, 3.8]
python-version: [3.7, 3.8, 3.9, "3.10"]

steps:
- uses: actions/checkout@v1
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: tox
name: tests general

on:
pull_request:
Expand All @@ -10,7 +10,15 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: [3.6, 3.7, 3.8]
include:
- python-version: 3.7
tf-version: 2.1
- python-version: 3.8
tf-version: 2.5
- python-version: 3.9
tf-version: 2.8
- python-version: "3.10"
tf-version: 2.11

steps:
- uses: actions/checkout@v1
Expand All @@ -22,5 +30,5 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install tox
- name: Test with tox
run: tox -e py$(echo ${{ matrix.python-version }} | tr -d .)
- name: Test with tox (Python ${{ matrix.python-version }} - TF ${{ matrix.tf-version }})
run: tox -e py$(echo ${{ matrix.python-version }}-tf${{ matrix.tf-version }} | tr -d .)
50 changes: 50 additions & 0 deletions .github/workflows/python-torch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: tests for torch

on:
push:
branches:
- lucas/torch
pull_request:
workflow_dispatch:

jobs:
checks:
runs-on: ubuntu-20.04
strategy:
max-parallel: 4
matrix:
include:
- python-version: 3.8
tf-version: 2.5
torch-version: 1.11
- python-version: 3.8
tf-version: 2.8
torch-version: 1.11
- python-version: 3.8
tf-version: 2.11
torch-version: 1.11
- python-version: 3.9
tf-version: 2.8
torch-version: 1.13
- python-version: 3.9
tf-version: 2.11
torch-version: 1.13
- python-version: "3.10"
tf-version: 2.8
torch-version: 2.0.0
- python-version: "3.10"
tf-version: 2.11
torch-version: 2.0.0

steps:
- uses: actions/checkout@v1
- 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 tox
- name: Test with tox (Python ${{ matrix.python-version }} - TF ${{ matrix.tf-version }} - PyTorch ${{ matrix.torch-version }})
run: tox -e py$(echo ${{ matrix.python-version }}-tf${{ matrix.tf-version }}-torch${{matrix.torch-version}} | tr -d .)
9 changes: 0 additions & 9 deletions .mypy.ini

This file was deleted.

18 changes: 0 additions & 18 deletions .pylintrc

This file was deleted.

70 changes: 70 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
[bumpversion]
current_version = 1.0.1
commit = True
tag = True

[bumpversion:file:setup.py]

[bumpversion:file:xplique/__init__.py]

[pylint]
disable =
R0903, # allows to expose only one public method
R0914, # allow multiples local variables
E0401, # pending issue with pylint see pylint#2603
E1123, # issues between pylint and tensorflow since 2.2.0
E1120, # see pylint#3613
C3001, # lambda function as variable
max-line-length = 100
max-args = 12

[similarities]
min-similarity-lines = 6
ignore-comments = yes
ignore-docstrings = yes
ignore-imports = no

[tox:tox]
envlist = py{37,38,39,310}-lint, py{37,38,39,310}-tf{21,25,28,211}, py{38,39,310}-tf{25,28,211}-torch{111,113,200}

[testenv:py{37,38,39,310}-lint]
commands =
python -m pylint xplique

[testenv:py{37,38,39,310}-tf{31,25,28,211}]
deps =
pytest
pytest-cov
tf21: tensorflow ~= 2.1.0
tf25: tensorflow ~= 2.5.0
tf28: tensorflow ~= 2.8.0
tf211: tensorflow ~= 2.11.0
-rrequirements.txt

commands =
pytest --cov=xplique --ignore=xplique/wrappers/pytorch.py --ignore=tests/wrappers/test_pytorch_wrapper.py {posargs}

[testenv:py{38,39,310}-tf{25,28,211}-torch{111,113,200}]
deps =
pytest
pytest-cov
tf25: tensorflow ~= 2.5.0
tf28: tensorflow ~= 2.8.0
tf211: tensorflow ~= 2.11.0
torch111: torch == 1.11.0
torch113: torch == 1.13.0
torch200: torch
-rrequirements.txt

commands =
pytest --cov=xplique/wrappers/pytorch tests/wrappers/test_pytorch_wrapper.py

[mypy]
check_untyped_defs = True
warn_unused_configs = True

[mypy-numpy.*]
ignore_missing_imports = True

[mypy-sklearn.*]
ignore_missing_imports = True
13 changes: 0 additions & 13 deletions tox.ini

This file was deleted.

0 comments on commit 82231f4

Please sign in to comment.