From 5a7c9a48d489b8553e65b2736280fd83ffecb8e6 Mon Sep 17 00:00:00 2001 From: Nikola Sibalic Date: Thu, 26 Dec 2024 17:34:03 +0100 Subject: [PATCH] use ruff --- .github/workflows/wheels.yaml | 21 ++++++++++----------- doc/contribute.rst | 13 ++++++++----- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/.github/workflows/wheels.yaml b/.github/workflows/wheels.yaml index f9efbbf..87514b6 100644 --- a/.github/workflows/wheels.yaml +++ b/.github/workflows/wheels.yaml @@ -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 diff --git a/doc/contribute.rst b/doc/contribute.rst index 0ff3d56..0d44b62 100644 --- a/doc/contribute.rst +++ b/doc/contribute.rst @@ -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. \ No newline at end of file + uv pip install mypy + uv run mypy . \ No newline at end of file