Skip to content

Commit ce94ab5

Browse files
committed
bump to newest isort, pull more deps from conda
1 parent 878813a commit ce94ab5

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

binder/environment.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,13 @@ dependencies:
1717
# isort 5.0 has breaking API changes which affect (among others) pylint and nblint;
1818
# the pin should be removed once https://github.com/PyCQA/pylint/pull/3725 is merged
1919
# see https://github.com/krassowski/jupyterlab-lsp/pull/291
20-
- isort <5
21-
- mypy
2220
- pip
2321
- pylint
22+
- pyls-black
23+
- pyls-isort
24+
- pyls-mypy
2425
- python-language-server
2526
- ruamel_yaml
26-
- pip: # not-yet-appearing-in-conda-forge
27-
- pyls-black
28-
- pyls-isort
29-
- pyls-mypy
3027
# for R language server and kernel
3128
- r
3229
- r-irkernel
@@ -36,3 +33,5 @@ dependencies:
3633
- tectonic
3734
- texlab
3835
- chktex
36+
# TODO: remove when jedi vs IPython is resolved
37+
- jedi <0.18

requirements/github-actions.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,5 @@ dependencies:
3535
- geckodriver
3636
- robotframework >=3.2
3737
- robotframework-seleniumlibrary
38+
# TODO: remove when jedi vs IPython is resolved
39+
- jedi <0.18

requirements/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dependencies:
99
# isort 5.0 has breaking API changes which affect (among others) pylint and nblint;
1010
# the pin should be removed once https://github.com/PyCQA/pylint/pull/3725 is merged
1111
# see https://github.com/krassowski/jupyterlab-lsp/pull/291
12-
- isort <5
12+
- isort
1313
- mypy
1414
- robotframework-lint >=1.1
1515
- robotframework >=3.2

scripts/nblint.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import black
77
import isort
8+
from isort.api import sort_code_string
89
import nbformat
910

1011
OK = 0
@@ -19,6 +20,7 @@
1920
]
2021
NODE = shutil.which("node")
2122

23+
ISORT_CONFIG = isort.settings.Config(settings_path=ROOT / "setup.cfg")
2224

2325
def blacken(source):
2426
return black.format_str(source, mode=black.FileMode(line_length=88))
@@ -61,7 +63,7 @@ def nblint():
6163
changes += 1
6264
if source.startswith("%"):
6365
continue
64-
new = isort.SortImports(file_contents=source).output
66+
new = isort.sort_code_string(source, config=ISORT_CONFIG)
6567
new = blacken(new).rstrip()
6668
if new != source:
6769
cell["source"] = new.splitlines(True)

setup.cfg

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,7 @@ addopts =
6969
--flake8
7070

7171
[isort]
72-
combine_as_imports = True
73-
include_trailing_comma = True
74-
line_length = 88
72+
profile = black
7573
multi_line_output = 3
7674

7775
[pycodestyle]

0 commit comments

Comments
 (0)