File tree Expand file tree Collapse file tree 7 files changed +16
-16
lines changed
Expand file tree Collapse file tree 7 files changed +16
-16
lines changed Original file line number Diff line number Diff line change 3636 # renovate: datasource=pypi depName=bandit
3737 BANDIT_VERSION : " 1.8.6"
3838 # renovate: datasource=pypi depName=ruff
39- RUFF_VERSION : " 0.13.2 "
39+ RUFF_VERSION : " 0.14.0 "
4040
4141 runs-on : ${{ matrix.os }}
4242 permissions :
Original file line number Diff line number Diff line change 4242 )
4343 - repo : https://github.com/astral-sh/ruff-pre-commit
4444 # Ruff version.
45- rev : v0.13.2
45+ rev : v0.14.0
4646 hooks :
4747 # Run the linter.
4848 - id : ruff-check
Original file line number Diff line number Diff line change 1818
1919import sys
2020import wx
21- import wx .aui
2221
2322try :
2423 import wx .lib .agw .infobar as IB
Original file line number Diff line number Diff line change 6565from wx .lib .wordwrap import wordwrap
6666
6767if wxPythonPhoenix :
68- import wx .adv
6968 from wx .adv import OwnerDrawnComboBox
7069else :
71- import wx .combo
7270 from wx .combo import OwnerDrawnComboBox
7371try :
7472 import wx .lib .agw .flatnotebook as FN
Original file line number Diff line number Diff line change 2121from pathlib import Path
2222
2323import wx
24- import wx .aui
2524
2625from core .settings import UserSettings
2726from core .gcmd import RunCommand , GError , GMessage
Original file line number Diff line number Diff line change 3636# we get annoying "Debug: Adding duplicate image handler for 'Windows bitmap file'"
3737# during start up, remove when not needed
3838import wx .adv
39- import wx .html
4039
4140try :
4241 import wx .lib .agw .advancedsplash as SC
Original file line number Diff line number Diff line change 3232
3333from __future__ import annotations
3434
35- # import traceback
35+ import atexit
3636import os
37+ import sqlite3
38+ from datetime import datetime
39+ from importlib .util import find_spec
3740from pathlib import Path
3841
3942import grass .script as gs
4245
4346from .c_libraries_interface import CLibrariesInterface
4447
45- # Import all supported database backends
46- # Ignore import errors since they are checked later
4748
48- import sqlite3
49+ # Import all supported database backends (sqlite3 imported above)
50+ # Ignore import errors since they are checked later
4951
52+ db_errors : tuple [type [sqlite3 .Error ], type [psycopg2 .Error ]] | tuple [type [sqlite3 .Error ]]
5053# Postgresql is optional, existence is checked when needed
51- try :
52- import psycopg2
54+ if find_spec ("psycopg2" ) is not None and find_spec ("psycopg2.extras" ) is not None :
55+ # Following explanations on how importing submodules work
56+ # from ruff's v0.13.3 new F401 handling https://github.com/astral-sh/ruff/pull/20200
57+ # importing "psycopg2.extras" actually makes an "import psycopg2",
58+ # making the members of the form `psycopg2.*` available, and then also imports the
59+ # extras and makes available the members of the form `psycopg2.extras.*`.
5360 import psycopg2 .extras
5461
5562 db_errors = (sqlite3 .Error , psycopg2 .Error )
56- except ImportError :
63+ else :
5764 db_errors = (sqlite3 .Error ,)
5865
59- import atexit
60- from datetime import datetime
6166
6267###############################################################################
6368
You can’t perform that action at this time.
0 commit comments