Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI(deps): Update black to v25 (major) #5022

Merged
merged 4 commits into from
Feb 1, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
style: Apply ruff format changes not conflicting with Black 25
echoix committed Feb 1, 2025
commit d31152ec30ec4c3b37aa529aa7352f0740ee78c2
1 change: 1 addition & 0 deletions db/db.describe/testsuite/test_dbdescribe.py
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@

@author: lucadelu
"""

import json

from grass.gunittest.case import TestCase
5 changes: 3 additions & 2 deletions gui/wxpython/animation/provider.py
Original file line number Diff line number Diff line change
@@ -217,8 +217,9 @@ def Load(self, force=False, bgcolor=(255, 255, 255), nprocs=4):
"""
Debug.msg(
2,
"BitmapProvider.Load: "
"force={f}, bgcolor={b}, nprocs={n}".format(f=force, b=bgcolor, n=nprocs),
"BitmapProvider.Load: force={f}, bgcolor={b}, nprocs={n}".format(
f=force, b=bgcolor, n=nprocs
),
)
cmds = []
regions = []
5 changes: 1 addition & 4 deletions gui/wxpython/core/settings.py
Original file line number Diff line number Diff line change
@@ -998,10 +998,7 @@ def SaveToFile(self, settings=None):
raise GException(e)
except Exception as e:
raise GException(
_(
"Writing settings to file <%(file)s> failed."
"\n\nDetails: %(detail)s"
)
_("Writing settings to file <%(file)s> failed.\n\nDetails: %(detail)s")
% {"file": self.filePath, "detail": e}
)
return self.filePath
1 change: 0 additions & 1 deletion gui/wxpython/core/testsuite/test_gcmd.py
Original file line number Diff line number Diff line change
@@ -17,7 +17,6 @@ def recv(self):


class Recv_SomeTest(TestCase):

