]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
python-common: copy mgr isort tox config into this tox.ini
authorJohn Mulligan <jmulligan@redhat.com>
Fri, 3 Apr 2026 15:23:23 +0000 (11:23 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Wed, 27 May 2026 18:26:52 +0000 (14:26 -0400)
For consistency, add tox env for running isort in python common.
Basically copies the tox.ini config.
Like pybind/mgr this is 'opt in' so we only initially have the smb
module listed here.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/python-common/tox.ini

index 0bcddea887baed257c8ecd282acc9461a19f0b00..930d818c560fac7347f9f3dedc0c2239aec0a41f 100644 (file)
@@ -54,3 +54,27 @@ commands =
 deps = {[black]deps}
 commands =
     black {[black]options} {[black]modules}
+
+
+# OPT-IN import style formatting with 'isort'
+#  add your module to the modules list below to use automated import sorting
+[isortcfg]
+deps = isort
+modules = ceph/smb
+
+[isort]
+profile = black
+line_length = 78
+known_first_party = ceph,rados,rbd,cephfs,mgr
+known_typing = typing
+sections = FUTURE,TYPING,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
+
+[testenv:check-isort]
+deps = {[isortcfg]deps}
+commands =
+    isort --check-only {[isortcfg]modules}
+
+[testenv:format-isort]
+deps = {[isortcfg]deps}
+commands =
+    isort {[isortcfg]modules}