Skip to content

Commit

Permalink
replace isort with Ruff (#325)
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam authored Nov 6, 2024
1 parent 6702500 commit 62181ec
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 28 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ jobs:
- name: Check out code
uses: actions/checkout@v2

- name: Run isort
uses: isort/isort-action@v1
- name: Run Ruff
uses: astral-sh/ruff-action@v1

- name: Run Black
uses: psf/black@stable
Expand Down
70 changes: 46 additions & 24 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,63 @@
line_length = 130
target_version = ["py37"]

[tool.isort]
profile = "black"
combine_as_imports = true
line_length = 130
extra_standard_library = [
[tool.ruff]
line-length = 130

[tool.ruff.lint]
select = [
"I", # isort
]

[tool.ruff.lint.isort]
combine-as-imports = true
extra-standard-library = [
"typing_extensions",
"_typeshed",
# Extra modules not recognized by isort
# Extra modules not recognized by Ruff/isort
"_ast",
"_bisect",
"_bootlocale",
"_codecs",
"_collections_abc",
"_compat_pickle",
"_compression",
"_csv",
"_ctypes",
"_curses",
"_decimal",
"_dummy_thread",
"_dummy_threading",
"_heapq",
"_imp",
"_json",
"_locale",
"_lsprof",
"_markupbase",
"_msi",
"_operator",
"_osx_support",
"_posixsubprocess",
"_py_abc",
"_pydecimal",
"_random",
"_sitebuiltins",
"_socket",
"_sqlite3",
"_ssl",
"_stat",
"_thread",
"_threading_local",
"_tkinter",
"_tracemalloc",
"_warnings",
"_weakref",
"_weakrefset",
"_winapi",
"genericpath",
"opcode",
"pyexpat",
# Python 2 modules
"__builtin__",
"cookielib",
"cStringIO",
"httplib",
"mimetools",
"rfc822",
"thread",
"urllib2",
"urlparse",
"BaseHTTPServer",
"Queue",
"SimpleHTTPServer",
"SocketServer",
"StringIO",
"UserDict",
"UserList",
"UserString",
"zoneinfo",
]

[tool.mypy]
Expand Down
10 changes: 8 additions & 2 deletions stubs/vispy/color/color_array.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@ import numpy as np

from ..util import logger
from ._color_dict import _color_dict
from .color_space import _rgb_to_hsv # noqa
from .color_space import _hex_to_rgba, _hsv_to_rgb, _lab_to_rgb, _rgb_to_hex, _rgb_to_lab # noqa
from .color_space import ( # noqa
_hex_to_rgba,
_hsv_to_rgb,
_lab_to_rgb,
_rgb_to_hex,
_rgb_to_hsv, # noqa
_rgb_to_lab,
)

# -*- coding: utf-8 -*-
# Copyright (c) Vispy Development Team. All Rights Reserved.
Expand Down

0 comments on commit 62181ec

Please sign in to comment.