diff --git a/pyproject.toml b/pyproject.toml index 5c2527cd9b8..f50b474fdc2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -208,7 +208,6 @@ ignore = [ "PLW0604", # global-at-module-level "PLW1508", # invalid-envvar-default "PLW1510", # subprocess-run-without-check - "PLW1514", # unspecified-encoding "PLW1641", # eq-without-hash "PLW2901", # redefined-loop-name "PLW3201", # bad-dunder-method-name @@ -288,62 +287,163 @@ ignore = [ "gui/**" = ["PLW0108"] # See https://github.com/OSGeo/grass/issues/4124 # Other ignores: "**.py" = ["PYI066"] -"*/testsuite/**.py" = ["PT009", "PT027"] +"*/testsuite/**.py" = ["PT009", "PT027", "PLW1514"] +"display/d.mon/render_cmd.py" = ["PLW1514"] +"display/d.text/test.py" = ["PLW1514"] +"gui/wxpython/animation/temporal_manager.py" = ["PLW1514"] +"gui/wxpython/core/gconsole.py" = ["PLW1514"] +"gui/wxpython/core/render.py" = ["PLW1514"] +"gui/wxpython/core/settings.py" = ["PLW1514"] +"gui/wxpython/core/toolboxes.py" = ["PLW1514"] +"gui/wxpython/core/utils.py" = ["PLW1514"] +"gui/wxpython/core/watchdog.py" = ["PLW1514"] +"gui/wxpython/core/workspace.py" = ["PLW1514"] +"gui/wxpython/dbmgr/base.py" = ["PLW1514"] +"gui/wxpython/docs/wxgui_sphinx/conf.py" = ["PLW1514"] +"gui/wxpython/gcp/manager.py" = ["PLW1514"] +"gui/wxpython/gmodeler/model.py" = ["PLW1514"] +"gui/wxpython/gmodeler/panels.py" = ["PLW1514"] +"gui/wxpython/gui_core/forms.py" = ["PLW1514"] +"gui/wxpython/gui_core/ghelp.py" = ["PLW1514"] +"gui/wxpython/gui_core/goutput.py" = ["PLW1514"] +"gui/wxpython/gui_core/gselect.py" = ["PLW1514"] +"gui/wxpython/gui_core/pyedit.py" = ["PLW1514"] +"gui/wxpython/gui_core/widgets.py" = ["PLW1514"] +"gui/wxpython/iclass/frame.py" = ["PLW1514"] "gui/wxpython/iclass/statistics.py" = ["A005"] -"gui/wxpython/wxplot/profile.py" = ["A005", "SIM115"] +"gui/wxpython/image2target/ii2t_gis_set.py" = ["PLW1514"] +"gui/wxpython/image2target/ii2t_manager.py" = ["PLW1514"] +"gui/wxpython/location_wizard/wizard.py" = ["PLW1514"] +"gui/wxpython/mapdisp/main.py" = ["PLW1514"] +"gui/wxpython/modules/colorrules.py" = ["PLW1514"] +"gui/wxpython/modules/mcalc_builder.py" = ["PLW1514"] +"gui/wxpython/photo2image/ip2i_manager.py" = ["PLW1514"] +"gui/wxpython/psmap/instructions.py" = ["PLW1514"] +"gui/wxpython/rdigit/controller.py" = ["PLW1514"] +"gui/wxpython/rlisetup/frame.py" = ["PLW1514"] +"gui/wxpython/rlisetup/wizard.py" = ["PLW1514"] +"gui/wxpython/tools/update_menudata.py" = ["PLW1514"] +"gui/wxpython/tplot/frame.py" = ["PLW1514"] +"gui/wxpython/vdigit/mapwindow.py" = ["PLW1514"] +"gui/wxpython/vnet/vnet_core.py" = ["PLW1514"] +"gui/wxpython/vnet/vnet_data.py" = ["PLW1514"] +"gui/wxpython/web_services/dialogs.py" = ["PLW1514"] +"gui/wxpython/wxplot/profile.py" = ["A005", "PLW1514", "SIM115"] +"imagery/i.atcorr/create_iwave.py" = ["PLW1514"] "lib/imagery/testsuite/test_imagery_sigsetfile.py" = ["FURB152"] -"lib/init/grass.py" = ["SIM115"] +"lib/init/grass.py" = ["PLW1514", "SIM115"] "lib/init/testsuite/test_grass_tmp_mapset.py" = ["PTH208"] "locale/grass_po_stats.py" = ["SIM115"] -"man/build.py" = ["PTH208"] -"man/build_class_graphical.py" = ["PTH208"] -"man/build_manual_gallery.py" = ["PTH208"] -"man/build_rest.py" = ["PTH208"] +"man/build.py" = ["PLW1514", "PTH208"] +"man/build_class.py" = ["PLW1514"] +"man/build_class_graphical.py" = ["PLW1514", "PTH208"] +"man/build_full_index.py" = ["PLW1514"] +"man/build_graphical_index.py" = ["PLW1514"] +"man/build_html.py" = ["PLW1514"] +"man/build_index.py" = ["PLW1514"] +"man/build_index_rest.py" = ["PLW1514"] +"man/build_keywords.py" = ["PLW1514"] +"man/build_manual_gallery.py" = ["PLW1514", "PTH208"] +"man/build_md.py" = ["PLW1514"] +"man/build_rest.py" = ["PLW1514", "PTH208"] +"man/build_topics.py" = ["PLW1514"] +"man/parser_standard_options.py" = ["PLW1514"] "python/grass/__init__.py" = ["PYI056"] "python/grass/exp*/tests/grass_script_mapset_session_test.py" = ["SIM117"] "python/grass/exp*/tests/grass_script_tmp_mapset_session_test.py" = ["SIM117"] -"python/grass/gunittest/case.py" = ["PT009"] +"python/grass/gunittest/case.py" = ["PLW1514", "PT009"] +"python/grass/gunittest/checkers.py" = ["PLW1514"] +"python/grass/gunittest/invoker.py" = ["PLW1514"] "python/grass/gunittest/loader.py" = ["PTH208"] +"python/grass/gunittest/reporters.py" = ["PLW1514"] "python/grass/gunittest/testsu*/d*/s*/s*/subsub*/t*/test_segfaut.py" = ["B018"] "python/grass/imaging/images2ims.py" = ["PTH208"] "python/grass/jupyter/testsuite/interactivemap_test.py" = ["PGH004"] "python/grass/jupyter/testsuite/map_test.py" = ["PGH004"] +"python/grass/jupyter/utils.py" = ["PLW1514"] "python/grass/pydispatch/signal.py" = ["A005"] -"python/grass/pygrass/gis/__init__.py" = ["PTH208"] -"python/grass/pygrass/modules/grid/grid.py" = ["PTH208", "SIM115"] +"python/grass/pygrass/gis/__init__.py" = ["PLW1514", "PTH208"] +"python/grass/pygrass/modules/grid/grid.py" = ["PLW1514", "PTH208", "SIM115"] "python/grass/pygrass/modules/grid/testsuite/test_*_modules_grid_doctests.py" = ["F401"] -"python/grass/pygrass/modules/interface/env.py" = ["SIM115"] +"python/grass/pygrass/modules/interface/env.py" = ["PLW1514", "SIM115"] "python/grass/pygrass/modules/testsuite/test_pygrass_modules_doctests.py" = ["F401"] -"python/grass/pygrass/raster/category.py" = ["FURB189"] -"python/grass/pygrass/raster/segment.py" = ["SIM115"] +"python/grass/pygrass/raster/category.py" = ["FURB189", "PLW1514"] +"python/grass/pygrass/raster/segment.py" = ["PLW1514", "SIM115"] "python/grass/pygrass/tests/*.py" = ["SIM115"] +"python/grass/pygrass/tests/set_mapset.py" = ["PLW1514"] "python/grass/pygrass/utils.py" = ["PTH208"] "python/grass/pygrass/vector/geometry.py" = ["PYI024"] "python/grass/pygrass/vector/testsuite/test_table.py" = ["PLW0108"] "python/grass/script/array.py" = ["A005"] -"python/grass/script/core.py" = ["PTH208"] -"python/grass/script/utils.py" = ["FURB189"] -"python/grass/temporal/aggregation.py" = ["SIM115"] -"python/grass/temporal/register.py" = ["SIM115"] -"python/grass/temporal/stds_export.py" = ["SIM115"] -"python/grass/temporal/stds_import.py" = ["SIM115"] +"python/grass/script/core.py" = ["PLW1514", "PTH208"] +"python/grass/script/db.py" = ["PLW1514"] +"python/grass/script/raster.py" = ["PLW1514"] +"python/grass/script/setup.py" = ["PLW1514"] +"python/grass/script/utils.py" = ["FURB189", "PLW1514"] +"python/grass/semantic_label/reader.py" = ["PLW1514"] +"python/grass/temporal/abstract_space_time_dataset.py" = ["PLW1514"] +"python/grass/temporal/aggregation.py" = ["PLW1514", "SIM115"] +"python/grass/temporal/register.py" = ["PLW1514", "SIM115"] +"python/grass/temporal/stds_export.py" = ["PLW1514", "SIM115"] +"python/grass/temporal/stds_import.py" = ["PLW1514", "SIM115"] "python/grass/temporal/temporal_algebra.py" = ["D300"] "python/grass/temporal/temporal_operator.py" = ["D300"] -"python/grass/temporal/univar_statistics.py" = ["SIM115"] +"python/grass/temporal/univar_statistics.py" = ["PLW1514", "SIM115"] "python/grass/utils/download.py" = ["PTH208", "SIM115"] "raster/r.*/testsuite/*.py" = ["SIM115"] +"raster/r.mfilter/benchmark/benchmark_r_mfilter_nprocs.py" = ["PLW1514"] "raster/r.topidx/*.py" = ["SIM115"] -"scripts/d.correlate/d.correlate.py" = ["SIM115"] -"scripts/d.frame/d.frame.py" = ["SIM115"] -"scripts/d.polar/d.polar.py" = ["FURB154", "SIM115"] -"scripts/db.test/db.test.py" = ["SIM115"] +"raster/r.topidx/arc_to_gridatb.py" = ["PLW1514"] +"raster/r.topidx/gridatb_to_arc.py" = ["PLW1514"] +"scripts/d.correlate/d.correlate.py" = ["PLW1514", "SIM115"] +"scripts/d.frame/d.frame.py" = ["PLW1514", "SIM115"] +"scripts/d.out.file/d.out.file.py" = ["PLW1514"] +"scripts/d.polar/d.polar.py" = ["FURB154", "PLW1514", "SIM115"] +"scripts/d.to.rast/d.to.rast.py" = ["PLW1514"] +"scripts/d.what.rast/d.what.rast.py" = ["PLW1514"] +"scripts/d.what.vect/d.what.vect.py" = ["PLW1514"] +"scripts/db.in.ogr/db.in.ogr.py" = ["PLW1514"] +"scripts/db.test/db.test.py" = ["PLW1514", "SIM115"] +"scripts/db.univar/db.univar.py" = ["PLW1514"] "scripts/g.download.project/g.download.project.py" = ["PTH208"] -"scripts/g.extension.all/g.extension.all.py" = ["SIM115"] -"scripts/g.extension/g.extension.py" = ["PTH208", "SIM115"] +"scripts/g.extension.all/g.extension.all.py" = ["PLW1514", "SIM115"] +"scripts/g.extension/g.extension.py" = ["PLW1514", "PTH208", "SIM115"] +"scripts/g.search.modules/g.search.modules.py" = ["PLW1514"] +"scripts/i.in.spotvgt/i.in.spotvgt.py" = ["PLW1514"] +"scripts/i.oif/i.oif.py" = ["PLW1514"] "scripts/i.oif/i.oif*.py" = ["SIM115"] -"scripts/m.proj/m.proj.py" = ["SIM115"] +"scripts/i.pansharpen/i.pansharpen.py" = ["PLW1514"] +"scripts/i.spectral/i.spectral.py" = ["PLW1514"] +"scripts/m.proj/m.proj.py" = ["PLW1514", "SIM115"] +"scripts/r.fillnulls/r.fillnulls.py" = ["PLW1514"] +"scripts/r.in.srtm/r.in.srtm.py" = ["PLW1514"] "scripts/r.in.wms/wms_*.py" = ["SIM115"] +"scripts/r.in.wms/wms_base.py" = ["PLW1514"] +"scripts/r.in.wms/wms_gdal_drv.py" = ["PLW1514"] +"scripts/r.pack/r.pack.py" = ["PLW1514"] +"scripts/r.tileset/r.tileset.py" = ["PLW1514"] +"scripts/r.unpack/r.unpack.py" = ["PLW1514"] "scripts/v.*/v.*.py" = ["SIM115"] +"scripts/v.db.addcolumn/v.db.addcolumn.py" = ["PLW1514"] +"scripts/v.db.addtable/v.db.addtable.py" = ["PLW1514"] +"scripts/v.db.droptable/v.db.droptable.py" = ["PLW1514"] +"scripts/v.db.reconnect.all/v.db.reconnect.all.py" = ["PLW1514"] +"scripts/v.db.univar/v.db.univar.py" = ["PLW1514"] +"scripts/v.import/v.import.py" = ["PLW1514"] +"scripts/v.in.e00/v.in.e00.py" = ["PLW1514"] +"scripts/v.in.lines/v.in.lines.py" = ["PLW1514"] +"scripts/v.in.mapgen/v.in.mapgen.py" = ["PLW1514"] +"scripts/v.in.wfs/v.in.wfs.py" = ["PLW1514"] +"scripts/v.rast.stats/v.rast.stats.py" = ["PLW1514"] +"scripts/v.report/v.report.py" = ["PLW1514"] +"scripts/v.unpack/v.unpack.py" = ["PLW1514"] +"temporal/t.list/t.list.py" = ["PLW1514"] +"temporal/t.rast.colors/t.rast.colors.py" = ["PLW1514"] +"temporal/t.rast.series/t.rast.series.py" = ["PLW1514"] +"temporal/t.rast.what/t.rast.what.py" = ["PLW1514"] +"temporal/t.remove/t.remove.py" = ["PLW1514"] +"temporal/t.unregister/t.unregister.py" = ["PLW1514"] +"utils/*.py" = ["PLW1514"] [tool.ruff.lint.flake8-import-conventions.extend-aliases] # Declare a custom aliases, checked with rule ICN001 diff --git a/python/grass/gunittest/invoker.py b/python/grass/gunittest/invoker.py index 592d39401f8..bf94ec1185e 100644 --- a/python/grass/gunittest/invoker.py +++ b/python/grass/gunittest/invoker.py @@ -47,7 +47,7 @@ # TODO: this might be more extend then update def update_keyval_file(filename, module, returncode): if os.path.exists(filename): - keyval = text_to_keyvalue(Path(filename).read_text(), sep="=") + keyval = text_to_keyvalue(Path(filename).read_text(encoding="utf-8"), sep="=") else: keyval = {} @@ -66,7 +66,7 @@ def update_keyval_file(filename, module, returncode): keyval["returncode"] = returncode keyval["test_file_authors"] = test_file_authors - Path(filename).write_text(keyvalue_to_text(keyval)) + Path(filename).write_text(keyvalue_to_text(keyval), encoding="utf-8") return keyval @@ -351,7 +351,8 @@ def run_in_location( " (testsuite directories)" '
  • Results by test files
  • ' "