Sorted imports with isort. eric7

Wed, 21 Dec 2022 10:04:00 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 21 Dec 2022 10:04:00 +0100
branch
eric7
changeset 57
ebf3e41eff26
parent 56
bfb3a7a20a2a
child 58
610af455ef9a

Sorted imports with isort.

PluginKivy.epj file | annotate | diff | comparison | revisions
PluginProjectKivy.py file | annotate | diff | comparison | revisions
ProjectKivy/KivyLexer.py file | annotate | diff | comparison | revisions
pyproject.toml file | annotate | diff | comparison | revisions
--- a/PluginKivy.epj	Fri Dec 09 16:56:58 2022 +0100
+++ b/PluginKivy.epj	Wed Dec 21 10:04:00 2022 +0100
@@ -187,7 +187,8 @@
       "ProjectKivy/APIs/kivy.api",
       "ProjectKivy/APIs/kivy.bas",
       "ProjectKivy/Documentation/LICENSE.GPL",
-      "ProjectKivy/Documentation/source"
+      "ProjectKivy/Documentation/source",
+      "pyproject.toml"
     ],
     "OTHERTOOLSPARMS": {
       "Black": {
@@ -205,6 +206,23 @@
           "py38",
           "py37"
         ]
+      },
+      "isort": {
+        "combine_as_imports": true,
+        "config_source": "project",
+        "extend_skip_glob": [
+          "*/Ui_*.py"
+        ],
+        "lines_between_types": 1,
+        "profile": "black",
+        "sort_order": "natural",
+        "supported_extensions": [
+          "py",
+          "pyi",
+          "pyx",
+          "pxd",
+          "pyw"
+        ]
       }
     },
     "PACKAGERSPARMS": {},
--- a/PluginProjectKivy.py	Fri Dec 09 16:56:58 2022 +0100
+++ b/PluginProjectKivy.py	Wed Dec 21 10:04:00 2022 +0100
@@ -7,17 +7,16 @@
 Module implementing the Kivy project plug-in.
 """
 
-import os
+import fnmatch
 import glob
-import fnmatch
+import os
 
+from pygments.lexers._mapping import LEXERS
 from PyQt6.QtCore import QObject, QTranslator
 
 from eric7 import Preferences
 from eric7.EricWidgets.EricApplication import ericApp
 
-from pygments.lexers._mapping import LEXERS
-
 # Start-of-Header
 name = "Kivy Project Plugin"
 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
@@ -110,10 +109,10 @@
         try:
             # backward compatibility for eric7 < 22.12
             from eric7.Project.ProjectBrowser import (
+                FormsBrowserFlag,
+                OthersBrowserFlag,
                 SourcesBrowserFlag,
-                FormsBrowserFlag,
                 TranslationsBrowserFlag,
-                OthersBrowserFlag,
             )
 
             Preferences.setProjectBrowserFlagsDefault(
--- a/ProjectKivy/KivyLexer.py	Fri Dec 09 16:56:58 2022 +0100
+++ b/ProjectKivy/KivyLexer.py	Wed Dec 21 10:04:00 2022 +0100
@@ -14,7 +14,7 @@
 
 from pygments.lexer import RegexLexer, bygroups, using
 from pygments.lexers.agile import PythonLexer
-from pygments.token import Comment, Text, Name, Punctuation, Operator
+from pygments.token import Comment, Name, Operator, Punctuation, Text
 
 __all__ = ["KivyLexer"]
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pyproject.toml	Wed Dec 21 10:04:00 2022 +0100
@@ -0,0 +1,10 @@
+[tool.isort]
+profile = "black"
+sort_order = "natural"
+supported_extensions = ["py", "pyi", "pyx", "pxd", "pyw"]
+lines_between_types = 1
+extend_skip_glob = [
+    "*/Ui_*.py",
+]
+combine_as_imports = true
+known_first_party = ["ProjectKivy", "eric7"]

eric ide

mercurial