Skip to content

Commit

Permalink
use ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolasibalic committed Dec 26, 2024
1 parent 947b469 commit 5a7c9a4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
21 changes: 10 additions & 11 deletions .github/workflows/wheels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,22 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest black "black[jupyter]"
pip install build
- name: Check
uv pip install -e .
- name: Lint and format check
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 --version
flake8 . --count --show-source --statistics
black --version
black -l 80 . --check
python -m compileall -f arc/*.py
uvx ruff check
uv run python -m compileall -f arc/*.py
- name: Typing check
run: |
uv pip install mypy
uv run mypy .
function_test:
name: Basic test suite
Expand Down
13 changes: 8 additions & 5 deletions doc/contribute.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,15 @@ Finally, this is the naming convention. of the original package. For consistency
Code format
-----------

Please run ``black`` in the repository folder fixing line length to 80 characters::
Please run install `uv` and run linter::

black -l 80 .
pip install uv
uvx ruff format
uvx ruff check

And then run linter
and resolve any errors that appear there before submitting code.

flake8 .
Optionally also check typing::

and resolve any erros that appear there before submitting code.
uv pip install mypy
uv run mypy .

0 comments on commit 5a7c9a4

Please sign in to comment.