Skip to content

Fix CI #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 23, 2023
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
22 changes: 9 additions & 13 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,20 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install dev-requirements.txt
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
make install
- name: Check code style with black
run: |
black --check .
make code-style
- name: Check import order with isort
run: |
isort --check .
make import-check
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
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
make linting
- name: Check static type checking with mypy
run: |
mypy .
- name: Test with pytest
run: |
pytest
make typecheck
# FIXME when C backend will be added to CI cache
# - name: Test with pytest
# run: |
# make tests
24 changes: 13 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,25 @@ install :

# Testing

.PHONY : flake8
flake8 :
flake8 arrayfire_wrapper tests examples
.PHONY : code-style
code-style :
black --check arrayfire_wrapper tests

.PHONY : import-sort
import-sort :
isort arrayfire_wrapper tests examples
.PHONY : linting
linting :
flake8 --count --show-source --statistics arrayfire_wrapper tests

.PHONY : import-check
import-check :
isort --check arrayfire_wrapper tests

.PHONY : typecheck
typecheck :
mypy arrayfire_wrapper tests examples --cache-dir=/dev/null
mypy arrayfire_wrapper tests --cache-dir=/dev/null

.PHONY : tests
tests :
pytest --color=yes -v -rf --durations=40 \
--cov-config=.coveragerc \
--cov=$(SRC) \
--cov-report=xml
pytest --color=yes -v -rf

# Cleaning

Expand All @@ -50,4 +51,5 @@ clean :
rm -rf arrayfire_wrapper.egg-info/
rm -rf dist/
rm -rf build/
rm final_requirements.txt
find . | grep -E '(\.mypy_cache|__pycache__|\.pyc|\.pyo$$)' | xargs rm -rf