@xfail_windows
def test_decode(self):
"""
5 changes: 1 addition & 4 deletions gui/wxpython/core/toolboxes.py
Original file line number Diff line number Diff line change
@@ -149,10 +149,7 @@ def getMenudataFile(userRootFile, newFile, fallback):
generateNew = True
_debug(
2,
(
"toolboxes.getMenudataFile: only one of the user "
"defined files"
),
("toolboxes.getMenudataFile: only one of the user defined files"),
)
else:
# if newer files -> generate new
3 changes: 1 addition & 2 deletions gui/wxpython/datacatalog/dialogs.py
Original file line number Diff line number Diff line change
@@ -143,8 +143,7 @@ def _doLayout(self):
dialogSizer.Add(optionsSizer, proportion=1, flag=wx.ALL | wx.EXPAND, border=10)
helptext = StaticText(
self.panel,
label="For more reprojection options,"
" please see {module}".format(
label="For more reprojection options, please see {module}".format(
module="r.proj" if self.etype == "raster" else "v.proj"
),
)
8 changes: 2 additions & 6 deletions gui/wxpython/dbmgr/base.py
Original file line number Diff line number Diff line change
@@ -198,8 +198,7 @@ def LoadData(self, layer, columns=None, where=None, sql=None):
GError(
parent=self,
message=_(
"Column <%(column)s> not found in "
"in the table <%(table)s>."
"Column <%(column)s> not found in in the table <%(table)s>."
)
% {"column": col, "table": tableName},
)
@@ -1642,10 +1641,7 @@ def OnDataItemAdd(self, event):
try:
if cat in tlist.itemCatsMap.values():
raise ValueError(
_(
"Record with category number %d "
"already exists in the table."
)
_("Record with category number %d already exists in the table.")
% cat
)

14 changes: 4 additions & 10 deletions gui/wxpython/gcp/manager.py
Original file line number Diff line number Diff line change
@@ -503,10 +503,7 @@ def OnMapset(self, event):
def OnPageChanging(self, event: WizardEvent | None = None) -> None:
if event.GetDirection() and (self.xylocation == "" or self.xymapset == ""):
GMessage(
_(
"You must select a valid location "
"and mapset in order to continue"
),
_("You must select a valid location and mapset in order to continue"),
parent=self,
)
event.Veto()
@@ -2020,8 +2017,7 @@ def RMSError(self, xygroup, order):
GError(
parent=self,
message=_(
"Could not calculate RMS Error.\n"
"Possible error with m.transform."
"Could not calculate RMS Error.\nPossible error with m.transform."
),
)
return
@@ -2153,8 +2149,7 @@ def GetNewExtent(self, region, map=None):
GError(
parent=self,
message=_(
"Could not calculate new extends.\n"
"Possible error with m.transform."
"Could not calculate new extends.\nPossible error with m.transform."
),
)
return
@@ -3258,8 +3253,7 @@ def OnSDFactor(self, event):
GError(
parent=self,
message=_(
"RMS threshold factor is < 1\n"
"Too many points might be highlighted"
"RMS threshold factor is < 1\nToo many points might be highlighted"
),
)

3 changes: 1 addition & 2 deletions gui/wxpython/gmodeler/dialogs.py
Original file line number Diff line number Diff line change
@@ -469,8 +469,7 @@ def _getOptions(self):
GError(
parent=self.parent,
message=_(
"Relation doesn't point to GRASS command.\n"
"Unable to add relation."
"Relation doesn't point to GRASS command.\nUnable to add relation."
),
)
return items
11 changes: 5 additions & 6 deletions gui/wxpython/gmodeler/model.py
Original file line number Diff line number Diff line change
@@ -2704,9 +2704,9 @@ def _writeActinia(self):

self.fd.write(
f"""{{
{' ' * self.indent * 1}"id": "model",
{' ' * self.indent * 1}"description": "{'""'.join(description.splitlines())}",
{' ' * self.indent * 1}"version": "1",
{" " * self.indent * 1}"id": "model",
{" " * self.indent * 1}"description": "{'""'.join(description.splitlines())}",
{" " * self.indent * 1}"version": "1",
"""
)

@@ -2723,12 +2723,12 @@ def _writeActinia(self):
if parameterized is True:
self.fd.write(f'{" " * self.indent * 1}"template": {{\n')
self.fd.write(
f"""{' ' * self.indent * 2}"list": [
f"""{" " * self.indent * 2}"list": [
"""
)
else:
self.fd.write(
f"""{' ' * self.indent}"list": [
f"""{" " * self.indent}"list": [
"""
)

@@ -2781,7 +2781,6 @@ def _getPythonActionCmd(self, item, task, cmdIndent, variables={}):
value = p.get("value", None)

if (name and value) or (name in parameterizedParams):

if name in parameterizedParams:
parameterizedParam = self._getParamName(name, item)
default_val = p.get("value", "")
3 changes: 1 addition & 2 deletions gui/wxpython/gui_core/dialogs.py
Original file line number Diff line number Diff line change
@@ -2357,8 +2357,7 @@ def __init__(

if self._shell_running:
text = _(
"Do you want to quit GRASS GIS including shell "
"or just close the GUI?"
"Do you want to quit GRASS GIS including shell or just close the GUI?"
)
else:
text = _("Do you want to quit GRASS GIS?")
3 changes: 1 addition & 2 deletions gui/wxpython/gui_core/forms.py
Original file line number Diff line number Diff line change
@@ -73,8 +73,7 @@
if os.getenv("GISBASE") is None:
# intentionally not translatable
sys.exit(
"Failed to start. GRASS GIS is not running"
" or the installation is broken."
"Failed to start. GRASS GIS is not running or the installation is broken."
)
from grass.script.setup import set_gui_path

5 changes: 2 additions & 3 deletions gui/wxpython/gui_core/gselect.py
Original file line number Diff line number Diff line change
@@ -2532,7 +2532,7 @@ def _getPGDBTablesColumnsTypesSql(self, tables):
pg_catalog.pg_table_is_visible(c.oid)
) AS o ON a.attrelid = o.oid
WHERE
relname IN ({', '.join(tables)})
relname IN ({", ".join(tables)})
AND NOT a.attisdropped;
"""

@@ -2608,8 +2608,7 @@ def _getPGDBRasters(self, dsn):
GError(
parent=self,
message=_(
"PostgreSQL DB <{psql}> program was not found."
" Please, install it."
"PostgreSQL DB <{psql}> program was not found. Please, install it."
).format(psql=self._psql),
)
Debug.msg(3, f"GdalSelect._getPGDBRasters(): return {rasters}")
3 changes: 1 addition & 2 deletions gui/wxpython/gui_core/pyedit.py
Original file line number Diff line number Diff line change
@@ -305,8 +305,7 @@ def _openFile(self, file_path):
except PermissionError:
GError(
message=_(
"Permission denied <{}>. Please change file "
"permission for reading."
"Permission denied <{}>. Please change file permission for reading."
).format(file_path),
parent=self.guiparent,
showTraceback=False,
1 change: 0 additions & 1 deletion gui/wxpython/history/tree.py
Original file line number Diff line number Diff line change
@@ -317,7 +317,6 @@ def _initHistoryModel(self):
Populate the tree history model based on the current history log.
"""
for entry in self.ReadFromHistory():

# Get history day node
day_node = self.GetHistoryNode(entry)

3 changes: 1 addition & 2 deletions gui/wxpython/image2target/ii2t_gis_set.py
Original file line number Diff line number Diff line change
@@ -864,8 +864,7 @@ def UpdateLocations(self, dbase):
GError(
parent=self,
message=_(
"Unicode error detected. "
"Check your locale settings. Details: {0}"
"Unicode error detected. Check your locale settings. Details: {0}"
).format(e),
showTraceback=False,
)
8 changes: 2 additions & 6 deletions gui/wxpython/image2target/ii2t_manager.py
Original file line number Diff line number Diff line change
@@ -527,10 +527,7 @@ def OnMapset(self, event):
def OnPageChanging(self, event: WizardEvent | None = None) -> None:
if event.GetDirection() and (self.xylocation == "" or self.xymapset == ""):
GMessage(
_(
"You must select a valid location "
"and mapset in order to continue"
),
_("You must select a valid location and mapset in order to continue"),
parent=self,
)
event.Veto()
@@ -3220,8 +3217,7 @@ def OnSDFactor(self, event):
GError(
parent=self,
message=_(
"RMS threshold factor is < 1\n"
"Too many points might be highlighted"
"RMS threshold factor is < 1\nToo many points might be highlighted"
),
)

6 changes: 2 additions & 4 deletions gui/wxpython/lmgr/frame.py
Original file line number Diff line number Diff line change
@@ -968,8 +968,7 @@ def RunSpecialCmd(self, command):
else:
result = False
raise ValueError(
"Layer Manager special command (%s)"
" not supported." % " ".join(command)
"Layer Manager special command (%s) not supported." % " ".join(command)
)
if result:
self._gconsole.UpdateHistory(status=Status.SUCCESS)
@@ -1185,8 +1184,7 @@ def OnVDigit(self, event):
GMessage(
parent=self,
message=_(
"Editing is allowed only for vector maps from the "
"current mapset."
"Editing is allowed only for vector maps from the current mapset."
),
)
return
6 changes: 2 additions & 4 deletions gui/wxpython/main_window/frame.py
Original file line number Diff line number Diff line change
@@ -1109,8 +1109,7 @@ def RunSpecialCmd(self, command):
else:
result = False
raise ValueError(
"Layer Manager special command (%s)"
" not supported." % " ".join(command)
"Layer Manager special command (%s) not supported." % " ".join(command)
)
if result:
self._gconsole.UpdateHistory(status=Status.SUCCESS)
@@ -1340,8 +1339,7 @@ def OnVDigit(self, event):
GMessage(
parent=self,
message=_(
"Editing is allowed only for vector maps from the "
"current mapset."
"Editing is allowed only for vector maps from the current mapset."
),
)
return
3 changes: 1 addition & 2 deletions gui/wxpython/mapdisp/toolbars.py
Original file line number Diff line number Diff line change
@@ -67,8 +67,7 @@
img="flythrough",
label=_("Fly-through mode"),
desc=_(
"Drag with mouse, hold Ctrl down for different mode"
" or Shift to accelerate"
"Drag with mouse, hold Ctrl down for different mode or Shift to accelerate"
),
),
"zoomIn": BaseIcons["zoomIn"].SetLabel(desc=_("Click mouse to zoom")),
5 changes: 3 additions & 2 deletions gui/wxpython/mapwin/buffered.py
Original file line number Diff line number Diff line change
@@ -743,8 +743,9 @@ def _saveToFileDone(self, callback=None):
# draw any active and defined overlays
if self.imagedict[img]["layer"].IsActive():
id = self.imagedict[img]["id"]
coords = int(ratio[0] * self.overlays[id].coords[0]), int(
ratio[1] * self.overlays[id].coords[1]
coords = (
int(ratio[0] * self.overlays[id].coords[0]),
int(ratio[1] * self.overlays[id].coords[1]),
)
self.Draw(
self.pdc,
3 changes: 1 addition & 2 deletions gui/wxpython/modules/import_export.py
Original file line number Diff line number Diff line change
@@ -502,8 +502,7 @@ def OnRun(self, event):
GError(
parent=self,
message=_(
"The Python GDAL package is missing."
" Please install it."
"The Python GDAL package is missing. Please install it."
),
)
return
1 change: 0 additions & 1 deletion gui/wxpython/nviz/mapwindow.py
Original file line number Diff line number Diff line change
@@ -69,7 +69,6 @@ class RenderTypedDict(TypedDict):


class NvizThread(Thread):

def __init__(self, log, progressbar, window) -> None:
Thread.__init__(self)
Debug.msg(5, "NvizThread.__init__():")
7 changes: 2 additions & 5 deletions gui/wxpython/nviz/wxnviz.py
Original file line number Diff line number Diff line change
@@ -326,7 +326,6 @@ def print_progress(value):


class Nviz:

def __init__(self, glog, gprogress) -> None:
"""Initialize Nviz class instance

@@ -1397,8 +1396,7 @@ def SetVectorPointMode(

Debug.msg(
3,
"Nviz::SetVectorPointMode(): id=%d, color=%s, "
"width=%d, size=%f, marker=%d",
"Nviz::SetVectorPointMode(): id=%d, color=%s, width=%d, size=%f, marker=%d",
id,
color_str,
width,
@@ -1999,8 +1997,7 @@ def SetIsosurfaceAttr(

Debug.msg(
3,
"Nviz::SetIsosurfaceAttr(): id=%d, isosurf=%d, "
"attr=%d, map=%s, value=%s",
"Nviz::SetIsosurfaceAttr(): id=%d, isosurf=%d, attr=%d, map=%s, value=%s",
id,
isosurf_id,
attr,
1 change: 1 addition & 0 deletions gui/wxpython/photo2image/g.gui.photo2image.py
Original file line number Diff line number Diff line change
@@ -69,6 +69,7 @@
"""
Module to run GCP management tool as standalone application.
"""

import os
import grass.script as gs

Loading