From f9d91a8f6e08848a5e69f0e2d6d59585c95e9fd5 Mon Sep 17 00:00:00 2001 From: isaaccorley <22203655+isaaccorley@users.noreply.github.com> Date: Mon, 8 Apr 2024 20:02:25 -0500 Subject: [PATCH 01/12] add ruff, remove black/flake8/isort/pyupgrade --- .flake8 | 31 ------------- .github/workflows/style.yml | 90 ++----------------------------------- pyproject.toml | 58 +++++++++++++++++------- requirements/style.txt | 5 +-- 4 files changed, 48 insertions(+), 136 deletions(-) delete mode 100644 .flake8 diff --git a/.flake8 b/.flake8 deleted file mode 100644 index 9c96dfa8..00000000 --- a/.flake8 +++ /dev/null @@ -1,31 +0,0 @@ -[flake8] -max-line-length = 88 -extend-ignore = - # See https://github.com/PyCQA/pycodestyle/issues/373 - E203, -exclude = - # Extra files - data/, - images/, - logo/, - logs/, - output/, - - # Docs - docs/src/, - - # Spack - .spack-env/, - - # Python - build/, - dist/, - .cache/, - .mypy_cache/, - .pytest_cache/, - __pycache__/, - *.egg-info/, - - # Git - .git/, - .github/, \ No newline at end of file diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 61278910..be1e0da4 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -9,8 +9,8 @@ on: - main - release** jobs: - black: - name: black + ruff: + name: ruff runs-on: ubuntu-latest steps: - name: Clone repo @@ -19,96 +19,14 @@ jobs: uses: actions/setup-python@v5.0.0 with: python-version: '3.11' - - name: Cache dependencies - uses: actions/cache@v4.0.0 - id: cache - with: - path: ${{ env.pythonLocation }} - key: ${{ env.pythonLocation }}-${{ hashFiles('requirements/style.txt') }} - - name: Install pip dependencies - if: steps.cache.outputs.cache-hit != 'true' - run: | - pip install -r requirements/style.txt - pip cache purge - - name: List pip dependencies - run: pip list - - name: Run black checks - run: black . --check --diff - flake8: - name: flake8 - runs-on: ubuntu-latest - steps: - - name: Clone repo - uses: actions/checkout@v4.1.1 - - name: Set up python - uses: actions/setup-python@v5.0.0 - with: - python-version: '3.11' - - name: Cache dependencies - uses: actions/cache@v4.0.0 - id: cache - with: - path: ${{ env.pythonLocation }} - key: ${{ env.pythonLocation }}-${{ hashFiles('requirements/style.txt') }} - - name: Install pip dependencies - if: steps.cache.outputs.cache-hit != 'true' - run: | - pip install -r requirements/style.txt - pip cache purge - - name: List pip dependencies - run: pip list - - name: Run flake8 checks - run: flake8 - isort: - name: isort - runs-on: ubuntu-latest - steps: - - name: Clone repo - uses: actions/checkout@v4.1.1 - - name: Set up python - uses: actions/setup-python@v5.0.0 - with: - python-version: '3.11' - - name: Cache dependencies - uses: actions/cache@v4.0.0 - id: cache - with: - path: ${{ env.pythonLocation }} - key: ${{ env.pythonLocation }}-${{ hashFiles('requirements/style.txt') }} - - name: Install pip dependencies - if: steps.cache.outputs.cache-hit != 'true' - run: | - pip install -r requirements/style.txt - pip cache purge - - name: List pip dependencies - run: pip list - - name: Run isort checks - run: isort . --check --diff - pyupgrade: - name: pyupgrade - runs-on: ubuntu-latest - steps: - - name: Clone repo - uses: actions/checkout@v4.1.1 - - name: Set up python - uses: actions/setup-python@v5.0.0 - with: - python-version: '3.11' - - name: Cache dependencies - uses: actions/cache@v4.0.0 - id: cache - with: - path: ${{ env.pythonLocation }} - key: ${{ env.pythonLocation }}-${{ hashFiles('requirements/style.txt') }} - name: Install pip dependencies - if: steps.cache.outputs.cache-hit != 'true' run: | pip install -r requirements/style.txt pip cache purge - name: List pip dependencies run: pip list - - name: Run pyupgrade checks - run: pyupgrade --py39-plus + - name: Run ruff checks + run: ruff format --check -v concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.head.label || github.head_ref || github.ref }} cancel-in-progress: true \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 7dd46c4c..b4ae4df2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,10 +40,7 @@ dynamic = ["version"] [project.optional-dependencies] style = [ - "black[jupyter]>=21.8", - "flake8>=3.8", - "isort[colors]>=5.8", - "pyupgrade>=2.8", + "ruff>=0.3.0" ] tests = [ "pytest>=7.3", @@ -56,11 +53,6 @@ all = [ [project.urls] Homepage = "https://github.com/isaaccorley/torchseg" -[tool.black] -target-version = ["py39", "py310"] -color = true -skip_magic_trailing_comma = true - [tool.coverage.report] # Ignore warnings for overloads # https://github.com/nedbat/coveragepy/issues/970#issuecomment-612602180 @@ -69,12 +61,6 @@ exclude_lines = [ "@overload", ] -[tool.isort] -profile = "black" -known_first_party = ["tests", "torchseg", "train"] -skip_gitignore = true -color_output = true - [tool.pytest.ini_options] norecursedirs = [ ".ipynb_checkpoints", @@ -95,3 +81,45 @@ torchseg = ["py.typed"] [tool.setuptools.packages.find] include = ["torchseg*"] + +[tool.ruff] +exclude = [ + # Extra files + "data/", + "images/", + "logo/", + "logs/", + "output/", + + # Docs + "docs/src/", + + # Spack + ".spack-env/", + + # Python + "build/", + "dist/", + ".cache/", + ".mypy_cache/", + ".pytest_cache/", + "__pycache__/", + "*.egg-info/", + + # Git + ".git/", + ".github/", +] + +line-length = 88 +indent-width = 4 +target-version = "py311" + +[tool.ruff.format] +skip-magic-trailing-comma = true + +[tool.ruff.lint] +ignore = ["E203"] + +[tool.ruff.lint.isort] +known-first-party = ["tests", "torchseg"] \ No newline at end of file diff --git a/requirements/style.txt b/requirements/style.txt index 5080345a..efb6ec75 100644 --- a/requirements/style.txt +++ b/requirements/style.txt @@ -1,5 +1,2 @@ # style -black[jupyter]==24.3.0 -flake8==7.0.0 -isort[colors]==5.13.2 -pyupgrade==3.15.2 \ No newline at end of file +ruff==0.3.5 \ No newline at end of file From e3d05dcb5a06e7d47afb03e8adeef41cbe571b5c Mon Sep 17 00:00:00 2001 From: isaaccorley <22203655+isaaccorley@users.noreply.github.com> Date: Sat, 13 Apr 2024 12:28:24 -0500 Subject: [PATCH 02/12] update ruff commands and settings --- .github/workflows/style.yml | 24 +++++++++++++++++++--- .gitignore | 6 ++++++ README.md | 22 +++++++++++++++++++- pyproject.toml | 40 +++++++++---------------------------- 4 files changed, 57 insertions(+), 35 deletions(-) diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index be1e0da4..70d4b8aa 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -9,8 +9,8 @@ on: - main - release** jobs: - ruff: - name: ruff + ruff-formatting: + name: ruff-formatting runs-on: ubuntu-latest steps: - name: Clone repo @@ -26,7 +26,25 @@ jobs: - name: List pip dependencies run: pip list - name: Run ruff checks - run: ruff format --check -v + run: ruff format --check + ruff-linting: + name: ruff-linting + runs-on: ubuntu-latest + steps: + - name: Clone repo + uses: actions/checkout@v4.1.1 + - name: Set up python + uses: actions/setup-python@v5.0.0 + with: + python-version: '3.11' + - name: Install pip dependencies + run: | + pip install -r requirements/style.txt + pip cache purge + - name: List pip dependencies + run: pip list + - name: Run ruff checks + run: ruff check concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.head.label || github.head_ref || github.ref }} cancel-in-progress: true \ No newline at end of file diff --git a/.gitignore b/.gitignore index b0990628..21cb8ecb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,9 @@ +data/ +images/ +logo/ +logs/ +output/ + # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] diff --git a/README.md b/README.md index d3cf3009..15c3fa3d 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ The goal of this fork is to 1) provide maintenance support for the original libr Additionally we have performed the following for improved software standards: - More thorough testing and CI -- Formatting using `black`, `isort`, `flake8`, `mypy` +- Formatting using `ruff` and `mypy` - Reduction of dependence on unmaintained libraries (now depends only on `torch`, `timm`, and `einops`) - Reduce lines of code to maintain (removed custom utils, metrics, encoders) in favor of newer libraries such as `torchmetrics` and `timm` @@ -227,3 +227,23 @@ Note that some models like `ConvNext` and `Swin` only have 4 intermediate featur ```python model = torchseg.Unet('resnet50', encoder_depth=4) ``` + +## Contribute + +We welcome new contributions for modern semantic segmentation models, losses, and methods! + +#### Install dev dependencies + +For development you can install the required dependencies using `pip install '.[all]'. + +#### Code Formatting + +To format files `ruff format --fix` and `ruff check --fix` + +#### Code Linting + +To check for linting errors run `ruff check` + +#### Tests + +To run tests use `pytest -ra` diff --git a/pyproject.toml b/pyproject.toml index b4ae4df2..4d851ba2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -83,43 +83,21 @@ torchseg = ["py.typed"] include = ["torchseg*"] [tool.ruff] -exclude = [ - # Extra files - "data/", - "images/", - "logo/", - "logs/", - "output/", - - # Docs - "docs/src/", - - # Spack - ".spack-env/", - - # Python - "build/", - "dist/", - ".cache/", - ".mypy_cache/", - ".pytest_cache/", - "__pycache__/", - "*.egg-info/", - - # Git - ".git/", - ".github/", -] - line-length = 88 -indent-width = 4 -target-version = "py311" +src = ["torchseg", "tests", "scripts"] +show-fixes = true [tool.ruff.format] skip-magic-trailing-comma = true +docstring-code-format = true [tool.ruff.lint] ignore = ["E203"] +extend-select = ["UP", "I"] [tool.ruff.lint.isort] -known-first-party = ["tests", "torchseg"] \ No newline at end of file +known-first-party = ["tests", "torchseg"] +split-on-trailing-comma=false + +[tool.ruff.lint.pydocstyle] +convention = "google" \ No newline at end of file From 1118d1778e65efb7c352dfbab09d7c98afe76c89 Mon Sep 17 00:00:00 2001 From: isaaccorley <22203655+isaaccorley@users.noreply.github.com> Date: Sat, 13 Apr 2024 12:33:20 -0500 Subject: [PATCH 03/12] fix import sorting --- pyproject.toml | 2 -- tests/test_losses.py | 1 - tests/test_models.py | 1 - 3 files changed, 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4d851ba2..c1fbf9fb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -83,7 +83,6 @@ torchseg = ["py.typed"] include = ["torchseg*"] [tool.ruff] -line-length = 88 src = ["torchseg", "tests", "scripts"] show-fixes = true @@ -96,7 +95,6 @@ ignore = ["E203"] extend-select = ["UP", "I"] [tool.ruff.lint.isort] -known-first-party = ["tests", "torchseg"] split-on-trailing-comma=false [tool.ruff.lint.pydocstyle] diff --git a/tests/test_losses.py b/tests/test_losses.py index 74d07b3b..ba84607f 100644 --- a/tests/test_losses.py +++ b/tests/test_losses.py @@ -1,6 +1,5 @@ import pytest import torch - import torchseg import torchseg.losses._functional as F from torchseg.losses import ( diff --git a/tests/test_models.py b/tests/test_models.py index 106ec4c1..4524792c 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -1,6 +1,5 @@ import pytest import torch - import torchseg from torchseg.encoders import mix_transformer_encoders From 658eeaa23aa644059ee85047f791c5cf9e25bd1d Mon Sep 17 00:00:00 2001 From: isaaccorley <22203655+isaaccorley@users.noreply.github.com> Date: Sat, 13 Apr 2024 12:51:53 -0500 Subject: [PATCH 04/12] update to auto fix when running ruff check --- .github/workflows/style.yml | 2 +- pyproject.toml | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 70d4b8aa..4324c957 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -44,7 +44,7 @@ jobs: - name: List pip dependencies run: pip list - name: Run ruff checks - run: ruff check + run: ruff check --output-format=github --exit-non-zero-on-fix concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.head.label || github.head_ref || github.ref }} cancel-in-progress: true \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index c1fbf9fb..3d058d88 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -85,6 +85,8 @@ include = ["torchseg*"] [tool.ruff] src = ["torchseg", "tests", "scripts"] show-fixes = true +fix = true +unsafe-fixes = true [tool.ruff.format] skip-magic-trailing-comma = true @@ -98,4 +100,8 @@ extend-select = ["UP", "I"] split-on-trailing-comma=false [tool.ruff.lint.pydocstyle] -convention = "google" \ No newline at end of file +convention = "google" + +[tool.ruff.lint.per-file-ignores] +"docs/**" = ["D"] +"tests/**" = ["D"] \ No newline at end of file From 874468a797ff6188180146ead4d99db60cf503e1 Mon Sep 17 00:00:00 2001 From: isaaccorley <22203655+isaaccorley@users.noreply.github.com> Date: Sat, 13 Apr 2024 12:52:07 -0500 Subject: [PATCH 05/12] test that CI throws an error --- torchseg/decoders/fpn/decoder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/torchseg/decoders/fpn/decoder.py b/torchseg/decoders/fpn/decoder.py index 7f78d727..9ffd3061 100644 --- a/torchseg/decoders/fpn/decoder.py +++ b/torchseg/decoders/fpn/decoder.py @@ -1,6 +1,6 @@ -import torch import torch.nn as nn import torch.nn.functional as F +import torch class Conv3x3GNReLU(nn.Module): From 2d29c9bb716ccc95f1122114bbab35c3c9b81524 Mon Sep 17 00:00:00 2001 From: isaaccorley <22203655+isaaccorley@users.noreply.github.com> Date: Sat, 13 Apr 2024 12:59:22 -0500 Subject: [PATCH 06/12] try again --- .github/workflows/style.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 4324c957..698741c8 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -44,7 +44,7 @@ jobs: - name: List pip dependencies run: pip list - name: Run ruff checks - run: ruff check --output-format=github --exit-non-zero-on-fix + run: ruff check --output-format=github concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.head.label || github.head_ref || github.ref }} cancel-in-progress: true \ No newline at end of file From 85a702e6b95c4ba6b26f749fb8f4c841ae6540f3 Mon Sep 17 00:00:00 2001 From: isaaccorley <22203655+isaaccorley@users.noreply.github.com> Date: Sat, 13 Apr 2024 13:01:46 -0500 Subject: [PATCH 07/12] try without output format --- .github/workflows/style.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 698741c8..8692bfb2 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -44,7 +44,7 @@ jobs: - name: List pip dependencies run: pip list - name: Run ruff checks - run: ruff check --output-format=github + run: ruff check --exit-non-zero-on-fix concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.head.label || github.head_ref || github.ref }} cancel-in-progress: true \ No newline at end of file From 27827e4397baf0bb0d5ef4d8f43ad7347ed62e7f Mon Sep 17 00:00:00 2001 From: isaaccorley <22203655+isaaccorley@users.noreply.github.com> Date: Sat, 13 Apr 2024 13:19:16 -0500 Subject: [PATCH 08/12] fix --- torchseg/decoders/fpn/decoder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/torchseg/decoders/fpn/decoder.py b/torchseg/decoders/fpn/decoder.py index 9ffd3061..7f78d727 100644 --- a/torchseg/decoders/fpn/decoder.py +++ b/torchseg/decoders/fpn/decoder.py @@ -1,6 +1,6 @@ +import torch import torch.nn as nn import torch.nn.functional as F -import torch class Conv3x3GNReLU(nn.Module): From 1dcaa360ad599a357865427a604ae0318feafeda Mon Sep 17 00:00:00 2001 From: isaaccorley <22203655+isaaccorley@users.noreply.github.com> Date: Sat, 13 Apr 2024 13:21:40 -0500 Subject: [PATCH 09/12] update min version of ruff --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3d058d88..d9b1c855 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,7 +40,7 @@ dynamic = ["version"] [project.optional-dependencies] style = [ - "ruff>=0.3.0" + "ruff>=0.2.0" ] tests = [ "pytest>=7.3", From 75eb401e4941aa9d428801204e959db0e7350e6f Mon Sep 17 00:00:00 2001 From: isaaccorley <22203655+isaaccorley@users.noreply.github.com> Date: Sat, 13 Apr 2024 15:07:46 -0500 Subject: [PATCH 10/12] update --- .github/workflows/style.yml | 37 ++++++++++++++----------------------- pyproject.toml | 14 ++++---------- requirements/style.txt | 2 +- tests/test_losses.py | 1 + tests/test_models.py | 1 + 5 files changed, 21 insertions(+), 34 deletions(-) diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 8692bfb2..e64e8dc6 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -9,42 +9,33 @@ on: - main - release** jobs: - ruff-formatting: - name: ruff-formatting + ruff: + name: ruff runs-on: ubuntu-latest steps: - name: Clone repo - uses: actions/checkout@v4.1.1 + uses: actions/checkout@v4.1.2 - name: Set up python - uses: actions/setup-python@v5.0.0 + uses: actions/setup-python@v5.1.0 with: - python-version: '3.11' - - name: Install pip dependencies - run: | - pip install -r requirements/style.txt - pip cache purge - - name: List pip dependencies - run: pip list - - name: Run ruff checks - run: ruff format --check - ruff-linting: - name: ruff-linting - runs-on: ubuntu-latest - steps: - - name: Clone repo - uses: actions/checkout@v4.1.1 - - name: Set up python - uses: actions/setup-python@v5.0.0 + python-version: '3.12' + - name: Cache dependencies + uses: actions/cache@v4.0.2 + id: cache with: - python-version: '3.11' + path: ${{ env.pythonLocation }} + key: ${{ env.pythonLocation }}-${{ hashFiles('requirements/style.txt') }} - name: Install pip dependencies + if: steps.cache.outputs.cache-hit != 'true' run: | pip install -r requirements/style.txt pip cache purge - name: List pip dependencies run: pip list - name: Run ruff checks - run: ruff check --exit-non-zero-on-fix + run: | + ruff check --no-fix + ruff format --diff concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.head.label || github.head_ref || github.ref }} cancel-in-progress: true \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index d9b1c855..cb5da30f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,6 +40,7 @@ dynamic = ["version"] [project.optional-dependencies] style = [ + # ruff 0.2+ required for [ruff.lint] "ruff>=0.2.0" ] tests = [ @@ -83,25 +84,18 @@ torchseg = ["py.typed"] include = ["torchseg*"] [tool.ruff] -src = ["torchseg", "tests", "scripts"] -show-fixes = true +extend-include = ["*.ipynb"] fix = true -unsafe-fixes = true +show-fixes = true [tool.ruff.format] skip-magic-trailing-comma = true -docstring-code-format = true [tool.ruff.lint] -ignore = ["E203"] -extend-select = ["UP", "I"] +extend-select = ["I", "UP"] [tool.ruff.lint.isort] split-on-trailing-comma=false [tool.ruff.lint.pydocstyle] convention = "google" - -[tool.ruff.lint.per-file-ignores] -"docs/**" = ["D"] -"tests/**" = ["D"] \ No newline at end of file diff --git a/requirements/style.txt b/requirements/style.txt index efb6ec75..038caa5a 100644 --- a/requirements/style.txt +++ b/requirements/style.txt @@ -1,2 +1,2 @@ # style -ruff==0.3.5 \ No newline at end of file +ruff==0.3.7 \ No newline at end of file diff --git a/tests/test_losses.py b/tests/test_losses.py index ba84607f..74d07b3b 100644 --- a/tests/test_losses.py +++ b/tests/test_losses.py @@ -1,5 +1,6 @@ import pytest import torch + import torchseg import torchseg.losses._functional as F from torchseg.losses import ( diff --git a/tests/test_models.py b/tests/test_models.py index 4524792c..106ec4c1 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -1,5 +1,6 @@ import pytest import torch + import torchseg from torchseg.encoders import mix_transformer_encoders From 6930106c52c5edf6d451274989c4fb4c6d3cd81b Mon Sep 17 00:00:00 2001 From: isaaccorley <22203655+isaaccorley@users.noreply.github.com> Date: Sun, 14 Apr 2024 10:51:44 -0500 Subject: [PATCH 11/12] add output-format=github --- .github/workflows/style.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index e64e8dc6..d688e81f 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -34,7 +34,7 @@ jobs: run: pip list - name: Run ruff checks run: | - ruff check --no-fix + ruff check --output-format=github --no-fix . ruff format --diff concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.head.label || github.head_ref || github.ref }} From 07caa22f2b1193a979852b99d03b0a1a3dd0e854 Mon Sep 17 00:00:00 2001 From: isaaccorley <22203655+isaaccorley@users.noreply.github.com> Date: Tue, 16 Apr 2024 20:56:34 -0500 Subject: [PATCH 12/12] fixes per suggestions --- README.md | 8 ++------ pyproject.toml | 3 +-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 15c3fa3d..b68f91c0 100644 --- a/README.md +++ b/README.md @@ -236,13 +236,9 @@ We welcome new contributions for modern semantic segmentation models, losses, an For development you can install the required dependencies using `pip install '.[all]'. -#### Code Formatting +#### Code Formatting/Linting -To format files `ruff format --fix` and `ruff check --fix` - -#### Code Linting - -To check for linting errors run `ruff check` +To format files run `ruff format`. To check for linting errors run `ruff check`. #### Tests diff --git a/pyproject.toml b/pyproject.toml index cb5da30f..4f7e5eb0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -84,7 +84,6 @@ torchseg = ["py.typed"] include = ["torchseg*"] [tool.ruff] -extend-include = ["*.ipynb"] fix = true show-fixes = true @@ -95,7 +94,7 @@ skip-magic-trailing-comma = true extend-select = ["I", "UP"] [tool.ruff.lint.isort] -split-on-trailing-comma=false +split-on-trailing-comma = false [tool.ruff.lint.pydocstyle] convention = "google"