From b7ba908f2ae3129e30117a891d7d1f6415185657 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Besson?= Date: Sat, 20 Jan 2024 09:23:05 +0000 Subject: [PATCH 01/16] Remove all imports of print_function compatibility method --- components/antlib/scripts/parse_version | 1 - components/antlib/scripts/source-archive.py | 2 -- .../tools/OmeroPy/test/integration/clitest/test_import.py | 1 - .../tools/OmeroPy/test/integration/clitest/test_import_bulk.py | 1 - .../tools/OmeroPy/test/integration/clitest/test_pyramids.py | 1 - components/tools/OmeroPy/test/integration/clitest/test_tag.py | 1 - .../OmeroPy/test/integration/gatewaytest/test_annotation.py | 1 - .../tools/OmeroPy/test/integration/gatewaytest/test_image.py | 1 - .../test/integration/gatewaytest/test_missing_pyramid.py | 1 - .../OmeroPy/test/integration/gatewaytest/test_performance.py | 1 - .../test/integration/metadata/test_metadata_mapannotations.py | 2 -- .../tools/OmeroPy/test/integration/metadata/test_pydict_text.py | 1 - .../tools/OmeroPy/test/integration/scriptstest/test_inputs.py | 1 - .../tools/OmeroPy/test/integration/scriptstest/test_rand.py | 1 - .../tools/OmeroPy/test/integration/tablestest/test_service.py | 1 - components/tools/OmeroPy/test/integration/test_client_ctors.py | 1 - components/tools/OmeroPy/test/integration/test_delete.py | 1 - components/tools/OmeroPy/test/integration/test_iquery.py | 1 - components/tools/OmeroPy/test/integration/test_isession.py | 1 - components/tools/OmeroPy/test/integration/test_repository.py | 1 - components/tools/OmeroPy/test/integration/test_rois.py | 1 - components/tools/OmeroPy/test/integration/test_scripts.py | 1 - components/tools/OmeroPy/test/integration/test_tickets1000.py | 1 - components/tools/OmeroPy/test/integration/test_tickets6000.py | 1 - .../tools/OmeroWeb/test/integration/test_api_containers.py | 1 - components/tools/OmeroWeb/test/integration/test_chgrp.py | 1 - components/tools/OmeroWeb/test/integration/test_containers.py | 1 - components/tools/OmeroWeb/test/integration/test_history.py | 1 - components/tools/OmeroWeb/test/integration/test_plategrid.py | 1 - components/tools/OmeroWeb/test/integration/test_show.py | 1 - .../tools/OmeroWeb/test/integration/test_tree_annotations.py | 1 - examples/Training/markup.py | 1 - examples/Training/python/Advanced/Raw_Data_advanced.py | 2 -- examples/Training/python/Advanced/Read_Data_advanced.py | 2 -- examples/Training/python/Advanced/Write_data_advanced.py | 2 -- examples/Training/python/Bulk_Shapes.py | 1 - examples/Training/python/Connect_To_OMERO.py | 1 - examples/Training/python/Create_Image.py | 1 - examples/Training/python/Delete.py | 1 - examples/Training/python/Filesets.py | 1 - examples/Training/python/Groups_Permissions.py | 1 - examples/Training/python/Json_Api/Login.py | 1 - examples/Training/python/Metadata.py | 1 - examples/Training/python/ROIs.py | 1 - examples/Training/python/Raw_Data_Access.py | 1 - examples/Training/python/Read_Data.py | 1 - examples/Training/python/Render_Images.py | 1 - examples/Training/python/Scripting_Service_Example.py | 1 - examples/Training/python/Tables.py | 1 - examples/Training/python/Task_Scripts/ROIs_To_Table.py | 1 - examples/Training/python/Task_Scripts/Raw_Data2.py | 2 -- examples/Training/python/Task_Scripts/Raw_Data_Task.py | 1 - examples/Training/python/Task_Scripts/Write_Data_3.py | 1 - examples/Training/python/Task_Scripts/Write_Data_4.py | 1 - examples/Training/python/Write_Data.py | 1 - examples/Training/python/__main__.py | 1 - 56 files changed, 62 deletions(-) diff --git a/components/antlib/scripts/parse_version b/components/antlib/scripts/parse_version index 76f2cab9929..a27bc574eca 100755 --- a/components/antlib/scripts/parse_version +++ b/components/antlib/scripts/parse_version @@ -22,7 +22,6 @@ """ Helper script to simpliy version.xml """ -from __future__ import print_function from builtins import str from builtins import range diff --git a/components/antlib/scripts/source-archive.py b/components/antlib/scripts/source-archive.py index 4ac1fd815e6..f165a8c5830 100755 --- a/components/antlib/scripts/source-archive.py +++ b/components/antlib/scripts/source-archive.py @@ -1,7 +1,5 @@ #!/usr/bin/python -from __future__ import print_function - import os from subprocess import call, Popen, PIPE import sys diff --git a/components/tools/OmeroPy/test/integration/clitest/test_import.py b/components/tools/OmeroPy/test/integration/clitest/test_import.py index ccc13f3ed61..c3f9b24b17f 100644 --- a/components/tools/OmeroPy/test/integration/clitest/test_import.py +++ b/components/tools/OmeroPy/test/integration/clitest/test_import.py @@ -19,7 +19,6 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. from __future__ import division -from __future__ import print_function from builtins import str from builtins import range from past.utils import old_div diff --git a/components/tools/OmeroPy/test/integration/clitest/test_import_bulk.py b/components/tools/OmeroPy/test/integration/clitest/test_import_bulk.py index fc12689edd2..f7f4ab17ad6 100644 --- a/components/tools/OmeroPy/test/integration/clitest/test_import_bulk.py +++ b/components/tools/OmeroPy/test/integration/clitest/test_import_bulk.py @@ -19,7 +19,6 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. from __future__ import division -from __future__ import print_function from builtins import str from past.utils import old_div from omero.cli import NonZeroReturnCode diff --git a/components/tools/OmeroPy/test/integration/clitest/test_pyramids.py b/components/tools/OmeroPy/test/integration/clitest/test_pyramids.py index d7220ee7da4..366bb4c1cb3 100644 --- a/components/tools/OmeroPy/test/integration/clitest/test_pyramids.py +++ b/components/tools/OmeroPy/test/integration/clitest/test_pyramids.py @@ -20,7 +20,6 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -from __future__ import print_function from builtins import str from omero.testlib.cli import CLITest from omero.cli import NonZeroReturnCode diff --git a/components/tools/OmeroPy/test/integration/clitest/test_tag.py b/components/tools/OmeroPy/test/integration/clitest/test_tag.py index b423b323592..62dc4046311 100644 --- a/components/tools/OmeroPy/test/integration/clitest/test_tag.py +++ b/components/tools/OmeroPy/test/integration/clitest/test_tag.py @@ -19,7 +19,6 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -from __future__ import print_function from builtins import str from builtins import range import re diff --git a/components/tools/OmeroPy/test/integration/gatewaytest/test_annotation.py b/components/tools/OmeroPy/test/integration/gatewaytest/test_annotation.py index 19dec0418aa..44fe548895a 100644 --- a/components/tools/OmeroPy/test/integration/gatewaytest/test_annotation.py +++ b/components/tools/OmeroPy/test/integration/gatewaytest/test_annotation.py @@ -12,7 +12,6 @@ - author_testimg_generated """ -from __future__ import print_function from future import standard_library from builtins import str diff --git a/components/tools/OmeroPy/test/integration/gatewaytest/test_image.py b/components/tools/OmeroPy/test/integration/gatewaytest/test_image.py index a98c15de471..d8749330b81 100644 --- a/components/tools/OmeroPy/test/integration/gatewaytest/test_image.py +++ b/components/tools/OmeroPy/test/integration/gatewaytest/test_image.py @@ -13,7 +13,6 @@ - author_testimg_big """ -from __future__ import print_function from builtins import zip from builtins import str diff --git a/components/tools/OmeroPy/test/integration/gatewaytest/test_missing_pyramid.py b/components/tools/OmeroPy/test/integration/gatewaytest/test_missing_pyramid.py index bfd2daf78bb..43460ff1b48 100644 --- a/components/tools/OmeroPy/test/integration/gatewaytest/test_missing_pyramid.py +++ b/components/tools/OmeroPy/test/integration/gatewaytest/test_missing_pyramid.py @@ -10,7 +10,6 @@ """ from __future__ import division -from __future__ import print_function from builtins import object from past.utils import old_div diff --git a/components/tools/OmeroPy/test/integration/gatewaytest/test_performance.py b/components/tools/OmeroPy/test/integration/gatewaytest/test_performance.py index 821048bcaa3..43d0a1a931d 100644 --- a/components/tools/OmeroPy/test/integration/gatewaytest/test_performance.py +++ b/components/tools/OmeroPy/test/integration/gatewaytest/test_performance.py @@ -15,7 +15,6 @@ - gatewaywrapper """ -from __future__ import print_function from builtins import range from builtins import object diff --git a/components/tools/OmeroPy/test/integration/metadata/test_metadata_mapannotations.py b/components/tools/OmeroPy/test/integration/metadata/test_metadata_mapannotations.py index 3dd01e0fade..a64c5cf6e39 100644 --- a/components/tools/OmeroPy/test/integration/metadata/test_metadata_mapannotations.py +++ b/components/tools/OmeroPy/test/integration/metadata/test_metadata_mapannotations.py @@ -22,8 +22,6 @@ """ Integration test of metadata_mapannotation """ -from __future__ import print_function - from builtins import zip from omero.testlib import ITest diff --git a/components/tools/OmeroPy/test/integration/metadata/test_pydict_text.py b/components/tools/OmeroPy/test/integration/metadata/test_pydict_text.py index f8c9a9928a4..416ab520f46 100644 --- a/components/tools/OmeroPy/test/integration/metadata/test_pydict_text.py +++ b/components/tools/OmeroPy/test/integration/metadata/test_pydict_text.py @@ -22,7 +22,6 @@ """ Test of the yaml/json parameters file handling """ -from __future__ import print_function from builtins import str from omero.testlib import ITest diff --git a/components/tools/OmeroPy/test/integration/scriptstest/test_inputs.py b/components/tools/OmeroPy/test/integration/scriptstest/test_inputs.py index c740f5f7f80..f7994eb7e73 100644 --- a/components/tools/OmeroPy/test/integration/scriptstest/test_inputs.py +++ b/components/tools/OmeroPy/test/integration/scriptstest/test_inputs.py @@ -23,7 +23,6 @@ Specifically test the parseInputs functionality which all scripts might want to use. """ -from __future__ import print_function from omero.testlib import ITest import omero diff --git a/components/tools/OmeroPy/test/integration/scriptstest/test_rand.py b/components/tools/OmeroPy/test/integration/scriptstest/test_rand.py index e8fc107c65b..a4dfea27fba 100644 --- a/components/tools/OmeroPy/test/integration/scriptstest/test_rand.py +++ b/components/tools/OmeroPy/test/integration/scriptstest/test_rand.py @@ -24,7 +24,6 @@ ServiceFactoryI.acquireProcessor(). """ -from __future__ import print_function from omero.testlib import ITest import omero diff --git a/components/tools/OmeroPy/test/integration/tablestest/test_service.py b/components/tools/OmeroPy/test/integration/tablestest/test_service.py index e1efba1da7b..7d4a8b242ae 100755 --- a/components/tools/OmeroPy/test/integration/tablestest/test_service.py +++ b/components/tools/OmeroPy/test/integration/tablestest/test_service.py @@ -23,7 +23,6 @@ Test of the Tables service """ -from __future__ import print_function from future.utils import native_str from builtins import str from builtins import range diff --git a/components/tools/OmeroPy/test/integration/test_client_ctors.py b/components/tools/OmeroPy/test/integration/test_client_ctors.py index 4b83b8ff9fa..a7c1a80c3a8 100644 --- a/components/tools/OmeroPy/test/integration/test_client_ctors.py +++ b/components/tools/OmeroPy/test/integration/test_client_ctors.py @@ -23,7 +23,6 @@ Tests of the omero.client constructors """ -from __future__ import print_function from future.utils import native_str import os diff --git a/components/tools/OmeroPy/test/integration/test_delete.py b/components/tools/OmeroPy/test/integration/test_delete.py index 60eaf342fb9..6acbe8cd9b9 100644 --- a/components/tools/OmeroPy/test/integration/test_delete.py +++ b/components/tools/OmeroPy/test/integration/test_delete.py @@ -23,7 +23,6 @@ Integration test for delete testing """ -from __future__ import print_function from builtins import str from builtins import range diff --git a/components/tools/OmeroPy/test/integration/test_iquery.py b/components/tools/OmeroPy/test/integration/test_iquery.py index 53b6497e9e5..780d899e23b 100644 --- a/components/tools/OmeroPy/test/integration/test_iquery.py +++ b/components/tools/OmeroPy/test/integration/test_iquery.py @@ -23,7 +23,6 @@ Integration test focused on the omero.api.IQuery interface. """ -from __future__ import print_function from __future__ import absolute_import from builtins import range diff --git a/components/tools/OmeroPy/test/integration/test_isession.py b/components/tools/OmeroPy/test/integration/test_isession.py index 8e68db9e3f6..3761b33565d 100644 --- a/components/tools/OmeroPy/test/integration/test_isession.py +++ b/components/tools/OmeroPy/test/integration/test_isession.py @@ -23,7 +23,6 @@ Integration test focused on the omero.api.ISession interface. """ -from __future__ import print_function import os from omero.testlib import ITest diff --git a/components/tools/OmeroPy/test/integration/test_repository.py b/components/tools/OmeroPy/test/integration/test_repository.py index 6af4bbd3b86..f3efe40460d 100644 --- a/components/tools/OmeroPy/test/integration/test_repository.py +++ b/components/tools/OmeroPy/test/integration/test_repository.py @@ -9,7 +9,6 @@ """ from __future__ import division -from __future__ import print_function from builtins import zip from builtins import str diff --git a/components/tools/OmeroPy/test/integration/test_rois.py b/components/tools/OmeroPy/test/integration/test_rois.py index aa24a954b43..20658a9fe24 100644 --- a/components/tools/OmeroPy/test/integration/test_rois.py +++ b/components/tools/OmeroPy/test/integration/test_rois.py @@ -8,7 +8,6 @@ Use is subject to license terms supplied in LICENSE.txt """ -from __future__ import print_function from builtins import object from omero.testlib import ITest import omero diff --git a/components/tools/OmeroPy/test/integration/test_scripts.py b/components/tools/OmeroPy/test/integration/test_scripts.py index 58931c8760e..0cc94901ae6 100644 --- a/components/tools/OmeroPy/test/integration/test_scripts.py +++ b/components/tools/OmeroPy/test/integration/test_scripts.py @@ -9,7 +9,6 @@ """ from __future__ import division -from __future__ import print_function from builtins import str from builtins import range diff --git a/components/tools/OmeroPy/test/integration/test_tickets1000.py b/components/tools/OmeroPy/test/integration/test_tickets1000.py index afa326b2c59..f8029e7293c 100644 --- a/components/tools/OmeroPy/test/integration/test_tickets1000.py +++ b/components/tools/OmeroPy/test/integration/test_tickets1000.py @@ -8,7 +8,6 @@ Use is subject to license terms supplied in LICENSE.txt """ -from __future__ import print_function from omero.testlib import ITest import pytest diff --git a/components/tools/OmeroPy/test/integration/test_tickets6000.py b/components/tools/OmeroPy/test/integration/test_tickets6000.py index b5e6eda01e3..4ea937f4fef 100644 --- a/components/tools/OmeroPy/test/integration/test_tickets6000.py +++ b/components/tools/OmeroPy/test/integration/test_tickets6000.py @@ -9,7 +9,6 @@ """ Integration tests for tickets between 5000 and 5999 """ -from __future__ import print_function import pytest from omero.testlib import ITest diff --git a/components/tools/OmeroWeb/test/integration/test_api_containers.py b/components/tools/OmeroWeb/test/integration/test_api_containers.py index fcc976273d9..55b37ec7c34 100644 --- a/components/tools/OmeroWeb/test/integration/test_api_containers.py +++ b/components/tools/OmeroWeb/test/integration/test_api_containers.py @@ -18,7 +18,6 @@ # along with this program. If not, see . """Tests querying & editing Containers with webgateway json api.""" -from __future__ import print_function from builtins import zip from builtins import str diff --git a/components/tools/OmeroWeb/test/integration/test_chgrp.py b/components/tools/OmeroWeb/test/integration/test_chgrp.py index c01f7f80aaf..f6023c54d41 100644 --- a/components/tools/OmeroWeb/test/integration/test_chgrp.py +++ b/components/tools/OmeroWeb/test/integration/test_chgrp.py @@ -20,7 +20,6 @@ """ Tests chgrp functionality of views.py """ -from __future__ import print_function from future.utils import native_str from omero.model import ProjectI, DatasetI, TagAnnotationI diff --git a/components/tools/OmeroWeb/test/integration/test_containers.py b/components/tools/OmeroWeb/test/integration/test_containers.py index 792dfc632ce..d8cdb712947 100644 --- a/components/tools/OmeroWeb/test/integration/test_containers.py +++ b/components/tools/OmeroWeb/test/integration/test_containers.py @@ -20,7 +20,6 @@ """ Tests creation, linking, editing & deletion of containers """ -from __future__ import print_function from builtins import str from builtins import range diff --git a/components/tools/OmeroWeb/test/integration/test_history.py b/components/tools/OmeroWeb/test/integration/test_history.py index 5452829988f..40b8ae70de6 100644 --- a/components/tools/OmeroWeb/test/integration/test_history.py +++ b/components/tools/OmeroWeb/test/integration/test_history.py @@ -18,7 +18,6 @@ # along with this program. If not, see . """Tests display of data in History page.""" -from __future__ import print_function from omeroweb.testlib import IWebTest from omeroweb.testlib import get, post diff --git a/components/tools/OmeroWeb/test/integration/test_plategrid.py b/components/tools/OmeroWeb/test/integration/test_plategrid.py index 4aafb7d4492..9acadecfbe6 100644 --- a/components/tools/OmeroWeb/test/integration/test_plategrid.py +++ b/components/tools/OmeroWeb/test/integration/test_plategrid.py @@ -9,7 +9,6 @@ Integration tests for the "plategrid" module. """ from __future__ import division -from __future__ import print_function from builtins import map from builtins import str diff --git a/components/tools/OmeroWeb/test/integration/test_show.py b/components/tools/OmeroWeb/test/integration/test_show.py index d8d5b162f5a..e653c87f028 100644 --- a/components/tools/OmeroWeb/test/integration/test_show.py +++ b/components/tools/OmeroWeb/test/integration/test_show.py @@ -9,7 +9,6 @@ """ from __future__ import division -from __future__ import print_function from builtins import str from builtins import range diff --git a/components/tools/OmeroWeb/test/integration/test_tree_annotations.py b/components/tools/OmeroWeb/test/integration/test_tree_annotations.py index d40d5369ddc..fe305709fb7 100644 --- a/components/tools/OmeroWeb/test/integration/test_tree_annotations.py +++ b/components/tools/OmeroWeb/test/integration/test_tree_annotations.py @@ -21,7 +21,6 @@ Integration tests for annotations methods in the "tree" module. """ from __future__ import division -from __future__ import print_function from builtins import zip from future.utils import native_str diff --git a/examples/Training/markup.py b/examples/Training/markup.py index 51e3bbb5c92..b906b27a070 100755 --- a/examples/Training/markup.py +++ b/examples/Training/markup.py @@ -15,7 +15,6 @@ """ -from __future__ import print_function import sys import re import os diff --git a/examples/Training/python/Advanced/Raw_Data_advanced.py b/examples/Training/python/Advanced/Raw_Data_advanced.py index ee922b3b639..8d9b4c4c8b1 100644 --- a/examples/Training/python/Advanced/Raw_Data_advanced.py +++ b/examples/Training/python/Advanced/Raw_Data_advanced.py @@ -11,8 +11,6 @@ FOR TRAINING PURPOSES ONLY! """ -from __future__ import print_function - import omero.util.script_utils as scriptUtil from numpy import int32 from omero.gateway import BlitzGateway diff --git a/examples/Training/python/Advanced/Read_Data_advanced.py b/examples/Training/python/Advanced/Read_Data_advanced.py index ef735629d3e..5005f389c84 100644 --- a/examples/Training/python/Advanced/Read_Data_advanced.py +++ b/examples/Training/python/Advanced/Read_Data_advanced.py @@ -11,8 +11,6 @@ FOR TRAINING PURPOSES ONLY! """ -from __future__ import print_function - import omero from omero.rtypes import rstring from omero.gateway import BlitzGateway diff --git a/examples/Training/python/Advanced/Write_data_advanced.py b/examples/Training/python/Advanced/Write_data_advanced.py index 23e596181b7..61c86e449fa 100644 --- a/examples/Training/python/Advanced/Write_data_advanced.py +++ b/examples/Training/python/Advanced/Write_data_advanced.py @@ -11,8 +11,6 @@ FOR TRAINING PURPOSES ONLY! """ -from __future__ import print_function - import omero from omero.rtypes import rstring from omero.gateway import BlitzGateway diff --git a/examples/Training/python/Bulk_Shapes.py b/examples/Training/python/Bulk_Shapes.py index 0ca7916dae8..85ce698d1e0 100755 --- a/examples/Training/python/Bulk_Shapes.py +++ b/examples/Training/python/Bulk_Shapes.py @@ -10,7 +10,6 @@ """ FOR TRAINING PURPOSES ONLY! """ -from __future__ import print_function from builtins import range import omero diff --git a/examples/Training/python/Connect_To_OMERO.py b/examples/Training/python/Connect_To_OMERO.py index a36046fbb08..4b06e6e55b6 100644 --- a/examples/Training/python/Connect_To_OMERO.py +++ b/examples/Training/python/Connect_To_OMERO.py @@ -10,7 +10,6 @@ """ FOR TRAINING PURPOSES ONLY! """ -from __future__ import print_function from Parse_OMERO_Properties import USERNAME, PASSWORD, HOST, PORT diff --git a/examples/Training/python/Create_Image.py b/examples/Training/python/Create_Image.py index 5bab7fb58f3..1d90c77fef0 100755 --- a/examples/Training/python/Create_Image.py +++ b/examples/Training/python/Create_Image.py @@ -11,7 +11,6 @@ FOR TRAINING PURPOSES ONLY! """ from __future__ import division -from __future__ import print_function from builtins import range from past.utils import old_div diff --git a/examples/Training/python/Delete.py b/examples/Training/python/Delete.py index 575b6efaecb..4cf2acd548a 100755 --- a/examples/Training/python/Delete.py +++ b/examples/Training/python/Delete.py @@ -11,7 +11,6 @@ FOR TRAINING PURPOSES ONLY! """ -from __future__ import print_function import omero import omero.callbacks from omero.gateway import BlitzGateway diff --git a/examples/Training/python/Filesets.py b/examples/Training/python/Filesets.py index 3250f4d9a1a..d5eaacb3b8e 100755 --- a/examples/Training/python/Filesets.py +++ b/examples/Training/python/Filesets.py @@ -11,7 +11,6 @@ FOR TRAINING PURPOSES ONLY! """ -from __future__ import print_function from omero.gateway import BlitzGateway from Parse_OMERO_Properties import USERNAME, PASSWORD, HOST, PORT from Parse_OMERO_Properties import imageId diff --git a/examples/Training/python/Groups_Permissions.py b/examples/Training/python/Groups_Permissions.py index 32f8f717192..a69f26f0489 100755 --- a/examples/Training/python/Groups_Permissions.py +++ b/examples/Training/python/Groups_Permissions.py @@ -10,7 +10,6 @@ """ FOR TRAINING PURPOSES ONLY! """ -from __future__ import print_function from builtins import str from omero.gateway import BlitzGateway diff --git a/examples/Training/python/Json_Api/Login.py b/examples/Training/python/Json_Api/Login.py index f1d473afc67..16abd379014 100644 --- a/examples/Training/python/Json_Api/Login.py +++ b/examples/Training/python/Json_Api/Login.py @@ -7,7 +7,6 @@ # Use is subject to license terms supplied in LICENSE.txt # -from __future__ import print_function import requests diff --git a/examples/Training/python/Metadata.py b/examples/Training/python/Metadata.py index 3e291ccf83a..171bd98edb0 100755 --- a/examples/Training/python/Metadata.py +++ b/examples/Training/python/Metadata.py @@ -10,7 +10,6 @@ """ FOR TRAINING PURPOSES ONLY! """ -from __future__ import print_function from omero.gateway import BlitzGateway from Parse_OMERO_Properties import USERNAME, PASSWORD, HOST, PORT diff --git a/examples/Training/python/ROIs.py b/examples/Training/python/ROIs.py index 67d6211ae89..2fe58a1edf1 100755 --- a/examples/Training/python/ROIs.py +++ b/examples/Training/python/ROIs.py @@ -11,7 +11,6 @@ FOR TRAINING PURPOSES ONLY! """ from __future__ import division -from __future__ import print_function from future.utils import native_str from builtins import str diff --git a/examples/Training/python/Raw_Data_Access.py b/examples/Training/python/Raw_Data_Access.py index 13d8c8274c5..c54fb8b7e7c 100755 --- a/examples/Training/python/Raw_Data_Access.py +++ b/examples/Training/python/Raw_Data_Access.py @@ -11,7 +11,6 @@ FOR TRAINING PURPOSES ONLY! """ -from __future__ import print_function from __future__ import division from builtins import range from past.utils import old_div diff --git a/examples/Training/python/Read_Data.py b/examples/Training/python/Read_Data.py index 8ddae1ae87c..67089a33457 100755 --- a/examples/Training/python/Read_Data.py +++ b/examples/Training/python/Read_Data.py @@ -11,7 +11,6 @@ FOR TRAINING PURPOSES ONLY! """ from __future__ import division -from __future__ import print_function from builtins import range import omero diff --git a/examples/Training/python/Render_Images.py b/examples/Training/python/Render_Images.py index 3b1f4048305..38f1b1e76d1 100644 --- a/examples/Training/python/Render_Images.py +++ b/examples/Training/python/Render_Images.py @@ -11,7 +11,6 @@ FOR TRAINING PURPOSES ONLY! """ from __future__ import division -from __future__ import print_function from future import standard_library from builtins import range diff --git a/examples/Training/python/Scripting_Service_Example.py b/examples/Training/python/Scripting_Service_Example.py index 5f3ec0b71cd..97c79d08ef1 100644 --- a/examples/Training/python/Scripting_Service_Example.py +++ b/examples/Training/python/Scripting_Service_Example.py @@ -10,7 +10,6 @@ """ FOR TRAINING PURPOSES ONLY! """ -from __future__ import print_function # This is a 'bare-bones' template to allow easy conversion from a simple # client-side Python script to a script run by the server, on the OMERO diff --git a/examples/Training/python/Tables.py b/examples/Training/python/Tables.py index 12b2bf500e0..4a69d4f63d2 100755 --- a/examples/Training/python/Tables.py +++ b/examples/Training/python/Tables.py @@ -10,7 +10,6 @@ """ FOR TRAINING PURPOSES ONLY! """ -from __future__ import print_function from builtins import str from builtins import range diff --git a/examples/Training/python/Task_Scripts/ROIs_To_Table.py b/examples/Training/python/Task_Scripts/ROIs_To_Table.py index ef5b8e8f8ca..35b1ea7ef1b 100644 --- a/examples/Training/python/Task_Scripts/ROIs_To_Table.py +++ b/examples/Training/python/Task_Scripts/ROIs_To_Table.py @@ -6,7 +6,6 @@ # All Rights Reserved. # Use is subject to license terms supplied in LICENSE.txt # -from __future__ import print_function import omero.scripts as scripts from random import random diff --git a/examples/Training/python/Task_Scripts/Raw_Data2.py b/examples/Training/python/Task_Scripts/Raw_Data2.py index fcfdf89090e..d032fa01c7d 100644 --- a/examples/Training/python/Task_Scripts/Raw_Data2.py +++ b/examples/Training/python/Task_Scripts/Raw_Data2.py @@ -20,8 +20,6 @@ # folder # This script takes an Image ID as a parameter from the scripting service. -from __future__ import print_function - import omero.util.script_utils as scriptUtil from omero.gateway import BlitzGateway from numpy import hstack, int32 diff --git a/examples/Training/python/Task_Scripts/Raw_Data_Task.py b/examples/Training/python/Task_Scripts/Raw_Data_Task.py index af2a8630de2..0b7a47ba270 100644 --- a/examples/Training/python/Task_Scripts/Raw_Data_Task.py +++ b/examples/Training/python/Task_Scripts/Raw_Data_Task.py @@ -19,7 +19,6 @@ # A more complete template, for 'real-world' scripts, is also included in this # folder # This script takes an Image ID as a parameter from the scripting service. -from __future__ import print_function import omero.util.script_utils as scriptUtil from omero.gateway import BlitzGateway diff --git a/examples/Training/python/Task_Scripts/Write_Data_3.py b/examples/Training/python/Task_Scripts/Write_Data_3.py index e02779d681b..e9a83ec40b4 100644 --- a/examples/Training/python/Task_Scripts/Write_Data_3.py +++ b/examples/Training/python/Task_Scripts/Write_Data_3.py @@ -19,7 +19,6 @@ # A more complete template, for 'real-world' scripts, is also included in this # folder # This script takes an Image ID as a parameter from the scripting service. -from __future__ import print_function from omero.gateway import BlitzGateway import omero diff --git a/examples/Training/python/Task_Scripts/Write_Data_4.py b/examples/Training/python/Task_Scripts/Write_Data_4.py index 365f975da1a..1a8df1d5ac7 100644 --- a/examples/Training/python/Task_Scripts/Write_Data_4.py +++ b/examples/Training/python/Task_Scripts/Write_Data_4.py @@ -19,7 +19,6 @@ # A more complete template, for 'real-world' scripts, is also included in this # folder # This script takes an Image ID as a parameter from the scripting service. -from __future__ import print_function from omero.gateway import BlitzGateway import omero diff --git a/examples/Training/python/Write_Data.py b/examples/Training/python/Write_Data.py index ab69f0919ea..7782076b45e 100755 --- a/examples/Training/python/Write_Data.py +++ b/examples/Training/python/Write_Data.py @@ -10,7 +10,6 @@ """ FOR TRAINING PURPOSES ONLY! """ -from __future__ import print_function from builtins import str import os diff --git a/examples/Training/python/__main__.py b/examples/Training/python/__main__.py index 8dcd2685f16..7ea3baf026a 100755 --- a/examples/Training/python/__main__.py +++ b/examples/Training/python/__main__.py @@ -7,7 +7,6 @@ # Use is subject to license terms supplied in LICENSE.txt # -from __future__ import print_function from past.builtins import execfile import os training_dir = os.path.dirname(os.path.abspath(__file__)) From 077fabe946b2c5964f627688d33fc5e07a35b8e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Besson?= Date: Sat, 20 Jan 2024 09:28:26 +0000 Subject: [PATCH 02/16] Remove all imports of division compatibility method --- components/tools/OmeroFS/test/drivers.py | 1 - components/tools/OmeroPy/test/integration/clitest/test_admin.py | 1 - components/tools/OmeroPy/test/integration/clitest/test_import.py | 1 - .../tools/OmeroPy/test/integration/clitest/test_import_bulk.py | 1 - .../OmeroPy/test/integration/gatewaytest/test_missing_pyramid.py | 1 - .../OmeroPy/test/integration/scriptstest/test_script_utils.py | 1 - components/tools/OmeroPy/test/integration/test_rawpixelsstore.py | 1 - .../tools/OmeroPy/test/integration/test_reporawfilestore.py | 1 - components/tools/OmeroPy/test/integration/test_repository.py | 1 - components/tools/OmeroPy/test/integration/test_scripts.py | 1 - components/tools/OmeroWeb/test/integration/test_plategrid.py | 1 - components/tools/OmeroWeb/test/integration/test_show.py | 1 - components/tools/OmeroWeb/test/integration/test_tree.py | 1 - .../tools/OmeroWeb/test/integration/test_tree_annotations.py | 1 - examples/Training/python/Create_Image.py | 1 - examples/Training/python/ROIs.py | 1 - examples/Training/python/Raw_Data_Access.py | 1 - examples/Training/python/Read_Data.py | 1 - examples/Training/python/Render_Images.py | 1 - 19 files changed, 19 deletions(-) diff --git a/components/tools/OmeroFS/test/drivers.py b/components/tools/OmeroFS/test/drivers.py index 94fb8856d43..56f083cd825 100644 --- a/components/tools/OmeroFS/test/drivers.py +++ b/components/tools/OmeroFS/test/drivers.py @@ -9,7 +9,6 @@ Use is subject to license terms supplied in LICENSE.txt """ -from __future__ import division from builtins import str from builtins import range diff --git a/components/tools/OmeroPy/test/integration/clitest/test_admin.py b/components/tools/OmeroPy/test/integration/clitest/test_admin.py index 856f55642d7..60e376c96c4 100644 --- a/components/tools/OmeroPy/test/integration/clitest/test_admin.py +++ b/components/tools/OmeroPy/test/integration/clitest/test_admin.py @@ -20,7 +20,6 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -from __future__ import division from builtins import str from past.utils import old_div import pytest diff --git a/components/tools/OmeroPy/test/integration/clitest/test_import.py b/components/tools/OmeroPy/test/integration/clitest/test_import.py index c3f9b24b17f..b79adf3b720 100644 --- a/components/tools/OmeroPy/test/integration/clitest/test_import.py +++ b/components/tools/OmeroPy/test/integration/clitest/test_import.py @@ -18,7 +18,6 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -from __future__ import division from builtins import str from builtins import range from past.utils import old_div diff --git a/components/tools/OmeroPy/test/integration/clitest/test_import_bulk.py b/components/tools/OmeroPy/test/integration/clitest/test_import_bulk.py index f7f4ab17ad6..050cb1f961f 100644 --- a/components/tools/OmeroPy/test/integration/clitest/test_import_bulk.py +++ b/components/tools/OmeroPy/test/integration/clitest/test_import_bulk.py @@ -18,7 +18,6 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -from __future__ import division from builtins import str from past.utils import old_div from omero.cli import NonZeroReturnCode diff --git a/components/tools/OmeroPy/test/integration/gatewaytest/test_missing_pyramid.py b/components/tools/OmeroPy/test/integration/gatewaytest/test_missing_pyramid.py index 43460ff1b48..91e37b0b55a 100644 --- a/components/tools/OmeroPy/test/integration/gatewaytest/test_missing_pyramid.py +++ b/components/tools/OmeroPy/test/integration/gatewaytest/test_missing_pyramid.py @@ -9,7 +9,6 @@ Use is subject to license terms supplied in LICENSE.txt """ -from __future__ import division from builtins import object from past.utils import old_div diff --git a/components/tools/OmeroPy/test/integration/scriptstest/test_script_utils.py b/components/tools/OmeroPy/test/integration/scriptstest/test_script_utils.py index 0cd8334ea2a..8b516a404b4 100644 --- a/components/tools/OmeroPy/test/integration/scriptstest/test_script_utils.py +++ b/components/tools/OmeroPy/test/integration/scriptstest/test_script_utils.py @@ -21,7 +21,6 @@ Integration test which checks the various methods from script_utils """ -from __future__ import division from builtins import str from builtins import range diff --git a/components/tools/OmeroPy/test/integration/test_rawpixelsstore.py b/components/tools/OmeroPy/test/integration/test_rawpixelsstore.py index f032f76debb..542324e30f4 100644 --- a/components/tools/OmeroPy/test/integration/test_rawpixelsstore.py +++ b/components/tools/OmeroPy/test/integration/test_rawpixelsstore.py @@ -8,7 +8,6 @@ Use is subject to license terms supplied in LICENSE.txt """ -from __future__ import division from builtins import hex from builtins import range diff --git a/components/tools/OmeroPy/test/integration/test_reporawfilestore.py b/components/tools/OmeroPy/test/integration/test_reporawfilestore.py index d14563d994a..4365cec3c13 100644 --- a/components/tools/OmeroPy/test/integration/test_reporawfilestore.py +++ b/components/tools/OmeroPy/test/integration/test_reporawfilestore.py @@ -14,7 +14,6 @@ Use is subject to license terms supplied in LICENSE.txt """ -from __future__ import division from past.utils import old_div import pytest diff --git a/components/tools/OmeroPy/test/integration/test_repository.py b/components/tools/OmeroPy/test/integration/test_repository.py index f3efe40460d..3e0107d39f2 100644 --- a/components/tools/OmeroPy/test/integration/test_repository.py +++ b/components/tools/OmeroPy/test/integration/test_repository.py @@ -8,7 +8,6 @@ Use is subject to license terms supplied in LICENSE.txt """ -from __future__ import division from builtins import zip from builtins import str diff --git a/components/tools/OmeroPy/test/integration/test_scripts.py b/components/tools/OmeroPy/test/integration/test_scripts.py index 0cc94901ae6..4ae26a42d39 100644 --- a/components/tools/OmeroPy/test/integration/test_scripts.py +++ b/components/tools/OmeroPy/test/integration/test_scripts.py @@ -8,7 +8,6 @@ Use is subject to license terms supplied in LICENSE.txt """ -from __future__ import division from builtins import str from builtins import range diff --git a/components/tools/OmeroWeb/test/integration/test_plategrid.py b/components/tools/OmeroWeb/test/integration/test_plategrid.py index 9acadecfbe6..eed93f1b041 100644 --- a/components/tools/OmeroWeb/test/integration/test_plategrid.py +++ b/components/tools/OmeroWeb/test/integration/test_plategrid.py @@ -8,7 +8,6 @@ """ Integration tests for the "plategrid" module. """ -from __future__ import division from builtins import map from builtins import str diff --git a/components/tools/OmeroWeb/test/integration/test_show.py b/components/tools/OmeroWeb/test/integration/test_show.py index e653c87f028..fbda1991504 100644 --- a/components/tools/OmeroWeb/test/integration/test_show.py +++ b/components/tools/OmeroWeb/test/integration/test_show.py @@ -8,7 +8,6 @@ Use is subject to license terms supplied in LICENSE.txt """ -from __future__ import division from builtins import str from builtins import range diff --git a/components/tools/OmeroWeb/test/integration/test_tree.py b/components/tools/OmeroWeb/test/integration/test_tree.py index 4de9df72fb8..86002ebcfa1 100644 --- a/components/tools/OmeroWeb/test/integration/test_tree.py +++ b/components/tools/OmeroWeb/test/integration/test_tree.py @@ -20,7 +20,6 @@ """ Simple integration tests for the "tree" module. """ -from __future__ import division from builtins import str import pytest diff --git a/components/tools/OmeroWeb/test/integration/test_tree_annotations.py b/components/tools/OmeroWeb/test/integration/test_tree_annotations.py index fe305709fb7..8bd94be71ad 100644 --- a/components/tools/OmeroWeb/test/integration/test_tree_annotations.py +++ b/components/tools/OmeroWeb/test/integration/test_tree_annotations.py @@ -20,7 +20,6 @@ """ Integration tests for annotations methods in the "tree" module. """ -from __future__ import division from builtins import zip from future.utils import native_str diff --git a/examples/Training/python/Create_Image.py b/examples/Training/python/Create_Image.py index 1d90c77fef0..9a43649e7c6 100755 --- a/examples/Training/python/Create_Image.py +++ b/examples/Training/python/Create_Image.py @@ -10,7 +10,6 @@ """ FOR TRAINING PURPOSES ONLY! """ -from __future__ import division from builtins import range from past.utils import old_div diff --git a/examples/Training/python/ROIs.py b/examples/Training/python/ROIs.py index 2fe58a1edf1..29e417192ae 100755 --- a/examples/Training/python/ROIs.py +++ b/examples/Training/python/ROIs.py @@ -10,7 +10,6 @@ """ FOR TRAINING PURPOSES ONLY! """ -from __future__ import division from future.utils import native_str from builtins import str diff --git a/examples/Training/python/Raw_Data_Access.py b/examples/Training/python/Raw_Data_Access.py index c54fb8b7e7c..93744039ce0 100755 --- a/examples/Training/python/Raw_Data_Access.py +++ b/examples/Training/python/Raw_Data_Access.py @@ -11,7 +11,6 @@ FOR TRAINING PURPOSES ONLY! """ -from __future__ import division from builtins import range from past.utils import old_div from omero.gateway import BlitzGateway diff --git a/examples/Training/python/Read_Data.py b/examples/Training/python/Read_Data.py index 67089a33457..7c4a7b3f9b3 100755 --- a/examples/Training/python/Read_Data.py +++ b/examples/Training/python/Read_Data.py @@ -10,7 +10,6 @@ """ FOR TRAINING PURPOSES ONLY! """ -from __future__ import division from builtins import range import omero diff --git a/examples/Training/python/Render_Images.py b/examples/Training/python/Render_Images.py index 38f1b1e76d1..36dbeac4beb 100644 --- a/examples/Training/python/Render_Images.py +++ b/examples/Training/python/Render_Images.py @@ -10,7 +10,6 @@ """ FOR TRAINING PURPOSES ONLY! """ -from __future__ import division from future import standard_library from builtins import range From 27572b4e041be56b53e026de620f7beb5e285139 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Besson?= Date: Sat, 20 Jan 2024 09:29:49 +0000 Subject: [PATCH 03/16] Remove all imports of absolute_import compatibility method --- components/tools/OmeroPy/test/integration/test_iquery.py | 1 - components/tools/OmeroPy/test/integration/test_pixelsService.py | 1 - 2 files changed, 2 deletions(-) diff --git a/components/tools/OmeroPy/test/integration/test_iquery.py b/components/tools/OmeroPy/test/integration/test_iquery.py index 780d899e23b..53226f332bf 100644 --- a/components/tools/OmeroPy/test/integration/test_iquery.py +++ b/components/tools/OmeroPy/test/integration/test_iquery.py @@ -23,7 +23,6 @@ Integration test focused on the omero.api.IQuery interface. """ -from __future__ import absolute_import from builtins import range from future.utils import native_str diff --git a/components/tools/OmeroPy/test/integration/test_pixelsService.py b/components/tools/OmeroPy/test/integration/test_pixelsService.py index 3e38c45b955..6333f738a9d 100644 --- a/components/tools/OmeroPy/test/integration/test_pixelsService.py +++ b/components/tools/OmeroPy/test/integration/test_pixelsService.py @@ -23,7 +23,6 @@ Tests for the Pixels service. """ -from __future__ import absolute_import import omero import omero.gateway From 7f73a491a2efe88077c0251e21bea38c7df68594 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Besson?= Date: Sat, 20 Jan 2024 11:39:58 +0000 Subject: [PATCH 04/16] Replace all usages of native_str compatibility method --- .../test/integration/clitest/test_chgrp.py | 3 +- .../test/integration/clitest/test_cleanse.py | 3 +- .../test/integration/fstest/test_rename.py | 3 +- .../integration/gatewaytest/test_chmod.py | 3 +- .../gatewaytest/test_connection.py | 3 +- .../integration/tablestest/test_service.py | 3 +- .../OmeroPy/test/integration/test_chgrp.py | 41 +++++++++---------- .../test/integration/test_client_ctors.py | 3 +- .../OmeroPy/test/integration/test_delete.py | 7 ++-- .../OmeroPy/test/integration/test_iquery.py | 9 ++-- .../OmeroPy/test/integration/test_ishare.py | 17 ++++---- .../test/integration/test_permissions.py | 13 +++--- .../test/integration/test_thumbnailPerms.py | 13 +++--- .../test/integration/test_api_errors.py | 7 ++-- .../test/integration/test_api_projects.py | 4 +- .../OmeroWeb/test/integration/test_chgrp.py | 3 +- .../test/integration/test_tree_annotations.py | 13 +++--- examples/Training/python/ROIs.py | 3 +- 18 files changed, 66 insertions(+), 85 deletions(-) diff --git a/components/tools/OmeroPy/test/integration/clitest/test_chgrp.py b/components/tools/OmeroPy/test/integration/clitest/test_chgrp.py index 50b3de5a371..2c930374229 100644 --- a/components/tools/OmeroPy/test/integration/clitest/test_chgrp.py +++ b/components/tools/OmeroPy/test/integration/clitest/test_chgrp.py @@ -20,7 +20,6 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. from builtins import range -from future.utils import native_str import omero from omero.cli import NonZeroReturnCode from omero.plugins.chgrp import ChgrpControl @@ -64,7 +63,7 @@ def testChgrpMyData(self, object_type, target_group_perms, group_prefix): # check the object has been moved new_object = self.query.get(object_type, oid, {'omero.group': - native_str(target_group.id.val)}) + str(target_group.id.val)}) assert new_object.id.val == oid def testNonMember(self): diff --git a/components/tools/OmeroPy/test/integration/clitest/test_cleanse.py b/components/tools/OmeroPy/test/integration/clitest/test_cleanse.py index c7f98abab8f..8fb258faabb 100644 --- a/components/tools/OmeroPy/test/integration/clitest/test_cleanse.py +++ b/components/tools/OmeroPy/test/integration/clitest/test_cleanse.py @@ -20,7 +20,6 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -from future.utils import native_str from omero.testlib.cli import CLITest from omero.cli import NonZeroReturnCode from omero.cmd import Delete2 @@ -59,7 +58,7 @@ def setup_method(self, method): super(TestCleanseFullAdmin, self).setup_method(method) self.cli.register("admin", omero.plugins.admin.AdminControl, "TEST") self.args += ["admin", "cleanse"] - self.group_ctx = {'omero.group': native_str(self.group.id.val)} + self.group_ctx = {'omero.group': str(self.group.id.val)} config_service = self.root.sf.getConfigService() self.mrepo_dir = config_service.getConfigValue("omero.managed.dir") self.data_dir = config_service.getConfigValue("omero.managed.dir") diff --git a/components/tools/OmeroPy/test/integration/fstest/test_rename.py b/components/tools/OmeroPy/test/integration/fstest/test_rename.py index 7eb502bb494..8d710caaa17 100644 --- a/components/tools/OmeroPy/test/integration/fstest/test_rename.py +++ b/components/tools/OmeroPy/test/integration/fstest/test_rename.py @@ -20,7 +20,6 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -from future.utils import native_str import pytest from omero.testlib import AbstractRepoTest @@ -112,7 +111,7 @@ def test_rename_permissions(self, data): mrepo = client.getManagedRepository() ctx = client.getContext(group=gid) if renamer == "root": - ctx["omero.user"] = native_str(uid) + ctx["omero.user"] = str(uid) new_dir = prep_directory(client, mrepo) try: diff --git a/components/tools/OmeroPy/test/integration/gatewaytest/test_chmod.py b/components/tools/OmeroPy/test/integration/gatewaytest/test_chmod.py index ab903f59d0f..3c8b7721abb 100644 --- a/components/tools/OmeroPy/test/integration/gatewaytest/test_chmod.py +++ b/components/tools/OmeroPy/test/integration/gatewaytest/test_chmod.py @@ -14,7 +14,6 @@ """ from builtins import object -from future.utils import native_str import omero import traceback from omero.rtypes import rstring @@ -454,7 +453,7 @@ def testWithoutWrappers(self, gatewaywrapper, author_testimg_generated): imgObj = image._obj gid = image.getDetails().group.id.val before = imgObj.getDetails().getPermissions().canEdit() - ctx = {'omero.group': native_str(gid)} + ctx = {'omero.group': str(gid)} imgObj = gatewaywrapper.gateway.getContainerService().getImages( "Image", (imgObj.id.val,), None, ctx)[0] after = imgObj.getDetails().getPermissions().canEdit() diff --git a/components/tools/OmeroPy/test/integration/gatewaytest/test_connection.py b/components/tools/OmeroPy/test/integration/gatewaytest/test_connection.py index 3ad5d679777..50a5f70efd2 100644 --- a/components/tools/OmeroPy/test/integration/gatewaytest/test_connection.py +++ b/components/tools/OmeroPy/test/integration/gatewaytest/test_connection.py @@ -13,7 +13,6 @@ from builtins import map from builtins import object -from future.utils import native_str import omero import Ice from omero.gateway.scripts import dbhelpers @@ -204,7 +203,7 @@ def testCloseSession(self, gatewaywrapper): gatewaywrapper.gateway.setIdentity( gatewaywrapper.USER.name, gatewaywrapper.USER.passwd) setprop = gatewaywrapper.gateway.c.ic.getProperties().setProperty - list(map(lambda x: setprop(x[0], native_str(x[1])), + list(map(lambda x: setprop(x[0], str(x[1])), list(gatewaywrapper.gateway._ic_props.items()))) gatewaywrapper.gateway.c.ic.getImplicitContext().put( omero.constants.GROUP, gatewaywrapper.gateway.group) diff --git a/components/tools/OmeroPy/test/integration/tablestest/test_service.py b/components/tools/OmeroPy/test/integration/tablestest/test_service.py index 7d4a8b242ae..e61c5aa4990 100755 --- a/components/tools/OmeroPy/test/integration/tablestest/test_service.py +++ b/components/tools/OmeroPy/test/integration/tablestest/test_service.py @@ -23,7 +23,6 @@ Test of the Tables service """ -from future.utils import native_str from builtins import str from builtins import range try: @@ -312,7 +311,7 @@ def testCallContext(self): # Create a user in one group and a table. group1 = self.new_group() - gid1 = native_str(group1.id.val) + gid1 = str(group1.id.val) client = self.new_client(group1) admin = client.sf.getAdminService() sr = client.sf.sharedResources() diff --git a/components/tools/OmeroPy/test/integration/test_chgrp.py b/components/tools/OmeroPy/test/integration/test_chgrp.py index 3239f318016..fe8c82faeed 100644 --- a/components/tools/OmeroPy/test/integration/test_chgrp.py +++ b/components/tools/OmeroPy/test/integration/test_chgrp.py @@ -25,7 +25,6 @@ """ from builtins import range -from future.utils import native_str import omero import omero.gateway from omero.testlib import ITest @@ -308,7 +307,7 @@ def testChgrpOneDatasetFilesetErr(self): "Dataset should not be in group: %s" % target_gid # query in the target group - ctx = {'omero.group': native_str(target_gid)} + ctx = {'omero.group': str(target_gid)} # Check first Dataset moved dataset = query_service.get('Dataset', datasets[0].id.val, ctx) @@ -340,7 +339,7 @@ def testChgrpAllDatasetsFilesetOK(self): # Check both Datasets and Images moved query_service = client.sf.getQueryService() # query in the target group - ctx = {'omero.group': native_str(target_gid)} + ctx = {'omero.group': str(target_gid)} for i in range(2): dataset = query_service.get('Dataset', datasets[i].id.val, ctx) image = query_service.get('Image', images[i].id.val, ctx) @@ -373,7 +372,7 @@ def testChgrpOneDatasetFilesetOK(self): # Check Dataset and both Images moved query_service = client.sf.getQueryService() - ctx = {'omero.group': native_str('-1')} # query across groups + ctx = {'omero.group': '-1'} # query across groups dataset = query_service.get('Dataset', ds.id.val, ctx) assert target_gid == dataset.details.group.id.val, \ "Dataset should be in group: %s" % target_gid @@ -434,7 +433,7 @@ def testChgrpDatasetTwoFilesetsErr(self): "Image should not be in group: %s" % target_gid # query in the target group - ctx = {'omero.group': native_str(target_gid)} + ctx = {'omero.group': str(target_gid)} # Check Dataset moved dataset = query_service.get('Dataset', ds.id.val, ctx) @@ -465,7 +464,7 @@ def testChgrpDatasetCheckFsGroup(self): self.do_submit(chgrp, client) # Check the group of the fileset is in sync with image. - ctx = {'omero.group': native_str('-1')} + ctx = {'omero.group': '-1'} qs = client.sf.getQueryService() image1 = qs.get("Image", images[0].id.val, ctx) fs_id = image1.fileset.id.val @@ -495,7 +494,7 @@ def testChgrpFilesetOK(self): # Check Fileset and both Images moved and # thus the Fileset is in sync with Images. - ctx = {'omero.group': native_str('-1')} # query across groups + ctx = {'omero.group': '-1'} # query across groups fileset = query.get('Fileset', fs_id, ctx) assert target_gid == fileset.details.group.id.val, \ "Fileset should be in group: %s" % target_gid @@ -561,7 +560,7 @@ def testChgrp11109(self): query = client.sf.getQueryService() with pytest.raises(omero.ValidationException): query.get("ScreenPlateLink", link.id.val, - {"omero.group": native_str("-1")}) + {"omero.group": "-1"}) def testChgrpDatasetWithImage(self): """ @@ -583,7 +582,7 @@ def testChgrpDatasetWithImage(self): self.link(d, i, client=client) self.change_group([d], target_gid, client) - ctx = {'omero.group': native_str('-1')} + ctx = {'omero.group': '-1'} assert target_gid == query.get("Image", i.id.val, ctx).details.group.id.val assert target_gid == query.get("Dataset", @@ -611,7 +610,7 @@ def testChgrpPDIReverseLinkOrder(self): self.link(d, i, client=client) self.change_group([p], target_gid, client=client) - ctx = {'omero.group': native_str('-1')} + ctx = {'omero.group': '-1'} assert target_gid == query.get("Project", p.id.val, ctx).details.group.id.val assert target_gid == query.get("Dataset", @@ -642,7 +641,7 @@ def testChgrpTwoDatasetsLinkedToSingleImageDefault(self): self.link(d2, i, client=client) self.change_group([d1], target_gid, client=client) - ctx = {'omero.group': native_str('-1')} + ctx = {'omero.group': '-1'} assert target_gid == query.get("Dataset", d1.id.val, ctx).details.group.id.val assert target_gid != query.get("Dataset", @@ -678,7 +677,7 @@ def testChgrpTwoDatasetsLinkedToSingleImageHard(self): groupId=target_gid) self.do_submit(chgrp, client) - ctx = {'omero.group': native_str('-1')} + ctx = {'omero.group': '-1'} assert target_gid == query.get("Dataset", d1.id.val, ctx).details.group.id.val assert target_gid != query.get("Dataset", @@ -711,7 +710,7 @@ def testChgrpProjectWithDatasetLinkedToImageWithOtherDatasetDefault(self): self.link(p, d1, client=client) self.change_group([p], target_gid, client) - ctx = {'omero.group': native_str('-1')} + ctx = {'omero.group': '-1'} assert target_gid == query.get("Project", p.id.val, ctx).details.group.id.val assert target_gid == query.get("Dataset", @@ -749,7 +748,7 @@ def testChgrpProjectWithDatasetLinkedToImageWithOtherDatasetHard(self): groupId=target_gid) self.do_submit(chgrp, client) - ctx = {'omero.group': native_str('-1')} + ctx = {'omero.group': '-1'} assert target_gid == query.get("Project", p.id.val, ctx).details.group.id.val assert target_gid == query.get("Dataset", @@ -784,7 +783,7 @@ def testChgrpDatasetWithImageLinkedToTwoProjects(self): self.link(d, i, client=client) self.change_group([d], target_gid, client) - ctx = {'omero.group': native_str('-1')} + ctx = {'omero.group': '-1'} assert not target_gid == query.get("Project", p1.id.val, ctx).details.group.id.val @@ -820,7 +819,7 @@ def testChgrpProjectLinkedToDatasetAndImageDefault(self): self.link(d, i, client=client) self.change_group([p1], target_gid, client) - ctx = {'omero.group': native_str('-1')} + ctx = {'omero.group': '-1'} assert target_gid == query.get("Project", p1.id.val, ctx).details.group.id.val assert target_gid != query.get("Dataset", @@ -858,7 +857,7 @@ def testChgrpProjectLinkedToDatasetAndImageHard(self): groupId=target_gid) self.do_submit(chgrp, client) - ctx = {'omero.group': native_str('-1')} + ctx = {'omero.group': '-1'} assert target_gid == query.get("Project", p1.id.val, ctx).details.group.id.val assert target_gid != query.get("Project", @@ -891,7 +890,7 @@ def testChgrpProjectLinkedToDatasetDefault(self): self.link(p2, d, client=client) self.change_group([p1], target_gid, client) - ctx = {'omero.group': native_str('-1')} + ctx = {'omero.group': '-1'} assert target_gid == query.get("Project", p1.id.val, ctx).details.group.id.val assert target_gid != query.get("Dataset", @@ -925,7 +924,7 @@ def testChgrpProjectLinkedToDatasetHard(self): groupId=target_gid) self.do_submit(chgrp, client) - ctx = {'omero.group': native_str('-1')} + ctx = {'omero.group': '-1'} assert target_gid == query.get("Project", p1.id.val, ctx).details.group.id.val assert target_gid != query.get("Project", @@ -1043,7 +1042,7 @@ def createDSInGroup(self, gid, name=None, client=None): name = self.uuid() if client is None: client = self.client - ctx = {'omero.group': native_str(gid)} + ctx = {'omero.group': str(gid)} update = client.sf.getUpdateService() ds = self.new_dataset(name) return update.saveAndReturnObject(ds, ctx) @@ -1159,7 +1158,7 @@ def testChgrpDatasetToTargetProject(self, credentials): update = client.sf.getUpdateService() ds = self.make_dataset(client=client) # ...and Project in target group - ctx = {'omero.group': native_str(target_gid)} + ctx = {'omero.group': str(target_gid)} pr = self.new_project() pr = update.saveAndReturnObject(pr, ctx) diff --git a/components/tools/OmeroPy/test/integration/test_client_ctors.py b/components/tools/OmeroPy/test/integration/test_client_ctors.py index a7c1a80c3a8..ac196cce176 100644 --- a/components/tools/OmeroPy/test/integration/test_client_ctors.py +++ b/components/tools/OmeroPy/test/integration/test_client_ctors.py @@ -24,7 +24,6 @@ """ -from future.utils import native_str import os from omero.testlib import ITest import omero @@ -59,7 +58,7 @@ def testEmptyInitializationDataConstructor(self): # With no argument id.properties is empty id.properties = Ice.createProperties() id.properties.setProperty("omero.host", self.host) - id.properties.setProperty("omero.port", native_str(self.port)) + id.properties.setProperty("omero.port", str(self.port)) id.properties.setProperty("omero.user", "root") id.properties.setProperty("omero.pass", self.rootpasswd) c = omero.client(id=id) diff --git a/components/tools/OmeroPy/test/integration/test_delete.py b/components/tools/OmeroPy/test/integration/test_delete.py index 6acbe8cd9b9..6b9b45c03de 100644 --- a/components/tools/OmeroPy/test/integration/test_delete.py +++ b/components/tools/OmeroPy/test/integration/test_delete.py @@ -26,7 +26,6 @@ from builtins import str from builtins import range -from future.utils import native_str import traceback from omero.testlib import ITest import pytest @@ -133,7 +132,7 @@ def testCheckIfDeleted(self): cmd = Delete2(targetObjects={"Image": [iid]}) handle = self.client.sf.submit(cmd) callback = self.wait_on_cmd(self.client, handle) - cbString = native_str(handle) + cbString = str(handle) callback.close(True) # Don't close handle @@ -312,11 +311,11 @@ def test3639(self): keep = ChildOption(excludeType=["Image"]) dc = Delete2( targetObjects={'Dataset': [dataset.id.val]}, childOptions=[keep]) - handlers.append(native_str(client_o.sf.submit(dc))) + handlers.append(str(client_o.sf.submit(dc))) imageToDelete = images[2].id.val dc2 = Delete2(targetObjects={'Image': [imageToDelete]}) - handlers.append(native_str(client_o.sf.submit(dc2))) + handlers.append(str(client_o.sf.submit(dc2))) def _formatReport(delete_handle): """ diff --git a/components/tools/OmeroPy/test/integration/test_iquery.py b/components/tools/OmeroPy/test/integration/test_iquery.py index 53226f332bf..0789ef2dcc6 100644 --- a/components/tools/OmeroPy/test/integration/test_iquery.py +++ b/components/tools/OmeroPy/test/integration/test_iquery.py @@ -25,7 +25,6 @@ """ from builtins import range -from future.utils import native_str from omero.testlib import ITest from omero.rtypes import rstring from omero.rtypes import unwrap, wrap @@ -52,7 +51,7 @@ def testGetPixelsCount(self): * p.sizeZ * p.sizeT * p.sizeC) from Pixels p group by p.pixelsType.value """, - None, {"omero.group": native_str(group.id.val)}) + None, {"omero.group": str(group.id.val)}) rv = unwrap(rtypeseqseq) as_map = dict() for obj_array in rv: @@ -114,7 +113,7 @@ def testQueryTaggedUnique(self): link.child = TagAnnotationI(lnk.child.id, False) rootLinks.append(link) rootUpdate.saveAndReturnArray(rootLinks, {'omero.group': - native_str(groupId)}) + str(groupId)}) q = """select distinct new map(obj.id as id, obj.name as name, @@ -142,7 +141,7 @@ def testQueryTaggedUnique(self): where alink.child.id=:tid and alink.parent.id=obj.id)""" query = q % uniqueClause result1 = queryService.projection(query, params, - {'omero.group': native_str(groupId)}) + {'omero.group': str(groupId)}) assert len(result1) == tagCount # Without the select statement, we get the same image returned @@ -150,7 +149,7 @@ def testQueryTaggedUnique(self): clause = "alink.child.id=:tid" query = q % clause result2 = queryService.projection(query, params, - {'omero.group': native_str(groupId)}) + {'omero.group': str(groupId)}) assert len(result2) == tagCount for idx in range(len(result1)-1): # Omit final since == isn't defined for Ice objects. diff --git a/components/tools/OmeroPy/test/integration/test_ishare.py b/components/tools/OmeroPy/test/integration/test_ishare.py index 99bfe63580f..bae3084b53a 100644 --- a/components/tools/OmeroPy/test/integration/test_ishare.py +++ b/components/tools/OmeroPy/test/integration/test_ishare.py @@ -9,7 +9,6 @@ Use is subject to license terms supplied in LICENSE.txt """ -from future.utils import native_str import time from omero.testlib import ITest import pytest @@ -260,7 +259,7 @@ def testCanAnnotate(self): p = omero.sys.Parameters() p.map = {"ids": rlist([rlong(img.id.val)])} sql = "select im from Image im where im.id in (:ids) order by im.name" - res = query2.findAllByQuery(sql, p, {'omero.share': native_str(sid)}) + res = query2.findAllByQuery(sql, p, {'omero.share': str(sid)}) assert 1 == len(res) # User should not be able to annotate private image. @@ -920,9 +919,9 @@ def test8513(self): assert False, "Error: Member shouldn't access image in share!" rv = member_query.find("Image", image.id.val, - {'omero.share': native_str(sid), + {'omero.share': str(sid), 'omero.group': - native_str(image.details.group.id.val)}) + str(image.details.group.id.val)}) assert image.id.val == rv.id.val # join share @@ -934,7 +933,7 @@ def test8513(self): user_query = user_client.sf.getQueryService() rv = user_query.find("Image", image2.id.val, {'omero.group': - native_str(image2.details.group.id.val)}) + str(image2.details.group.id.val)}) assert image2.id.val == rv.id.val finally: user_client.__del__() @@ -975,7 +974,7 @@ def test8704(self): sql = "select im from Image im join fetch im.details.owner " \ "join fetch im.details.group where im.id=:id order by im.name" image = owner.sf.getQueryService().findAllByQuery( - sql, p, {'omero.group': native_str(owner_groupId)})[0] + sql, p, {'omero.group': str(owner_groupId)})[0] rdefs = owner.sf.getQueryService().findAll("RenderingDef", None) @@ -1005,7 +1004,7 @@ def test8704(self): assert False, "Error: Member shouldn't access image in share!" rv = member_query.find("Image", image.id.val, - {'omero.share': native_str(sid)}) + {'omero.share': str(sid)}) # Not sure which group to set # 'omero.group':str(image.details.group.id.val) # or 'omero.group':str(member_groupId) @@ -1015,7 +1014,7 @@ def test8704(self): member_tb = member.sf.createThumbnailStore() try: member_tb.setPixelsId(rdefs[0].pixels.id.val, - {'omero.share': native_str(sid)}) + {'omero.share': str(sid)}) finally: member_tb.close() # join share @@ -1027,7 +1026,7 @@ def test8704(self): user_query = user_client.sf.getQueryService() rv = user_query.find("Image", image2.id.val, {'omero.group': - native_str(image2.details.group.id.val)}) + str(image2.details.group.id.val)}) assert image2.id.val == rv.id.val finally: user_client.__del__() diff --git a/components/tools/OmeroPy/test/integration/test_permissions.py b/components/tools/OmeroPy/test/integration/test_permissions.py index 52a491164e5..0db42c5de9b 100644 --- a/components/tools/OmeroPy/test/integration/test_permissions.py +++ b/components/tools/OmeroPy/test/integration/test_permissions.py @@ -26,7 +26,6 @@ from builtins import str from builtins import object -from future.utils import native_str import pytest from omero.testlib import ITest, PFS import omero @@ -131,7 +130,7 @@ def testLoginToPublicGroupTicket1940(self): ec = self.client.sf.getAdminService().getEventContext() public_client = omero.client(rv) public_client.getImplicitContext().put("omero.group", - native_str(uuid)) + str(uuid)) sf = public_client.createSession(ec.userName, ec.userName) ec = sf.getAdminService().getEventContext() assert uuid == ec.groupName @@ -681,7 +680,7 @@ def testPrivateGroupCallContext(self): # Setup groups as per Carlos' instructions (Feb 23) groupX = self.new_group(perms="rwrw--") clientA, userA = self.new_client_and_user(group=groupX) - gid = native_str(groupX.id.val) + gid = str(groupX.id.val) groupY = self.new_group(perms="rw----") clientB, userB = self.new_client_and_user(group=groupY) @@ -747,8 +746,8 @@ def testOmeroUserAsNonAdmin(self): self.assertAsUser(client, image, user, group) def assertAsUser(self, client, image, user, group): - callcontext = {"omero.user": native_str(user.id.val), - "omero.group": native_str(group.id.val)} + callcontext = {"omero.user": str(user.id.val), + "omero.group": str(group.id.val)} query = client.sf.getQueryService() query.get("Image", image.id.val, callcontext) @@ -834,7 +833,7 @@ def testUseOfRawFileBeanScriptReadGroupMinusOne(self): def testUseOfRawFileBeanScriptReadCorrectGroup(self): self.assertValidScript(lambda v: {'omero.group': - native_str(v.details.group.id.val)}) + str(v.details.group.id.val)}) @pytest.mark.broken(ticket="11539") def testUseOfRawFileBeanScriptReadCorrectGroupAndUser(self): @@ -936,7 +935,7 @@ def testProjectionPermissions(self, fixture): proj = unwrap(reader.projection( "select p from Project p where p.id = :id", ParametersI().addId(project.id.val), - {"omero:group": native_str(group)}))[0][0] + {"omero:group": str(group)}))[0][0] assert fixture.canRead perms = proj.details.permissions value = { diff --git a/components/tools/OmeroPy/test/integration/test_thumbnailPerms.py b/components/tools/OmeroPy/test/integration/test_thumbnailPerms.py index 6a13b0064ee..db84538e931 100644 --- a/components/tools/OmeroPy/test/integration/test_thumbnailPerms.py +++ b/components/tools/OmeroPy/test/integration/test_thumbnailPerms.py @@ -25,7 +25,6 @@ """ -from future.utils import native_str import Ice import pytest from omero.testlib import ITest @@ -96,7 +95,7 @@ def testThumbs(self): owner_client = self.new_client( user=newOwner, password=newOwner.omeName.val) - group_ctx = {"omero.group": native_str(privateGroup)} + group_ctx = {"omero.group": str(privateGroup)} self.getThumbnail(owner_client.sf, privateImageId, *group_ctx) # check that we can't get thumbnails for images in other groups assert self.getThumbnail(owner_client.sf, readOnlyImageId) is None @@ -223,28 +222,28 @@ def assert10618(self, group, tester, preview, *ctx): def testPrivate10618RootWithGrpCtx(self): group = self.new_group(perms="rw----") - grp_ctx = {"omero.group": native_str(group.id.val)} + grp_ctx = {"omero.group": str(group.id.val)} self.assert10618(group, self.root, True, grp_ctx) def testPrivate10618RootWithGrpCtxButNoLoad(self): group = self.new_group(perms="rw----") - grp_ctx = {"omero.group": native_str(group.id.val)} + grp_ctx = {"omero.group": str(group.id.val)} self.assert10618(group, self.root, False, grp_ctx) def testReadOnly10618RootWithGrpCtx(self): group = self.new_group(perms="rwr---") - grp_ctx = {"omero.group": native_str(group.id.val)} + grp_ctx = {"omero.group": str(group.id.val)} self.assert10618(group, self.root, True, grp_ctx) def testReadOnly10618RootWithGrpCtxButNoLoad(self): group = self.new_group(perms="rwr---") - grp_ctx = {"omero.group": native_str(group.id.val)} + grp_ctx = {"omero.group": str(group.id.val)} self.assert10618(group, self.root, False, grp_ctx) def testReadOnly10618MemberWithGrpCtxButNoLoad(self): group = self.new_group(perms="rwr---") member = self.new_client(group=group) - grp_ctx = {"omero.group": native_str(group.id.val)} + grp_ctx = {"omero.group": str(group.id.val)} self.assert10618(group, member, False, grp_ctx) @pytest.mark.broken(reason="requires thumbnail work") diff --git a/components/tools/OmeroWeb/test/integration/test_api_errors.py b/components/tools/OmeroWeb/test/integration/test_api_errors.py index e93417576c7..44561a32f22 100644 --- a/components/tools/OmeroWeb/test/integration/test_api_errors.py +++ b/components/tools/OmeroWeb/test/integration/test_api_errors.py @@ -19,7 +19,6 @@ """Tests querying & editing Projects with webgateway json api.""" -from future.utils import native_str from omeroweb.testlib import IWebTest, post_json, put_json, get_json from django.urls import reverse from omeroweb.api import api_settings @@ -125,13 +124,13 @@ def test_security_violation(self, group_B, user_A): # Create project in group_A (default group) payload = {'Name': 'test_security_violation', '@type': OME_SCHEMA_URL + '#Project'} - save_url_grp_A = save_url + '?group=' + native_str(group_A_id) + save_url_grp_A = save_url + '?group=' + str(group_A_id) rsp = post_json(django_client, save_url_grp_A, payload, status_code=201) pr_json = rsp['data'] projectId = pr_json['@id'] # Try to save again into group B - save_url_grp_B = save_url + '?group=' + native_str(group_B_id) + save_url_grp_B = save_url + '?group=' + str(group_B_id) rsp = put_json(django_client, save_url_grp_B, pr_json, status_code=403) assert 'message' in rsp msg = "Cannot read ome.model.containers.Project:Id_%s" % projectId @@ -147,7 +146,7 @@ def test_validation_exception(self, user_A): django_client = self.new_django_client(userName, userName) version = api_settings.API_VERSIONS[-1] save_url = reverse('api_save', kwargs={'api_version': version}) - save_url += '?group=' + native_str(group) + save_url += '?group=' + str(group) # Create Tag tag = TagAnnotationI() diff --git a/components/tools/OmeroWeb/test/integration/test_api_projects.py b/components/tools/OmeroWeb/test/integration/test_api_projects.py index b89e5c0c4ef..3fe6fe0d567 100644 --- a/components/tools/OmeroWeb/test/integration/test_api_projects.py +++ b/components/tools/OmeroWeb/test/integration/test_api_projects.py @@ -22,8 +22,6 @@ """ -from future.utils import native_str - from builtins import zip from builtins import range from omeroweb.testlib import IWebTest, get_json, \ @@ -570,7 +568,7 @@ def test_project_update(self, user1): assert project_json['Description'] == 'Test update' # No change # 2) Put from scratch (will delete empty fields, E.g. Description) - save_url += '?group=' + native_str(group) + save_url += '?group=' + str(group) payload = {'Name': 'updated name', '@id': project.id.val} # Test error message if we don't pass @type: diff --git a/components/tools/OmeroWeb/test/integration/test_chgrp.py b/components/tools/OmeroWeb/test/integration/test_chgrp.py index f6023c54d41..c1be87d2bcd 100644 --- a/components/tools/OmeroWeb/test/integration/test_chgrp.py +++ b/components/tools/OmeroWeb/test/integration/test_chgrp.py @@ -21,7 +21,6 @@ Tests chgrp functionality of views.py """ -from future.utils import native_str from omero.model import ProjectI, DatasetI, TagAnnotationI from omero.rtypes import rstring from omero.gateway import BlitzGateway @@ -268,7 +267,7 @@ def test_chgrp_old_container(self, dataset, credentials): project = ProjectI() projectName = "chgrp-target-%s" % self.client.getSessionId() project.name = rstring(projectName) - ctx = {"omero.group": native_str(self.group2.id.val)} + ctx = {"omero.group": str(self.group2.id.val)} project = self.sf.getUpdateService().saveAndReturnObject(project, ctx) request_url = reverse('chgrp') diff --git a/components/tools/OmeroWeb/test/integration/test_tree_annotations.py b/components/tools/OmeroWeb/test/integration/test_tree_annotations.py index 8bd94be71ad..0acf4a5dc43 100644 --- a/components/tools/OmeroWeb/test/integration/test_tree_annotations.py +++ b/components/tools/OmeroWeb/test/integration/test_tree_annotations.py @@ -22,7 +22,6 @@ """ from builtins import zip -from future.utils import native_str from past.utils import old_div import pytest import pytz @@ -76,7 +75,7 @@ def project_userA(request, userA, groupA): """ Returns new OMERO Project """ - ctx = {'omero.group': native_str(groupA.id.val)} + ctx = {'omero.group': str(groupA.id.val)} project = ProjectI() project.name = rstring("test_tree_annnotations") project = get_update_service(userA).saveAndReturnObject(project, ctx) @@ -89,7 +88,7 @@ def projects_userA(request, userA, groupA): Returns new OMERO Project """ to_save = [] - ctx = {'omero.group': native_str(groupA.id.val)} + ctx = {'omero.group': str(groupA.id.val)} for name in "test_ann1", "test_ann2": project = ProjectI() project.name = rstring(name) @@ -105,7 +104,7 @@ def tags_userA_userB(request, userA, userB, groupA): Returns new OMERO Tags with descriptions """ tags = [] - ctx = {'omero.group': native_str(groupA.id.val)} + ctx = {'omero.group': str(groupA.id.val)} for name, user in zip(["userAtag", "userBtag"], [userA, userB]): tag = TagAnnotationI() tag.textValue = rstring(name) @@ -124,7 +123,7 @@ def comments_userA(request, userA, groupA): Returns new OMERO Comments """ comments = [] - ctx = {'omero.group': native_str(groupA.id.val)} + ctx = {'omero.group': str(groupA.id.val)} for text in ["Test Comment", "Another comment userA"]: comment = CommentAnnotationI() comment.textValue = rstring(text) @@ -140,7 +139,7 @@ def rating_userA(request, userA, groupA): Returns new OMERO Rating """ rating = LongAnnotationI() - ctx = {'omero.group': native_str(groupA.id.val)} + ctx = {'omero.group': str(groupA.id.val)} rating.longValue = rlong(4) rating.ns = rstring(omero.constants.metadata.NSINSIGHTRATING) rating = get_update_service(userA).saveAndReturnObject(rating, ctx) @@ -152,7 +151,7 @@ def annotate_project(ann, project, user): Returns userA's Tag linked to userB's Project by userA and userB """ - ctx = {'omero.group': native_str(project.details.group.id.val)} + ctx = {'omero.group': str(project.details.group.id.val)} print("annotate_project", ctx) link = ProjectAnnotationLinkI() link.parent = ProjectI(project.id.val, False) diff --git a/examples/Training/python/ROIs.py b/examples/Training/python/ROIs.py index 29e417192ae..d655bc510f0 100755 --- a/examples/Training/python/ROIs.py +++ b/examples/Training/python/ROIs.py @@ -11,7 +11,6 @@ FOR TRAINING PURPOSES ONLY! """ -from future.utils import native_str from builtins import str from builtins import range from past.utils import old_div @@ -132,7 +131,7 @@ def create_mask(mask_bytes, bytes_per_pixel=1): for i in range(int(steps)): binary = mask_bytes[ i * int(divider):i * int(divider) + int(divider)] - format = native_str(int(byte_factor * len(binary))) + format_string + format = str(int(byte_factor * len(binary))) + format_string binary = struct.unpack(format, binary) s = "" for bit in binary: From 1d3201389d452bb8680c9f083b3878805a428274 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Besson?= Date: Sat, 20 Jan 2024 11:42:22 +0000 Subject: [PATCH 05/16] Replace all usages of standard_library compatibility method --- components/tools/OmeroPy/test/integration/clitest/test_db.py | 3 --- .../OmeroPy/test/integration/gatewaytest/test_annotation.py | 2 -- .../tools/OmeroPy/test/integration/gatewaytest/test_rdefs.py | 2 -- components/tools/OmeroWeb/test/integration/test_rendering.py | 3 --- components/tools/OmeroWeb/test/integration/test_thumbnails.py | 2 -- examples/Training/python/Render_Images.py | 2 -- 6 files changed, 14 deletions(-) diff --git a/components/tools/OmeroPy/test/integration/clitest/test_db.py b/components/tools/OmeroPy/test/integration/clitest/test_db.py index 2ef28804081..42ca1cf4b72 100644 --- a/components/tools/OmeroPy/test/integration/clitest/test_db.py +++ b/components/tools/OmeroPy/test/integration/clitest/test_db.py @@ -9,8 +9,6 @@ """ -from future import standard_library - from builtins import str from builtins import object import pytest @@ -20,7 +18,6 @@ from omero.cli import NonZeroReturnCode from omero.cli import CLI import re -standard_library.install_aliases() # noqa OMERODIR = False diff --git a/components/tools/OmeroPy/test/integration/gatewaytest/test_annotation.py b/components/tools/OmeroPy/test/integration/gatewaytest/test_annotation.py index 44fe548895a..ebbd9db45f0 100644 --- a/components/tools/OmeroPy/test/integration/gatewaytest/test_annotation.py +++ b/components/tools/OmeroPy/test/integration/gatewaytest/test_annotation.py @@ -13,7 +13,6 @@ """ -from future import standard_library from builtins import str from builtins import range import time @@ -29,7 +28,6 @@ except Exception: # Python 3 long = int -standard_library.install_aliases() def _testAnnotation(obj, annclass, ns, value, sameOwner=False, diff --git a/components/tools/OmeroPy/test/integration/gatewaytest/test_rdefs.py b/components/tools/OmeroPy/test/integration/gatewaytest/test_rdefs.py index 75af95a0b41..b2a227e2587 100644 --- a/components/tools/OmeroPy/test/integration/gatewaytest/test_rdefs.py +++ b/components/tools/OmeroPy/test/integration/gatewaytest/test_rdefs.py @@ -14,7 +14,6 @@ """ -from future import standard_library from builtins import str from builtins import object import pytest @@ -22,7 +21,6 @@ from io import BytesIO from PIL import Image, ImageChops import omero -standard_library.install_aliases() class TestRDefs (object): diff --git a/components/tools/OmeroWeb/test/integration/test_rendering.py b/components/tools/OmeroWeb/test/integration/test_rendering.py index 004e4115042..61efd22f658 100644 --- a/components/tools/OmeroWeb/test/integration/test_rendering.py +++ b/components/tools/OmeroWeb/test/integration/test_rendering.py @@ -21,8 +21,6 @@ Tests copying and pasting of rendering settings in webclient """ -from future import standard_library - from builtins import str import json import omero @@ -38,7 +36,6 @@ from PIL import Image except ImportError: import Image -standard_library.install_aliases() class TestRendering(IWebTest): diff --git a/components/tools/OmeroWeb/test/integration/test_thumbnails.py b/components/tools/OmeroWeb/test/integration/test_thumbnails.py index 120413cb62f..0cc3dcf67a5 100644 --- a/components/tools/OmeroWeb/test/integration/test_thumbnails.py +++ b/components/tools/OmeroWeb/test/integration/test_thumbnails.py @@ -19,7 +19,6 @@ """Tests rendering of thumbnails.""" -from future import standard_library from builtins import range import base64 import json @@ -37,7 +36,6 @@ from PIL import Image except Exception: import Image -standard_library.install_aliases() def rgba_to_int(red, green, blue, alpha=255): diff --git a/examples/Training/python/Render_Images.py b/examples/Training/python/Render_Images.py index 36dbeac4beb..22b8922b75a 100644 --- a/examples/Training/python/Render_Images.py +++ b/examples/Training/python/Render_Images.py @@ -11,7 +11,6 @@ FOR TRAINING PURPOSES ONLY! """ -from future import standard_library from builtins import range from past.utils import old_div from omero.gateway import BlitzGateway @@ -22,7 +21,6 @@ import Image from Parse_OMERO_Properties import USERNAME, PASSWORD, HOST, PORT, imageId -standard_library.install_aliases() """ start-code """ From 46568a0ed72bd73abb4400878756506153a4bab2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Besson?= Date: Sat, 20 Jan 2024 12:07:56 +0000 Subject: [PATCH 06/16] Replace all usages of old_div For numerical division, use / when the result is expected to be a float or // when the floor division is desired For path concatenation, use / systematically --- components/tools/OmeroFS/test/drivers.py | 7 +++---- .../OmeroPy/test/integration/clitest/test_admin.py | 13 ++++--------- .../OmeroPy/test/integration/clitest/test_import.py | 3 +-- .../test/integration/clitest/test_import_bulk.py | 4 +--- .../integration/gatewaytest/test_missing_pyramid.py | 5 ++--- .../integration/scriptstest/test_script_utils.py | 9 ++++----- .../OmeroPy/test/integration/test_rawpixelsstore.py | 9 ++++----- .../test/integration/test_reporawfilestore.py | 3 +-- .../OmeroPy/test/integration/test_repository.py | 3 +-- .../tools/OmeroPy/test/integration/test_scripts.py | 3 +-- .../OmeroWeb/test/integration/test_plategrid.py | 5 ++--- .../tools/OmeroWeb/test/integration/test_show.py | 5 ++--- .../test/integration/test_tree_annotations.py | 3 +-- examples/Training/python/Create_Image.py | 3 +-- examples/Training/python/ROIs.py | 5 ++--- examples/Training/python/Raw_Data_Access.py | 3 +-- examples/Training/python/Render_Images.py | 3 +-- 17 files changed, 32 insertions(+), 54 deletions(-) diff --git a/components/tools/OmeroFS/test/drivers.py b/components/tools/OmeroFS/test/drivers.py index 56f083cd825..a107208dad1 100644 --- a/components/tools/OmeroFS/test/drivers.py +++ b/components/tools/OmeroFS/test/drivers.py @@ -13,7 +13,6 @@ from builtins import str from builtins import range from builtins import object -from past.utils import old_div import logging import threading import time @@ -68,7 +67,7 @@ def run(self): By default, nothing. """ self.log.info("Sleeping %s" % self.waitMillis) - time.sleep(old_div(self.waitMillis, 1000)) + time.sleep(self.waitMillis / 1000) if not self.client: self.log.error("No client") self.doRun() @@ -159,7 +158,7 @@ def with_driver(func, errors=0): """ Decorator for running a test with a Driver """ def handler(*args, **kwargs): self = args[0] - self.dir = old_div(create_path(folder=True), "DropBox") + self.dir = create_path(folder=True) / "DropBox" self.simulator = Simulator(self.dir) self.client = MockMonitor(self.dir, pre=[self.simulator], post=[]) try: @@ -309,7 +308,7 @@ def fsEventHappened(self, monitorid, eventList, current=None): if not file.isdir(): raise Exception("%s is not a directory" % file) self.log.info("Creating file in dir %s", file) - new_file = old_div(file, str(uuid.uuid4())) + new_file = file / str(uuid.uuid4()) new_file.write_lines( ["Writing new file to modify this" "directory on event: %s" % event]) diff --git a/components/tools/OmeroPy/test/integration/clitest/test_admin.py b/components/tools/OmeroPy/test/integration/clitest/test_admin.py index 60e376c96c4..2311731de44 100644 --- a/components/tools/OmeroPy/test/integration/clitest/test_admin.py +++ b/components/tools/OmeroPy/test/integration/clitest/test_admin.py @@ -21,7 +21,6 @@ from builtins import str -from past.utils import old_div import pytest import os @@ -58,10 +57,8 @@ def setup_method(self, method): self.cli.register("admin", omero.plugins.admin.AdminControl, "TEST") # omero needs the etc/grid directory self.cli.dir = ( - old_div(old_div(old_div(old_div( - old_div(old_div( - old_div(path(__file__).dirname(), ".."), - ".."), ".."), ".."), ".."), ".."), "dist")) + path(__file__).dirname() / + ".." / ".." / ".." / ".." / ".." / ".." / "dist") self.args += ["admin"] def go(self): @@ -113,10 +110,8 @@ def setup_method(self, method): self.cli.register("admin", omero.plugins.admin.AdminControl, "TEST") # omero needs the etc/grid directory self.cli.dir = ( - old_div(old_div(old_div(old_div( - old_div(old_div( - old_div(path(__file__).dirname(), ".."), - ".."), ".."), ".."), ".."), ".."), "dist")) + path(__file__).dirname() / + ".." / ".." / ".." / ".." / ".." / ".." / "dist") self.args += ["admin"] def test_log(self): diff --git a/components/tools/OmeroPy/test/integration/clitest/test_import.py b/components/tools/OmeroPy/test/integration/clitest/test_import.py index b79adf3b720..828bfb63e43 100644 --- a/components/tools/OmeroPy/test/integration/clitest/test_import.py +++ b/components/tools/OmeroPy/test/integration/clitest/test_import.py @@ -20,7 +20,6 @@ from builtins import str from builtins import range -from past.utils import old_div from builtins import object from omero.testlib.cli import CLITest import pytest @@ -175,7 +174,7 @@ def do_import(self, capfd, strip_logs=True): return o, e def add_client_dir(self): - client_dir = old_div(old_div(self.omero_dist, "lib"), "client") + client_dir = self.omero_dist / "lib" / "client" self.args += ["--clientdir", client_dir] def check_other_output(self, out, import_type='default'): diff --git a/components/tools/OmeroPy/test/integration/clitest/test_import_bulk.py b/components/tools/OmeroPy/test/integration/clitest/test_import_bulk.py index 050cb1f961f..c07f6d5229b 100644 --- a/components/tools/OmeroPy/test/integration/clitest/test_import_bulk.py +++ b/components/tools/OmeroPy/test/integration/clitest/test_import_bulk.py @@ -19,7 +19,6 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. from builtins import str -from past.utils import old_div from omero.cli import NonZeroReturnCode from omero.testlib.cli import CLITest from omero.plugins.sessions import SessionsControl @@ -125,8 +124,7 @@ def testBulk(self, tmpdir, capfd, monkeypatch): script = tmpdir.join("script1.sh") self.args += ["import", "-f", "--bulk", str(yml), - "--clientdir", old_div(old_div(self.omero_dist, "lib"), - "client")] + "--clientdir", self.omero_dist / "lib" / "client"] monkeypatch.setattr(sys, "argv", ["omero"]) out, err = self.do_import(capfd) diff --git a/components/tools/OmeroPy/test/integration/gatewaytest/test_missing_pyramid.py b/components/tools/OmeroPy/test/integration/gatewaytest/test_missing_pyramid.py index 91e37b0b55a..da9e10dbfc4 100644 --- a/components/tools/OmeroPy/test/integration/gatewaytest/test_missing_pyramid.py +++ b/components/tools/OmeroPy/test/integration/gatewaytest/test_missing_pyramid.py @@ -11,7 +11,6 @@ """ from builtins import object -from past.utils import old_div import omero import pytest @@ -31,7 +30,7 @@ def testThrowException(self): assert False, "_prepareRE should have thrown an exception" except omero.ConcurrencyException as ce: print("Handling MissingPyramidException with backoff: %s secs" - % (old_div(ce.backOff, 1000))) + % (ce.backOff / 1000)) def testPrepareRenderingEngine(self): """ @@ -46,7 +45,7 @@ def testPrepareRenderingEngine(self): "_prepareRenderingEngine() should have thrown an exception" except omero.ConcurrencyException as ce: print("Handling MissingPyramidException with backoff: %s secs" - % (old_div(ce.backOff, 1000))) + % (ce.backOff / 1000)) def testGetChannels(self): """ Missing Pyramid shouldn't stop us from getting Channel Info """ diff --git a/components/tools/OmeroPy/test/integration/scriptstest/test_script_utils.py b/components/tools/OmeroPy/test/integration/scriptstest/test_script_utils.py index 8b516a404b4..b16a585f333 100644 --- a/components/tools/OmeroPy/test/integration/scriptstest/test_script_utils.py +++ b/components/tools/OmeroPy/test/integration/scriptstest/test_script_utils.py @@ -24,7 +24,6 @@ from builtins import str from builtins import range -from past.utils import old_div import pytest from omero.testlib import ITest import omero.util.script_utils as scriptUtil @@ -73,7 +72,7 @@ def test_numpy_to_image(self): min_c = c.getWindowMin() max_c = c.getWindowMax() channel_min_max.append((min_c, max_c)) - z = old_div(image.getSizeZ(), 2) + z = image.getSizeZ() // 2 t = 0 c = 0 try: @@ -103,7 +102,7 @@ def test_convert_numpy_array(self): min_c = c.getWindowMin() max_c = c.getWindowMax() channel_min_max.append((min_c, max_c)) - z = old_div(image.getSizeZ(), 2) + z = image.getSizeZ() // 2 t = 0 c = 0 try: @@ -129,7 +128,7 @@ def test_numpy_save_as_image(self, format, is_file): min_c = c.getWindowMin() max_c = c.getWindowMax() channel_min_max.append((min_c, max_c)) - z = old_div(image.getSizeZ(), 2) + z = image.getSizeZ() // 2 t = 0 c = 0 @@ -245,7 +244,7 @@ def f1(x, y): return y def f2(x, y): - return old_div((x + y), 2) + return (x + y) // 2 def f3(x, y): return x diff --git a/components/tools/OmeroPy/test/integration/test_rawpixelsstore.py b/components/tools/OmeroPy/test/integration/test_rawpixelsstore.py index 542324e30f4..970b77d7f67 100644 --- a/components/tools/OmeroPy/test/integration/test_rawpixelsstore.py +++ b/components/tools/OmeroPy/test/integration/test_rawpixelsstore.py @@ -11,7 +11,6 @@ from builtins import hex from builtins import range -from past.utils import old_div import omero import threading from omero.testlib import ITest @@ -123,7 +122,7 @@ def testRomioToPyramid(self, tmpdir): success = True except omero.MissingPyramidException as mpm: assert int(pix) == mpm.pixelsID - backOff = old_div(mpm.backOff, 1000) + backOff = mpm.backOff / 1000 event = concurrency.get_event("testRomio") event.wait(backOff) # seconds i -= 1 @@ -158,7 +157,7 @@ def test2RomioToPyramidWithNegOne(self, tmpdir): success = True except omero.MissingPyramidException as mpm: assert int(pix) == mpm.pixelsID - backOff = old_div(mpm.backOff, 1000) + backOff = mpm.backOff / 1000 event = concurrency.get_event("testRomio") event.wait(backOff) # seconds i -= 1 @@ -192,7 +191,7 @@ def testPyramidConcurrentAccess(self, tmpdir): success = True except omero.MissingPyramidException as mpm: assert int(pix) == mpm.pixelsID - backOff = old_div(mpm.backOff, 1000) + backOff = mpm.backOff / 1000 event = concurrency.get_event("testRomio") event.wait(backOff) # seconds i -= 1 @@ -277,7 +276,7 @@ def f(x, y): """ create some fake pixel data tile (2D numpy array) """ - return old_div((x * y), (1 + x + y)) + return (x * y) // (1 + x + y) def mktile(w, h): tile = fromfunction(f, (w, h)) diff --git a/components/tools/OmeroPy/test/integration/test_reporawfilestore.py b/components/tools/OmeroPy/test/integration/test_reporawfilestore.py index 4365cec3c13..3ef270cb53f 100644 --- a/components/tools/OmeroPy/test/integration/test_reporawfilestore.py +++ b/components/tools/OmeroPy/test/integration/test_reporawfilestore.py @@ -15,7 +15,6 @@ """ -from past.utils import old_div import pytest import omero import omero.gateway @@ -34,7 +33,7 @@ def setup_method(self, method): super(TestRepoRawFileStore, self).setup_method(method) tmp_dir = path(self.unique_dir) self.repoPrx = self.get_managed_repo() - self.repo_filename = old_div(tmp_dir, self.uuid()) + ".txt" + self.repo_filename = tmp_dir / self.uuid() + ".txt" def testCreate(self): rfs = self.repoPrx.file(self.repo_filename, "rw") diff --git a/components/tools/OmeroPy/test/integration/test_repository.py b/components/tools/OmeroPy/test/integration/test_repository.py index 3e0107d39f2..b271ee2886f 100644 --- a/components/tools/OmeroPy/test/integration/test_repository.py +++ b/components/tools/OmeroPy/test/integration/test_repository.py @@ -12,7 +12,6 @@ from builtins import zip from builtins import str from builtins import range -from past.utils import old_div from builtins import object import pytest @@ -595,7 +594,7 @@ def testImport(self): folder = create_path(folder=True) for x in range(200): name = "%s.unknown" % x - (old_div(folder, name)).touch() + (folder / name).touch() paths = folder.files() proc = mrepo.importPaths(paths) hashes = self.upload_folder(proc, folder) diff --git a/components/tools/OmeroPy/test/integration/test_scripts.py b/components/tools/OmeroPy/test/integration/test_scripts.py index 4ae26a42d39..2a34a0123ee 100644 --- a/components/tools/OmeroPy/test/integration/test_scripts.py +++ b/components/tools/OmeroPy/test/integration/test_scripts.py @@ -11,7 +11,6 @@ from builtins import str from builtins import range -from past.utils import old_div import os import time import pytest @@ -417,7 +416,7 @@ def testParamLoadingPerformanceTicket2285(self): impl = omero.processor.usermode_processor(root_client) try: params_time, params = self.timeit(svc.getParams, scriptID) - assert params_time < (old_div(upload_time, 10)), \ + assert params_time < (upload_time / 10), \ "upload_time(%s) <= 10 * params_time(%s)!" % \ (upload_time, params_time) assert params_time < 0.1, "params_time(%s) >= 0.01 !" % params_time diff --git a/components/tools/OmeroWeb/test/integration/test_plategrid.py b/components/tools/OmeroWeb/test/integration/test_plategrid.py index eed93f1b041..a7e960ccc31 100644 --- a/components/tools/OmeroWeb/test/integration/test_plategrid.py +++ b/components/tools/OmeroWeb/test/integration/test_plategrid.py @@ -13,7 +13,6 @@ from builtins import str from builtins import range from builtins import object -from past.utils import old_div import pytest from omeroweb.testlib import IWebTest @@ -172,7 +171,7 @@ def plate_wells_with_acq_date(itest, well_grid_factory, update_service): plate.addWell(well) plate = update_service.saveAndReturnObject(plate) return {'plate': plate, - 'acq_date': int(old_div(acq_date, 1000))} + 'acq_date': int(acq_date / 1000)} @pytest.fixture() @@ -192,7 +191,7 @@ def plate_wells_with_no_acq_date(itest, well_grid_factory, update_service, image = plate.copyWells()[0].copyWellSamples()[0].image creation_date = image.details.creationEvent.time return {'plate': plate, - 'creation_date': old_div(creation_date.val, 1000)} + 'creation_date': creation_date.val // 1000} @pytest.fixture() diff --git a/components/tools/OmeroWeb/test/integration/test_show.py b/components/tools/OmeroWeb/test/integration/test_show.py index fbda1991504..17f8e6749e7 100644 --- a/components/tools/OmeroWeb/test/integration/test_show.py +++ b/components/tools/OmeroWeb/test/integration/test_show.py @@ -11,7 +11,6 @@ from builtins import str from builtins import range -from past.utils import old_div import omero import omero.clients import pytest @@ -1374,7 +1373,7 @@ def test_project_dataset_images_pagination(self, project_dataset_images): {'type': 'project', 'id': project.id.val}, {'type': 'dataset', 'childIndex': imgIndex, 'id': dataset.id.val, - 'childPage': (old_div(imgIndex, page_size)) + 1, + 'childPage': (imgIndex // page_size) + 1, 'childCount': len(iids)}, {'type': 'image', 'id': iid}]] assert paths == expected @@ -1395,7 +1394,7 @@ def test_orphaned_pagination(self, images): [{'type': 'experimenter', 'id': ownerId}, {'type': 'orphaned', 'id': ownerId, 'childIndex': imgIndex, - 'childPage': (old_div(imgIndex, page_size)) + 1, + 'childPage': (imgIndex // page_size) + 1, 'childCount': len(iids)}, {'type': 'image', 'id': iid}]] assert paths == expected diff --git a/components/tools/OmeroWeb/test/integration/test_tree_annotations.py b/components/tools/OmeroWeb/test/integration/test_tree_annotations.py index 0acf4a5dc43..e7e911808b4 100644 --- a/components/tools/OmeroWeb/test/integration/test_tree_annotations.py +++ b/components/tools/OmeroWeb/test/integration/test_tree_annotations.py @@ -22,7 +22,6 @@ """ from builtins import zip -from past.utils import old_div import pytest import pytz from omero.testlib import ITest @@ -162,7 +161,7 @@ def annotate_project(ann, project, user): def expected_date(time): - d = datetime.fromtimestamp(old_div(time, 1000)) + d = datetime.fromtimestamp(time / 1000) # Add time-zone awareness. Use default TIME_ZONE setting tz = pytz.timezone("Europe/London") d = tz.localize(d) diff --git a/examples/Training/python/Create_Image.py b/examples/Training/python/Create_Image.py index 9a43649e7c6..3f97428a00a 100755 --- a/examples/Training/python/Create_Image.py +++ b/examples/Training/python/Create_Image.py @@ -12,7 +12,6 @@ """ from builtins import range -from past.utils import old_div from omero.gateway import BlitzGateway from Parse_OMERO_Properties import USERNAME, PASSWORD, HOST, PORT from Parse_OMERO_Properties import imageId @@ -103,7 +102,7 @@ def plane_gen(): # Here we can manipulate the data in many different ways. As # an example we are doing "average" # average of 2 channels - new_plane = old_div((channel0 + channel1), 2) + new_plane = (channel0 + channel1) // 2 print("newPlane for z,t:", z, t, new_plane.dtype, new_plane.min(), new_plane.max()) yield new_plane diff --git a/examples/Training/python/ROIs.py b/examples/Training/python/ROIs.py index d655bc510f0..2eda1244d23 100755 --- a/examples/Training/python/ROIs.py +++ b/examples/Training/python/ROIs.py @@ -13,7 +13,6 @@ from builtins import str from builtins import range -from past.utils import old_div import numpy import struct import math @@ -49,7 +48,7 @@ width = 100 height = 50 image = conn.getObject("Image", imageId) -z = old_div(image.getSizeZ(), 2) +z = image.getSizeZ() // 2 t = 0 @@ -126,7 +125,7 @@ def create_mask(mask_bytes, bytes_per_pixel=1): else: message = "Format %s not supported" raise ValueError(message) - steps = math.ceil(old_div(len(mask_bytes), divider)) + steps = math.ceil(len(mask_bytes) / divider) mask = [] for i in range(int(steps)): binary = mask_bytes[ diff --git a/examples/Training/python/Raw_Data_Access.py b/examples/Training/python/Raw_Data_Access.py index 93744039ce0..c0f98d137f8 100755 --- a/examples/Training/python/Raw_Data_Access.py +++ b/examples/Training/python/Raw_Data_Access.py @@ -12,7 +12,6 @@ """ from builtins import range -from past.utils import old_div from omero.gateway import BlitzGateway from Parse_OMERO_Properties import USERNAME, PASSWORD, HOST, PORT from Parse_OMERO_Properties import imageId @@ -72,7 +71,7 @@ # ========================== zct_list = [] # get the top half of the Z-stack -for z in range(old_div(size_z, 2), size_z): +for z in range(size_z // 2, size_z): for c in range(size_c): # all channels for t in range(size_t): # all time-points zct_list.append((z, c, t)) diff --git a/examples/Training/python/Render_Images.py b/examples/Training/python/Render_Images.py index 22b8922b75a..3fd0301ad40 100644 --- a/examples/Training/python/Render_Images.py +++ b/examples/Training/python/Render_Images.py @@ -12,7 +12,6 @@ """ from builtins import range -from past.utils import old_div from omero.gateway import BlitzGateway from io import BytesIO try: @@ -69,7 +68,7 @@ # ================================================= image.setGreyscaleRenderingModel() size_c = image.getSizeC() -z = old_div(image.getSizeZ(), 2) +z = image.getSizeZ() // 2 t = 0 for c in range(1, size_c + 1): # Channel index starts at 1 channels = [c] # Turn on a single channel at a time From 875c25fd7fbe0d84cbcb8310c2edc57a2608c814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Besson?= Date: Sat, 20 Jan 2024 12:09:02 +0000 Subject: [PATCH 07/16] Replace usage of past.builtins.execfile by exec --- examples/Training/python/__main__.py | 45 ++++++++++++++-------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/examples/Training/python/__main__.py b/examples/Training/python/__main__.py index 7ea3baf026a..ff09529b38c 100755 --- a/examples/Training/python/__main__.py +++ b/examples/Training/python/__main__.py @@ -7,32 +7,31 @@ # Use is subject to license terms supplied in LICENSE.txt # -from past.builtins import execfile import os training_dir = os.path.dirname(os.path.abspath(__file__)) if __name__ == "__main__": print("Running training suite") - execfile(os.path.join(training_dir, 'Bulk_Shapes.py')) - execfile(os.path.join(training_dir, 'Connect_To_OMERO.py')) - execfile(os.path.join(training_dir, 'Create_Image.py')) - execfile(os.path.join(training_dir, 'Delete.py')) - execfile(os.path.join(training_dir, 'Filesets.py')) - execfile(os.path.join(training_dir, 'Groups_Permissions.py')) - execfile(os.path.join(training_dir, 'Metadata.py')) - execfile(os.path.join(training_dir, 'Raw_Data_Access.py')) - execfile(os.path.join(training_dir, 'Read_Data.py')) - execfile(os.path.join(training_dir, 'Render_Images.py')) - execfile(os.path.join(training_dir, 'ROIs.py')) - execfile(os.path.join(training_dir, 'Tables.py')) - execfile(os.path.join(training_dir, 'Write_Data.py')) - execfile(os.path.join(training_dir, + exec(os.path.join(training_dir, 'Bulk_Shapes.py')) + exec(os.path.join(training_dir, 'Connect_To_OMERO.py')) + exec(os.path.join(training_dir, 'Create_Image.py')) + exec(os.path.join(training_dir, 'Delete.py')) + exec(os.path.join(training_dir, 'Filesets.py')) + exec(os.path.join(training_dir, 'Groups_Permissions.py')) + exec(os.path.join(training_dir, 'Metadata.py')) + exec(os.path.join(training_dir, 'Raw_Data_Access.py')) + exec(os.path.join(training_dir, 'Read_Data.py')) + exec(os.path.join(training_dir, 'Render_Images.py')) + exec(os.path.join(training_dir, 'ROIs.py')) + exec(os.path.join(training_dir, 'Tables.py')) + exec(os.path.join(training_dir, 'Write_Data.py')) + exec(os.path.join(training_dir, 'Advanced/Create_Image_advanced.py')) - execfile(os.path.join(training_dir, 'Advanced/Raw_Data_advanced.py')) - execfile(os.path.join(training_dir, 'Advanced/Read_Data_advanced.py')) - execfile(os.path.join(training_dir, 'Advanced/Write_data_advanced.py')) - execfile(os.path.join(training_dir, 'Task_Scripts/Raw_Data2.py')) - execfile(os.path.join(training_dir, 'Task_Scripts/Raw_Data_Task.py')) - execfile(os.path.join(training_dir, 'Task_Scripts/Write_Data_4.py')) - execfile(os.path.join(training_dir, 'Task_Scripts/Write_Data_3.py')) - execfile(os.path.join(training_dir, 'Json_Api/Login.py')) + exec(os.path.join(training_dir, 'Advanced/Raw_Data_advanced.py')) + exec(os.path.join(training_dir, 'Advanced/Read_Data_advanced.py')) + exec(os.path.join(training_dir, 'Advanced/Write_data_advanced.py')) + exec(os.path.join(training_dir, 'Task_Scripts/Raw_Data2.py')) + exec(os.path.join(training_dir, 'Task_Scripts/Raw_Data_Task.py')) + exec(os.path.join(training_dir, 'Task_Scripts/Write_Data_4.py')) + exec(os.path.join(training_dir, 'Task_Scripts/Write_Data_3.py')) + exec(os.path.join(training_dir, 'Json_Api/Login.py')) From 8f6bbb7ed9a49c0992a0aab463303a95aee4f9a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Besson?= Date: Sat, 20 Jan 2024 14:09:50 +0000 Subject: [PATCH 08/16] Replace all usages of past.builtins.basestring by str --- components/tools/OmeroPy/test/integration/test_chmod.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/components/tools/OmeroPy/test/integration/test_chmod.py b/components/tools/OmeroPy/test/integration/test_chmod.py index 89d2c2429af..8dda6bb9eb3 100644 --- a/components/tools/OmeroPy/test/integration/test_chmod.py +++ b/components/tools/OmeroPy/test/integration/test_chmod.py @@ -25,7 +25,6 @@ """ from builtins import str -from past.builtins import basestring import time from omero.testlib import ITest import omero @@ -47,8 +46,8 @@ def refresh(self, client): client.sf.getAdminService().getEventContext() # Refresh def assertEqPerms(self, a, b): - assert isinstance(a, (omero.model.PermissionsI, basestring)) - assert isinstance(b, (omero.model.PermissionsI, basestring)) + assert isinstance(a, (omero.model.PermissionsI, str)) + assert isinstance(b, (omero.model.PermissionsI, str)) assert str(a) == str(b) def addData(self): From 9b1810491b8b8f3c1e1a47c4a430cd08fe0ce13e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Besson?= Date: Sat, 20 Jan 2024 14:11:14 +0000 Subject: [PATCH 09/16] Replace all usages of past.builtins.long --- .../tools/OmeroPy/test/integration/clitest/test_metadata.py | 3 +-- .../tools/OmeroPy/test/integration/scriptstest/test_inputs.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/components/tools/OmeroPy/test/integration/clitest/test_metadata.py b/components/tools/OmeroPy/test/integration/clitest/test_metadata.py index e128133826e..c4d860e3eb4 100644 --- a/components/tools/OmeroPy/test/integration/clitest/test_metadata.py +++ b/components/tools/OmeroPy/test/integration/clitest/test_metadata.py @@ -29,7 +29,6 @@ from omero.rtypes import rdouble, unwrap from omero.testlib.cli import CLITest from omero.model.enums import UnitsLength -from past.builtins import long with warnings.catch_warnings(): warnings.simplefilter("ignore") @@ -47,7 +46,7 @@ def setup_method(self, method): conn = BlitzGateway(client_obj=self.client) self.imageid = unwrap(self.image.getId()) - assert type(self.imageid) is long + assert type(self.imageid) is int wrapper = conn.getObject("Image", self.imageid) self.md = Metadata(wrapper) diff --git a/components/tools/OmeroPy/test/integration/scriptstest/test_inputs.py b/components/tools/OmeroPy/test/integration/scriptstest/test_inputs.py index f7994eb7e73..3e386640ef0 100644 --- a/components/tools/OmeroPy/test/integration/scriptstest/test_inputs.py +++ b/components/tools/OmeroPy/test/integration/scriptstest/test_inputs.py @@ -36,7 +36,6 @@ # Setup to run as an integration test import os import sys -from past.builtins import long import omero.scripts as s import omero.util.script_utils as su @@ -61,7 +60,7 @@ raise Exception("Failed!") a = inputs["a"] - if not isinstance(a, (int, long)): + if not isinstance(a, int): raise Exception("Failed!") b = inputs.get("b") From 792913ef9eb0b8dd0fda366e90686c3d03801ee8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Besson?= Date: Sat, 20 Jan 2024 14:23:09 +0000 Subject: [PATCH 10/16] Review and cleanup all codepaths handling Python 2 --- components/tools/OmeroFS/test/drivers.py | 6 +----- .../OmeroPy/test/integration/clitest/test_admin.py | 6 +----- .../test/integration/clitest/test_download.py | 6 ------ .../test/integration/clitest/test_import.py | 9 ++------- .../test/integration/clitest/test_import_bulk.py | 9 ++------- .../integration/gatewaytest/test_annotation.py | 5 ----- .../test/integration/gatewaytest/test_fs.py | 5 ----- .../integration/gatewaytest/test_get_objects.py | 5 ----- .../test/integration/gatewaytest/test_helpers.py | 10 +--------- .../integration/gatewaytest/test_image_wrapper.py | 5 ----- .../integration/gatewaytest/test_multi_group.py | 6 ------ .../integration/gatewaytest/test_plate_wrapper.py | 5 ----- .../metadata/test_metadata_mapannotations.py | 4 ---- .../test/integration/metadata/test_populate.py | 10 ---------- .../test/integration/metadata/test_pydict_text.py | 4 ---- .../test/integration/tablestest/test_service.py | 6 +----- .../tools/OmeroPy/test/integration/test_ishare.py | 6 ------ .../OmeroPy/test/integration/test_itimeline.py | 6 ------ .../OmeroPy/test/integration/test_permissions.py | 11 ++--------- .../test/integration/test_rawpixelsstore.py | 14 +------------- .../tools/OmeroPy/test/integration/test_render.py | 6 ------ .../test/integration/test_reporawfilestore.py | 6 +----- .../tools/OmeroPy/test/integration/test_scripts.py | 5 ----- .../tools/OmeroPy/test/integration/test_thumbs.py | 6 ------ .../OmeroPy/test/integration/test_tickets2000.py | 6 ------ 25 files changed, 12 insertions(+), 155 deletions(-) diff --git a/components/tools/OmeroFS/test/drivers.py b/components/tools/OmeroFS/test/drivers.py index a107208dad1..73d972cca56 100644 --- a/components/tools/OmeroFS/test/drivers.py +++ b/components/tools/OmeroFS/test/drivers.py @@ -20,11 +20,7 @@ import omero.grid.monitors as monitors -try: - from omero_ext.path import path -except ImportError: - # Python 2 - from path import path +from omero_ext.path import path from omero.util import ServerContext from functools import wraps from omero.util.temp_files import create_path diff --git a/components/tools/OmeroPy/test/integration/clitest/test_admin.py b/components/tools/OmeroPy/test/integration/clitest/test_admin.py index 2311731de44..258d9ae62da 100644 --- a/components/tools/OmeroPy/test/integration/clitest/test_admin.py +++ b/components/tools/OmeroPy/test/integration/clitest/test_admin.py @@ -28,11 +28,7 @@ from omero.testlib.cli import RootCLITest import omero.plugins.admin from omero.cli import NonZeroReturnCode -try: - from omero_ext.path import path -except ImportError: - # Python 2 - from path import path +from omero_ext.path import path from omero.util.upgrade_check import UpgradeCheck OMERODIR = os.getenv('OMERODIR', None) diff --git a/components/tools/OmeroPy/test/integration/clitest/test_download.py b/components/tools/OmeroPy/test/integration/clitest/test_download.py index 91afa8163e8..c5a9d92f87a 100644 --- a/components/tools/OmeroPy/test/integration/clitest/test_download.py +++ b/components/tools/OmeroPy/test/integration/clitest/test_download.py @@ -33,12 +33,6 @@ from omero.model import NamedValue as NV from omero.util.temp_files import create_path -try: - int -except Exception: - # Python 3 - long = int - class TestDownload(CLITest): diff --git a/components/tools/OmeroPy/test/integration/clitest/test_import.py b/components/tools/OmeroPy/test/integration/clitest/test_import.py index 828bfb63e43..210e6f5e099 100644 --- a/components/tools/OmeroPy/test/integration/clitest/test_import.py +++ b/components/tools/OmeroPy/test/integration/clitest/test_import.py @@ -29,13 +29,8 @@ import omero from omero.cli import NonZeroReturnCode from omero.rtypes import rstring -try: - plugin = __import__('omero.plugins.import', globals(), locals(), - ['ImportControl'], -1) -except ValueError: - # Python 3 - plugin = __import__('omero.plugins.import', globals(), locals(), - ['ImportControl'], 0) +plugin = __import__('omero.plugins.import', globals(), locals(), + ['ImportControl'], 0) ImportControl = plugin.ImportControl diff --git a/components/tools/OmeroPy/test/integration/clitest/test_import_bulk.py b/components/tools/OmeroPy/test/integration/clitest/test_import_bulk.py index c07f6d5229b..e1ed77e96b7 100644 --- a/components/tools/OmeroPy/test/integration/clitest/test_import_bulk.py +++ b/components/tools/OmeroPy/test/integration/clitest/test_import_bulk.py @@ -26,13 +26,8 @@ import re import subprocess -try: - plugin = __import__('omero.plugins.import', globals(), locals(), - ['ImportControl'], -1) -except ValueError: - # Python 3 - plugin = __import__('omero.plugins.import', globals(), locals(), - ['ImportControl'], 0) +plugin = __import__('omero.plugins.import', globals(), locals(), + ['ImportControl'], 0) ImportControl = plugin.ImportControl diff --git a/components/tools/OmeroPy/test/integration/gatewaytest/test_annotation.py b/components/tools/OmeroPy/test/integration/gatewaytest/test_annotation.py index ebbd9db45f0..0384361b78c 100644 --- a/components/tools/OmeroPy/test/integration/gatewaytest/test_annotation.py +++ b/components/tools/OmeroPy/test/integration/gatewaytest/test_annotation.py @@ -23,11 +23,6 @@ import omero.gateway from omero.rtypes import rstring from omero.gateway import FileAnnotationWrapper -try: - int -except Exception: - # Python 3 - long = int def _testAnnotation(obj, annclass, ns, value, sameOwner=False, diff --git a/components/tools/OmeroPy/test/integration/gatewaytest/test_fs.py b/components/tools/OmeroPy/test/integration/gatewaytest/test_fs.py index a0ff7e0e662..0c3ffb3828c 100644 --- a/components/tools/OmeroPy/test/integration/gatewaytest/test_fs.py +++ b/components/tools/OmeroPy/test/integration/gatewaytest/test_fs.py @@ -37,11 +37,6 @@ LongAnnotationI from omero.rtypes import rstring, rlong, rint, rtime from uuid import uuid4 -try: - int -except Exception: - # Python 3 - long = int def uuid(): diff --git a/components/tools/OmeroPy/test/integration/gatewaytest/test_get_objects.py b/components/tools/OmeroPy/test/integration/gatewaytest/test_get_objects.py index 98d521a993b..2e2d5b8cc6e 100644 --- a/components/tools/OmeroPy/test/integration/gatewaytest/test_get_objects.py +++ b/components/tools/OmeroPy/test/integration/gatewaytest/test_get_objects.py @@ -32,11 +32,6 @@ ScreenI, \ WellI, \ WellSampleI -try: - int -except Exception: - # Python 3 - long = int class TestDeleteObject (object): diff --git a/components/tools/OmeroPy/test/integration/gatewaytest/test_helpers.py b/components/tools/OmeroPy/test/integration/gatewaytest/test_helpers.py index ef54df5d95c..6350e01a0ec 100644 --- a/components/tools/OmeroPy/test/integration/gatewaytest/test_helpers.py +++ b/components/tools/OmeroPy/test/integration/gatewaytest/test_helpers.py @@ -10,11 +10,6 @@ from builtins import object import omero import omero.gateway -try: - long # noqa -except Exception: - # Python 3 - long = int class TestHelperObjects(object): @@ -43,10 +38,7 @@ def testOmeroType(self): assert isinstance(omero_type('rstring'), omero.RString) assert isinstance(omero_type(u'rstring'), omero.RString) assert isinstance(omero_type(1), omero.RInt) - if sys.version_info[0] < 3: - assert isinstance(omero_type(long(1)), omero.RLong) - else: - assert isinstance(omero_type(long(1)), omero.RInt) + assert isinstance(omero_type(int(1)), omero.RInt) assert isinstance(omero_type(int(1)), omero.RInt) assert isinstance(omero_type(False), omero.RBool) assert isinstance(omero_type(True), omero.RBool) diff --git a/components/tools/OmeroPy/test/integration/gatewaytest/test_image_wrapper.py b/components/tools/OmeroPy/test/integration/gatewaytest/test_image_wrapper.py index c146c8151f9..02a173a4875 100644 --- a/components/tools/OmeroPy/test/integration/gatewaytest/test_image_wrapper.py +++ b/components/tools/OmeroPy/test/integration/gatewaytest/test_image_wrapper.py @@ -21,11 +21,6 @@ from omero.model import ImageI, ChannelI, LogicalChannelI, LengthI from omero.rtypes import rstring, rtime from datetime import datetime -try: - int -except Exception: - # Python 3 - long = int @pytest.fixture(scope='module') diff --git a/components/tools/OmeroPy/test/integration/gatewaytest/test_multi_group.py b/components/tools/OmeroPy/test/integration/gatewaytest/test_multi_group.py index 26aec916d99..43c914215e2 100644 --- a/components/tools/OmeroPy/test/integration/gatewaytest/test_multi_group.py +++ b/components/tools/OmeroPy/test/integration/gatewaytest/test_multi_group.py @@ -21,12 +21,6 @@ import time import pytest -try: - int -except Exception: - # Python 3 - long = int - PRIVATE = 'rw----' READONLY = 'rwr---' READANN = 'rwra--' diff --git a/components/tools/OmeroPy/test/integration/gatewaytest/test_plate_wrapper.py b/components/tools/OmeroPy/test/integration/gatewaytest/test_plate_wrapper.py index 0c271023a02..c292dc37aeb 100644 --- a/components/tools/OmeroPy/test/integration/gatewaytest/test_plate_wrapper.py +++ b/components/tools/OmeroPy/test/integration/gatewaytest/test_plate_wrapper.py @@ -21,11 +21,6 @@ from omero.model import PlateI, WellI, WellSampleI, ImageI from omero.rtypes import rstring, rint, rtime from uuid import uuid4 -try: - int -except Exception: - # Python 3 - long = int def uuid(): diff --git a/components/tools/OmeroPy/test/integration/metadata/test_metadata_mapannotations.py b/components/tools/OmeroPy/test/integration/metadata/test_metadata_mapannotations.py index a64c5cf6e39..a58f7fbcc4b 100644 --- a/components/tools/OmeroPy/test/integration/metadata/test_metadata_mapannotations.py +++ b/components/tools/OmeroPy/test/integration/metadata/test_metadata_mapannotations.py @@ -32,9 +32,6 @@ import pytest import sys -pythonminver = pytest.mark.skipif(sys.version_info < (2, 7), - reason="requires python2.7") - def assert_equal_map_value(mva, mvb): assert len(mva) == len(mvb) @@ -45,7 +42,6 @@ def assert_equal_map_value(mva, mvb): assert a.value == b.value -@pythonminver class TestMapAnnotationManager(ITest): def create_mas(self): diff --git a/components/tools/OmeroPy/test/integration/metadata/test_populate.py b/components/tools/OmeroPy/test/integration/metadata/test_populate.py index 3b9bb61692a..460f82fe683 100644 --- a/components/tools/OmeroPy/test/integration/metadata/test_populate.py +++ b/components/tools/OmeroPy/test/integration/metadata/test_populate.py @@ -70,9 +70,6 @@ MAPR_NS_GENE = 'openmicroscopy.org/mapr/gene' -pythonminver = mark.skipif(sys.version_info < (2, 7), - reason="requires python2.7") - def coord2offset(coord): """ @@ -867,7 +864,6 @@ def assert_child_annotations(self, oas): raise Exception("Unknown dataset: %s" % ds) -@pythonminver class TestPopulateMetadataConfigLoad(ITest): def get_cfg_filepath(self): @@ -892,7 +888,6 @@ def test_get_config_remote(self): self._assert_configs(default_cfg, column_cfgs, advanced_cfgs) -@pythonminver class TestPopulateMetadataHelper(ITest): def _test_parsing_context(self, fixture, batch_size): @@ -985,7 +980,6 @@ def _test_delete_map_annotation_context(self, fixture, batch_size): assert len(fixture.get_all_map_annotations()) == 0 -@pythonminver class TestPopulateMetadataHelperPerMethod(TestPopulateMetadataHelper): # Some tests in this file check the counts of annotations in a fixed @@ -1004,7 +998,6 @@ def teardown_method(self, method): super(TestPopulateMetadataHelperPerMethod, self).teardown_class() -@pythonminver class TestPopulateMetadata(TestPopulateMetadataHelper): METADATA_FIXTURES = ( @@ -1082,7 +1075,6 @@ def testPopulateMetadataNsAnnsFail(self): self._test_bulk_to_map_annotation_context(fixture_fail, 2) -@pythonminver class TestPopulateMetadataDedup(TestPopulateMetadataHelperPerMethod): # Hard-code the number of expected map-annotations in these tests @@ -1236,7 +1228,6 @@ def testPopulateMetadataNsAnnsDedupDelete(self, ns): fixture1, fixture2, ns) -@pythonminver class TestPopulateMetadataConfigFiles(TestPopulateMetadataHelperPerMethod): def _init_fixture_attach_cfg(self): @@ -1425,7 +1416,6 @@ def get_target(self): return self.plate -@pythonminver class TestPopulateRois(ITest): def testPopulateRoisPlate(self): diff --git a/components/tools/OmeroPy/test/integration/metadata/test_pydict_text.py b/components/tools/OmeroPy/test/integration/metadata/test_pydict_text.py index 416ab520f46..eebb53f3e03 100644 --- a/components/tools/OmeroPy/test/integration/metadata/test_pydict_text.py +++ b/components/tools/OmeroPy/test/integration/metadata/test_pydict_text.py @@ -31,11 +31,7 @@ import pytest import sys -pythonminver = pytest.mark.skipif(sys.version_info < (2, 7), - reason="requires python2.7") - -@pythonminver class TestPydictTextIo(ITest): def getTestJson(self): diff --git a/components/tools/OmeroPy/test/integration/tablestest/test_service.py b/components/tools/OmeroPy/test/integration/tablestest/test_service.py index e61c5aa4990..03dbc36aa1f 100755 --- a/components/tools/OmeroPy/test/integration/tablestest/test_service.py +++ b/components/tools/OmeroPy/test/integration/tablestest/test_service.py @@ -25,11 +25,7 @@ """ from builtins import str from builtins import range -try: - from omero_ext.path import path -except ImportError: - # Python 2 - from path import path +from omero_ext.path import path import omero import omero.tables from omero.testlib import ITest diff --git a/components/tools/OmeroPy/test/integration/test_ishare.py b/components/tools/OmeroPy/test/integration/test_ishare.py index bae3084b53a..8b2d044f409 100644 --- a/components/tools/OmeroPy/test/integration/test_ishare.py +++ b/components/tools/OmeroPy/test/integration/test_ishare.py @@ -18,12 +18,6 @@ from omero.rtypes import rtime, rlong, rlist, rint from omero.gateway import BlitzGateway -try: - int -except Exception: - # Python 3 - long = int - class TestIShare(ITest): diff --git a/components/tools/OmeroPy/test/integration/test_itimeline.py b/components/tools/OmeroPy/test/integration/test_itimeline.py index d54091d0cad..1824bb012a6 100644 --- a/components/tools/OmeroPy/test/integration/test_itimeline.py +++ b/components/tools/OmeroPy/test/integration/test_itimeline.py @@ -17,12 +17,6 @@ from omero.rtypes import rint, rlong, rstring, rtime -try: - int -except Exception: - # Python 3 - long = int - class TestITimeline(ITest): diff --git a/components/tools/OmeroPy/test/integration/test_permissions.py b/components/tools/OmeroPy/test/integration/test_permissions.py index 0db42c5de9b..db2bd3f62f6 100644 --- a/components/tools/OmeroPy/test/integration/test_permissions.py +++ b/components/tools/OmeroPy/test/integration/test_permissions.py @@ -37,13 +37,6 @@ from omero.rtypes import rbool, rstring, unwrap -try: - int -except Exception: - # Python 3 - long = int - - class CallContextFixture(object): """ @@ -418,11 +411,11 @@ def setOwnersOfGroup(self, available, owners): rm_exps = list() for om in old_owners: for a in available: - if om.id == long(str(a)): + if om.id == int(str(a)): rm_exps.append(om._obj) for oa in old_available: for o in owners: - if oa.id == long(str(o)): + if oa.id == int(str(o)): add_exps.append(oa._obj) #final save diff --git a/components/tools/OmeroPy/test/integration/test_rawpixelsstore.py b/components/tools/OmeroPy/test/integration/test_rawpixelsstore.py index 970b77d7f67..f8534e0f267 100644 --- a/components/tools/OmeroPy/test/integration/test_rawpixelsstore.py +++ b/components/tools/OmeroPy/test/integration/test_rawpixelsstore.py @@ -18,11 +18,6 @@ from omero.util.tiles import TileLoopIteration from omero.util.tiles import RPSTileLoop -try: - int -except Exception: - # Python 3 - long = int __import__("sys") @@ -36,12 +31,7 @@ def check_pix(self, pix): try: rps.setPixelsId(pix.id.val, True) md = rps.calculateMessageDigest() - try: - # python 3 - sha1 = format(int.from_bytes(md, 'big'), 'x') - except Exception: - # python 2 - sha1 = hex(int(md.encode('hex'), 16))[2:] + sha1 = format(int.from_bytes(md, 'big'), 'x') sha1 = sha1.rjust(40, "0") assert sha1 == pix.sha1.val finally: @@ -237,8 +227,6 @@ def run(self): class TestTiles(ITest): - @pytest.mark.skipif("sys.version_info < (2,7)", - reason="This fails with Python < 2.7 and Ice >= 3.5") def testTiles(self): from omero.model import PixelsI from omero.sys import ParametersI diff --git a/components/tools/OmeroPy/test/integration/test_render.py b/components/tools/OmeroPy/test/integration/test_render.py index 70a3da92b66..c12570d2d50 100644 --- a/components/tools/OmeroPy/test/integration/test_render.py +++ b/components/tools/OmeroPy/test/integration/test_render.py @@ -38,12 +38,6 @@ except Exception: logging.error('No Pillow installed') -try: - int -except Exception: - # Python 3 - long = int - from numpy import asarray, array_equal diff --git a/components/tools/OmeroPy/test/integration/test_reporawfilestore.py b/components/tools/OmeroPy/test/integration/test_reporawfilestore.py index 3ef270cb53f..6ce94e83bd7 100644 --- a/components/tools/OmeroPy/test/integration/test_reporawfilestore.py +++ b/components/tools/OmeroPy/test/integration/test_reporawfilestore.py @@ -19,11 +19,7 @@ import omero import omero.gateway -try: - from omero_ext.path import path -except ImportError: - # Python 2 - from path import path +from omero_ext.path import path from omero.testlib import AbstractRepoTest diff --git a/components/tools/OmeroPy/test/integration/test_scripts.py b/components/tools/OmeroPy/test/integration/test_scripts.py index 2a34a0123ee..14ad7845607 100644 --- a/components/tools/OmeroPy/test/integration/test_scripts.py +++ b/components/tools/OmeroPy/test/integration/test_scripts.py @@ -25,11 +25,6 @@ from omero.rtypes import rstring, wrap, unwrap from omero.util.temp_files import create_path -try: - int -except Exception: - # Python 3 - long = int PUBLIC = omero.model.PermissionsI("rwrwrw") diff --git a/components/tools/OmeroPy/test/integration/test_thumbs.py b/components/tools/OmeroPy/test/integration/test_thumbs.py index f15b29efbe2..eaf06ce9cd9 100644 --- a/components/tools/OmeroPy/test/integration/test_thumbs.py +++ b/components/tools/OmeroPy/test/integration/test_thumbs.py @@ -18,12 +18,6 @@ from omero.util.concurrency import get_event from omero.rtypes import rint, unwrap -try: - int -except Exception: - # Python 3 - long = int - class TestThumbs(ITest): diff --git a/components/tools/OmeroPy/test/integration/test_tickets2000.py b/components/tools/OmeroPy/test/integration/test_tickets2000.py index 255123113cb..fe4268af951 100644 --- a/components/tools/OmeroPy/test/integration/test_tickets2000.py +++ b/components/tools/OmeroPy/test/integration/test_tickets2000.py @@ -21,12 +21,6 @@ from omero_model_ExperimenterI import ExperimenterI from omero_model_ExperimenterGroupI import ExperimenterGroupI -try: - int -except Exception: - # Python 3 - long = int - class TestTickets2000(ITest): From 59d8fbd5c97492089674371f5a7607a084c1ba01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Besson?= Date: Sun, 21 Jan 2024 22:11:14 +0000 Subject: [PATCH 11/16] Remove all unnecessary builtins imports --- build.py | 1 - components/antlib/scripts/parse_version | 2 -- components/tools/OmeroFS/setup.py | 1 - components/tools/OmeroFS/test/drivers.py | 3 --- components/tools/OmeroFS/test/integration/test_dbclient.py | 1 - components/tools/OmeroPy/test/conftest.py | 2 -- components/tools/OmeroPy/test/integration/clitest/cli.py | 1 - .../tools/OmeroPy/test/integration/clitest/test_admin.py | 1 - .../tools/OmeroPy/test/integration/clitest/test_chgrp.py | 1 - .../tools/OmeroPy/test/integration/clitest/test_chown.py | 2 -- components/tools/OmeroPy/test/integration/clitest/test_db.py | 2 -- .../tools/OmeroPy/test/integration/clitest/test_delete.py | 2 -- .../tools/OmeroPy/test/integration/clitest/test_download.py | 2 -- .../tools/OmeroPy/test/integration/clitest/test_group.py | 1 - .../tools/OmeroPy/test/integration/clitest/test_import.py | 3 --- .../OmeroPy/test/integration/clitest/test_import_bulk.py | 1 - .../tools/OmeroPy/test/integration/clitest/test_pyramids.py | 1 - .../tools/OmeroPy/test/integration/clitest/test_script.py | 1 - .../tools/OmeroPy/test/integration/clitest/test_search.py | 1 - .../tools/OmeroPy/test/integration/clitest/test_sessions.py | 1 - components/tools/OmeroPy/test/integration/clitest/test_tag.py | 2 -- .../tools/OmeroPy/test/integration/clitest/test_upload.py | 1 - .../tools/OmeroPy/test/integration/clitest/test_user.py | 1 - .../OmeroPy/test/integration/gatewaytest/test_annotation.py | 2 -- .../tools/OmeroPy/test/integration/gatewaytest/test_chgrp.py | 1 - .../tools/OmeroPy/test/integration/gatewaytest/test_chmod.py | 1 - .../OmeroPy/test/integration/gatewaytest/test_connection.py | 2 -- .../tools/OmeroPy/test/integration/gatewaytest/test_delete.py | 2 -- .../tools/OmeroPy/test/integration/gatewaytest/test_fs.py | 3 --- .../OmeroPy/test/integration/gatewaytest/test_get_objects.py | 3 --- .../OmeroPy/test/integration/gatewaytest/test_helpers.py | 1 - .../tools/OmeroPy/test/integration/gatewaytest/test_image.py | 4 ---- .../test/integration/gatewaytest/test_image_wrapper.py | 2 -- .../test/integration/gatewaytest/test_missing_pyramid.py | 1 - .../OmeroPy/test/integration/gatewaytest/test_multi_group.py | 2 -- .../OmeroPy/test/integration/gatewaytest/test_performance.py | 2 -- .../tools/OmeroPy/test/integration/gatewaytest/test_pixels.py | 3 --- .../test/integration/gatewaytest/test_plate_wrapper.py | 3 --- .../tools/OmeroPy/test/integration/gatewaytest/test_rdefs.py | 2 -- .../test/integration/gatewaytest/test_search_objects.py | 3 --- .../OmeroPy/test/integration/gatewaytest/test_services.py | 2 -- .../OmeroPy/test/integration/gatewaytest/test_ticket10618.py | 1 - .../tools/OmeroPy/test/integration/gatewaytest/test_user.py | 2 -- .../OmeroPy/test/integration/gatewaytest/test_wrapper.py | 2 -- components/tools/OmeroPy/test/integration/helpers.py | 1 - .../test/integration/metadata/test_metadata_mapannotations.py | 1 - .../tools/OmeroPy/test/integration/metadata/test_populate.py | 4 ---- .../OmeroPy/test/integration/metadata/test_pydict_text.py | 1 - .../tools/OmeroPy/test/integration/scriptstest/test_cli.py | 1 - .../tools/OmeroPy/test/integration/scriptstest/test_ping.py | 1 - .../OmeroPy/test/integration/scriptstest/test_script_utils.py | 2 -- .../test/integration/tablestest/test_populate_metadata.py | 1 - .../tools/OmeroPy/test/integration/tablestest/test_service.py | 2 -- components/tools/OmeroPy/test/integration/test_chgrp.py | 1 - components/tools/OmeroPy/test/integration/test_chmod.py | 1 - components/tools/OmeroPy/test/integration/test_cmdcallback.py | 1 - components/tools/OmeroPy/test/integration/test_delete.py | 2 -- components/tools/OmeroPy/test/integration/test_files.py | 1 - components/tools/OmeroPy/test/integration/test_icontainer.py | 2 -- components/tools/OmeroPy/test/integration/test_iquery.py | 1 - components/tools/OmeroPy/test/integration/test_itimeline.py | 1 - components/tools/OmeroPy/test/integration/test_itypes.py | 1 - components/tools/OmeroPy/test/integration/test_iupdate.py | 1 - components/tools/OmeroPy/test/integration/test_mail.py | 1 - .../tools/OmeroPy/test/integration/test_mapannotation.py | 1 - components/tools/OmeroPy/test/integration/test_model51.py | 1 - components/tools/OmeroPy/test/integration/test_permissions.py | 2 -- .../tools/OmeroPy/test/integration/test_rawpixelsstore.py | 2 -- components/tools/OmeroPy/test/integration/test_reimport.py | 2 -- components/tools/OmeroPy/test/integration/test_render.py | 1 - components/tools/OmeroPy/test/integration/test_repository.py | 4 ---- components/tools/OmeroPy/test/integration/test_rois.py | 1 - components/tools/OmeroPy/test/integration/test_scripts.py | 2 -- components/tools/OmeroPy/test/integration/test_simple.py | 1 - components/tools/OmeroPy/test/integration/test_thumbs.py | 1 - components/tools/OmeroPy/test/integration/test_tickets2000.py | 2 -- components/tools/OmeroPy/test/integration/test_tickets3000.py | 2 -- components/tools/OmeroPy/test/integration/test_util.py | 1 - components/tools/OmeroWeb/test/integration/test_annotate.py | 1 - .../tools/OmeroWeb/test/integration/test_api_containers.py | 3 --- components/tools/OmeroWeb/test/integration/test_api_images.py | 2 -- .../tools/OmeroWeb/test/integration/test_api_projects.py | 3 --- components/tools/OmeroWeb/test/integration/test_api_wells.py | 2 -- components/tools/OmeroWeb/test/integration/test_containers.py | 2 -- components/tools/OmeroWeb/test/integration/test_csrf.py | 1 - components/tools/OmeroWeb/test/integration/test_links.py | 2 -- components/tools/OmeroWeb/test/integration/test_login.py | 1 - components/tools/OmeroWeb/test/integration/test_plategrid.py | 4 ---- components/tools/OmeroWeb/test/integration/test_rendering.py | 1 - components/tools/OmeroWeb/test/integration/test_scripts.py | 1 - components/tools/OmeroWeb/test/integration/test_show.py | 2 -- components/tools/OmeroWeb/test/integration/test_tags.py | 2 -- components/tools/OmeroWeb/test/integration/test_thumbnails.py | 1 - components/tools/OmeroWeb/test/integration/test_tree.py | 1 - .../tools/OmeroWeb/test/integration/test_tree_annotations.py | 1 - components/tools/OmeroWeb/test/integration/test_webadmin.py | 1 - examples/Training/python/Bulk_Shapes.py | 1 - examples/Training/python/Create_Image.py | 1 - examples/Training/python/Groups_Permissions.py | 1 - examples/Training/python/ROIs.py | 2 -- examples/Training/python/Raw_Data_Access.py | 1 - examples/Training/python/Read_Data.py | 1 - examples/Training/python/Render_Images.py | 1 - examples/Training/python/Tables.py | 2 -- examples/Training/python/Write_Data.py | 1 - 105 files changed, 170 deletions(-) diff --git a/build.py b/build.py index f76661e39a4..365387fffb1 100755 --- a/build.py +++ b/build.py @@ -8,7 +8,6 @@ # # General build scripts. -from builtins import str import os import sys import subprocess diff --git a/components/antlib/scripts/parse_version b/components/antlib/scripts/parse_version index a27bc574eca..753fb25247f 100755 --- a/components/antlib/scripts/parse_version +++ b/components/antlib/scripts/parse_version @@ -23,8 +23,6 @@ Helper script to simpliy version.xml """ -from builtins import str -from builtins import range import os import re import sys diff --git a/components/tools/OmeroFS/setup.py b/components/tools/OmeroFS/setup.py index 395dfd3f218..4dbfd175511 100755 --- a/components/tools/OmeroFS/setup.py +++ b/components/tools/OmeroFS/setup.py @@ -6,7 +6,6 @@ """ -from builtins import map import glob import sys import os diff --git a/components/tools/OmeroFS/test/drivers.py b/components/tools/OmeroFS/test/drivers.py index 73d972cca56..9c1d4fc3e86 100644 --- a/components/tools/OmeroFS/test/drivers.py +++ b/components/tools/OmeroFS/test/drivers.py @@ -10,9 +10,6 @@ """ -from builtins import str -from builtins import range -from builtins import object import logging import threading import time diff --git a/components/tools/OmeroFS/test/integration/test_dbclient.py b/components/tools/OmeroFS/test/integration/test_dbclient.py index 813615e3ac5..1a0e2032f30 100644 --- a/components/tools/OmeroFS/test/integration/test_dbclient.py +++ b/components/tools/OmeroFS/test/integration/test_dbclient.py @@ -7,7 +7,6 @@ """ -from builtins import object import os import sys diff --git a/components/tools/OmeroPy/test/conftest.py b/components/tools/OmeroPy/test/conftest.py index 6e30a1c04f0..6e8e1fee2fa 100644 --- a/components/tools/OmeroPy/test/conftest.py +++ b/components/tools/OmeroPy/test/conftest.py @@ -6,8 +6,6 @@ # -from builtins import range -from builtins import object import pytest import os diff --git a/components/tools/OmeroPy/test/integration/clitest/cli.py b/components/tools/OmeroPy/test/integration/clitest/cli.py index d51d0b351a9..46480bd9a9d 100644 --- a/components/tools/OmeroPy/test/integration/clitest/cli.py +++ b/components/tools/OmeroPy/test/integration/clitest/cli.py @@ -20,7 +20,6 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -from builtins import object import pytest import warnings diff --git a/components/tools/OmeroPy/test/integration/clitest/test_admin.py b/components/tools/OmeroPy/test/integration/clitest/test_admin.py index 258d9ae62da..b68f59f0d44 100644 --- a/components/tools/OmeroPy/test/integration/clitest/test_admin.py +++ b/components/tools/OmeroPy/test/integration/clitest/test_admin.py @@ -20,7 +20,6 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -from builtins import str import pytest import os diff --git a/components/tools/OmeroPy/test/integration/clitest/test_chgrp.py b/components/tools/OmeroPy/test/integration/clitest/test_chgrp.py index 2c930374229..f685311759e 100644 --- a/components/tools/OmeroPy/test/integration/clitest/test_chgrp.py +++ b/components/tools/OmeroPy/test/integration/clitest/test_chgrp.py @@ -19,7 +19,6 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -from builtins import range import omero from omero.cli import NonZeroReturnCode from omero.plugins.chgrp import ChgrpControl diff --git a/components/tools/OmeroPy/test/integration/clitest/test_chown.py b/components/tools/OmeroPy/test/integration/clitest/test_chown.py index 73bf93dcc45..177b28d4f6a 100644 --- a/components/tools/OmeroPy/test/integration/clitest/test_chown.py +++ b/components/tools/OmeroPy/test/integration/clitest/test_chown.py @@ -21,8 +21,6 @@ # from omero.cli import NonZeroReturnCode -from builtins import str -from builtins import range import omero from omero.plugins.chown import ChownControl from omero.testlib.cli import CLITest, RootCLITest diff --git a/components/tools/OmeroPy/test/integration/clitest/test_db.py b/components/tools/OmeroPy/test/integration/clitest/test_db.py index 42ca1cf4b72..c08ea90b3be 100644 --- a/components/tools/OmeroPy/test/integration/clitest/test_db.py +++ b/components/tools/OmeroPy/test/integration/clitest/test_db.py @@ -9,8 +9,6 @@ """ -from builtins import str -from builtins import object import pytest import os from omero.plugins.db import DatabaseControl diff --git a/components/tools/OmeroPy/test/integration/clitest/test_delete.py b/components/tools/OmeroPy/test/integration/clitest/test_delete.py index 8fca88525fc..0c8874d2f68 100644 --- a/components/tools/OmeroPy/test/integration/clitest/test_delete.py +++ b/components/tools/OmeroPy/test/integration/clitest/test_delete.py @@ -19,8 +19,6 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -from builtins import str -from builtins import range import omero from omero.plugins.delete import DeleteControl from omero.testlib.cli import CLITest diff --git a/components/tools/OmeroPy/test/integration/clitest/test_download.py b/components/tools/OmeroPy/test/integration/clitest/test_download.py index c5a9d92f87a..abdd26c2c76 100644 --- a/components/tools/OmeroPy/test/integration/clitest/test_download.py +++ b/components/tools/OmeroPy/test/integration/clitest/test_download.py @@ -19,8 +19,6 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -from builtins import str -from builtins import object import os import pytest import omero diff --git a/components/tools/OmeroPy/test/integration/clitest/test_group.py b/components/tools/OmeroPy/test/integration/clitest/test_group.py index aa6a7494f88..458fd1b606b 100644 --- a/components/tools/OmeroPy/test/integration/clitest/test_group.py +++ b/components/tools/OmeroPy/test/integration/clitest/test_group.py @@ -18,7 +18,6 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -from builtins import str from omero.plugins.group import GroupControl, defaultperms from omero.cli import NonZeroReturnCode from omero.testlib.cli import CLITest, RootCLITest diff --git a/components/tools/OmeroPy/test/integration/clitest/test_import.py b/components/tools/OmeroPy/test/integration/clitest/test_import.py index 210e6f5e099..3fef3cf07cc 100644 --- a/components/tools/OmeroPy/test/integration/clitest/test_import.py +++ b/components/tools/OmeroPy/test/integration/clitest/test_import.py @@ -18,9 +18,6 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -from builtins import str -from builtins import range -from builtins import object from omero.testlib.cli import CLITest import pytest import stat diff --git a/components/tools/OmeroPy/test/integration/clitest/test_import_bulk.py b/components/tools/OmeroPy/test/integration/clitest/test_import_bulk.py index e1ed77e96b7..53045247896 100644 --- a/components/tools/OmeroPy/test/integration/clitest/test_import_bulk.py +++ b/components/tools/OmeroPy/test/integration/clitest/test_import_bulk.py @@ -18,7 +18,6 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -from builtins import str from omero.cli import NonZeroReturnCode from omero.testlib.cli import CLITest from omero.plugins.sessions import SessionsControl diff --git a/components/tools/OmeroPy/test/integration/clitest/test_pyramids.py b/components/tools/OmeroPy/test/integration/clitest/test_pyramids.py index 366bb4c1cb3..77e506da65e 100644 --- a/components/tools/OmeroPy/test/integration/clitest/test_pyramids.py +++ b/components/tools/OmeroPy/test/integration/clitest/test_pyramids.py @@ -20,7 +20,6 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -from builtins import str from omero.testlib.cli import CLITest from omero.cli import NonZeroReturnCode from omero.model import PixelsI diff --git a/components/tools/OmeroPy/test/integration/clitest/test_script.py b/components/tools/OmeroPy/test/integration/clitest/test_script.py index d19c6cb9eab..50703d7a32d 100644 --- a/components/tools/OmeroPy/test/integration/clitest/test_script.py +++ b/components/tools/OmeroPy/test/integration/clitest/test_script.py @@ -9,7 +9,6 @@ """ -from builtins import str from omero.testlib.cli import CLITest from omero.plugins.script import ScriptControl from omero.util.temp_files import create_path diff --git a/components/tools/OmeroPy/test/integration/clitest/test_search.py b/components/tools/OmeroPy/test/integration/clitest/test_search.py index 924000a780a..1324bfa408c 100644 --- a/components/tools/OmeroPy/test/integration/clitest/test_search.py +++ b/components/tools/OmeroPy/test/integration/clitest/test_search.py @@ -20,7 +20,6 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -from builtins import str import pytest from datetime import date diff --git a/components/tools/OmeroPy/test/integration/clitest/test_sessions.py b/components/tools/OmeroPy/test/integration/clitest/test_sessions.py index b5fc2c14372..3d8fc63ac58 100755 --- a/components/tools/OmeroPy/test/integration/clitest/test_sessions.py +++ b/components/tools/OmeroPy/test/integration/clitest/test_sessions.py @@ -19,7 +19,6 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -from builtins import str from omero.testlib.cli import CLITest from omero.cli import NonZeroReturnCode from omero.model import Experimenter diff --git a/components/tools/OmeroPy/test/integration/clitest/test_tag.py b/components/tools/OmeroPy/test/integration/clitest/test_tag.py index 62dc4046311..32617f3e15f 100644 --- a/components/tools/OmeroPy/test/integration/clitest/test_tag.py +++ b/components/tools/OmeroPy/test/integration/clitest/test_tag.py @@ -19,8 +19,6 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -from builtins import str -from builtins import range import re import pytest import omero diff --git a/components/tools/OmeroPy/test/integration/clitest/test_upload.py b/components/tools/OmeroPy/test/integration/clitest/test_upload.py index 68154fe6d3e..802b8ba2bb9 100644 --- a/components/tools/OmeroPy/test/integration/clitest/test_upload.py +++ b/components/tools/OmeroPy/test/integration/clitest/test_upload.py @@ -19,7 +19,6 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -from builtins import str import pytest import warnings diff --git a/components/tools/OmeroPy/test/integration/clitest/test_user.py b/components/tools/OmeroPy/test/integration/clitest/test_user.py index 1da53afb98a..20ea37aa1f9 100644 --- a/components/tools/OmeroPy/test/integration/clitest/test_user.py +++ b/components/tools/OmeroPy/test/integration/clitest/test_user.py @@ -19,7 +19,6 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -from builtins import str from omero.cli import NonZeroReturnCode from omero.rtypes import rstring from omero.plugins.user import UserControl diff --git a/components/tools/OmeroPy/test/integration/gatewaytest/test_annotation.py b/components/tools/OmeroPy/test/integration/gatewaytest/test_annotation.py index 0384361b78c..65d1817c45f 100644 --- a/components/tools/OmeroPy/test/integration/gatewaytest/test_annotation.py +++ b/components/tools/OmeroPy/test/integration/gatewaytest/test_annotation.py @@ -13,8 +13,6 @@ """ -from builtins import str -from builtins import range import time import datetime import os diff --git a/components/tools/OmeroPy/test/integration/gatewaytest/test_chgrp.py b/components/tools/OmeroPy/test/integration/gatewaytest/test_chgrp.py index ff6c8d3daed..5cee7cad2eb 100644 --- a/components/tools/OmeroPy/test/integration/gatewaytest/test_chgrp.py +++ b/components/tools/OmeroPy/test/integration/gatewaytest/test_chgrp.py @@ -12,7 +12,6 @@ """ -from builtins import range import omero from omero.rtypes import rstring from omero.cmd import State, ERR, OK diff --git a/components/tools/OmeroPy/test/integration/gatewaytest/test_chmod.py b/components/tools/OmeroPy/test/integration/gatewaytest/test_chmod.py index 3c8b7721abb..a40bd5a3067 100644 --- a/components/tools/OmeroPy/test/integration/gatewaytest/test_chmod.py +++ b/components/tools/OmeroPy/test/integration/gatewaytest/test_chmod.py @@ -13,7 +13,6 @@ """ -from builtins import object import omero import traceback from omero.rtypes import rstring diff --git a/components/tools/OmeroPy/test/integration/gatewaytest/test_connection.py b/components/tools/OmeroPy/test/integration/gatewaytest/test_connection.py index 50a5f70efd2..9ae4dfebcf3 100644 --- a/components/tools/OmeroPy/test/integration/gatewaytest/test_connection.py +++ b/components/tools/OmeroPy/test/integration/gatewaytest/test_connection.py @@ -11,8 +11,6 @@ """ -from builtins import map -from builtins import object import omero import Ice from omero.gateway.scripts import dbhelpers diff --git a/components/tools/OmeroPy/test/integration/gatewaytest/test_delete.py b/components/tools/OmeroPy/test/integration/gatewaytest/test_delete.py index 230994cac45..03c65a952f4 100644 --- a/components/tools/OmeroPy/test/integration/gatewaytest/test_delete.py +++ b/components/tools/OmeroPy/test/integration/gatewaytest/test_delete.py @@ -12,8 +12,6 @@ """ -from builtins import str -from builtins import object import omero from omero.rtypes import wrap, unwrap import time diff --git a/components/tools/OmeroPy/test/integration/gatewaytest/test_fs.py b/components/tools/OmeroPy/test/integration/gatewaytest/test_fs.py index 0c3ffb3828c..9f6e71d9a96 100644 --- a/components/tools/OmeroPy/test/integration/gatewaytest/test_fs.py +++ b/components/tools/OmeroPy/test/integration/gatewaytest/test_fs.py @@ -27,9 +27,6 @@ """ -from builtins import str -from builtins import range -from builtins import object import pytest from omero.model import ImageI, PixelsI, FilesetI, FilesetEntryI, \ diff --git a/components/tools/OmeroPy/test/integration/gatewaytest/test_get_objects.py b/components/tools/OmeroPy/test/integration/gatewaytest/test_get_objects.py index 2e2d5b8cc6e..bfd09aa382a 100644 --- a/components/tools/OmeroPy/test/integration/gatewaytest/test_get_objects.py +++ b/components/tools/OmeroPy/test/integration/gatewaytest/test_get_objects.py @@ -14,9 +14,6 @@ """ -from builtins import str -from builtins import range -from builtins import object import omero import uuid import pytest diff --git a/components/tools/OmeroPy/test/integration/gatewaytest/test_helpers.py b/components/tools/OmeroPy/test/integration/gatewaytest/test_helpers.py index 6350e01a0ec..e96f3b4e369 100644 --- a/components/tools/OmeroPy/test/integration/gatewaytest/test_helpers.py +++ b/components/tools/OmeroPy/test/integration/gatewaytest/test_helpers.py @@ -7,7 +7,6 @@ """ -from builtins import object import omero import omero.gateway diff --git a/components/tools/OmeroPy/test/integration/gatewaytest/test_image.py b/components/tools/OmeroPy/test/integration/gatewaytest/test_image.py index d8749330b81..cd13ec6b7c1 100644 --- a/components/tools/OmeroPy/test/integration/gatewaytest/test_image.py +++ b/components/tools/OmeroPy/test/integration/gatewaytest/test_image.py @@ -14,10 +14,6 @@ """ -from builtins import zip -from builtins import str -from builtins import range -from builtins import object import pytest from io import BytesIO import omero diff --git a/components/tools/OmeroPy/test/integration/gatewaytest/test_image_wrapper.py b/components/tools/OmeroPy/test/integration/gatewaytest/test_image_wrapper.py index 02a173a4875..691b9b78b13 100644 --- a/components/tools/OmeroPy/test/integration/gatewaytest/test_image_wrapper.py +++ b/components/tools/OmeroPy/test/integration/gatewaytest/test_image_wrapper.py @@ -13,8 +13,6 @@ """ -from builtins import range -from builtins import object import pytest from omero.testlib import ITest diff --git a/components/tools/OmeroPy/test/integration/gatewaytest/test_missing_pyramid.py b/components/tools/OmeroPy/test/integration/gatewaytest/test_missing_pyramid.py index da9e10dbfc4..d047a433060 100644 --- a/components/tools/OmeroPy/test/integration/gatewaytest/test_missing_pyramid.py +++ b/components/tools/OmeroPy/test/integration/gatewaytest/test_missing_pyramid.py @@ -10,7 +10,6 @@ """ -from builtins import object import omero import pytest diff --git a/components/tools/OmeroPy/test/integration/gatewaytest/test_multi_group.py b/components/tools/OmeroPy/test/integration/gatewaytest/test_multi_group.py index 43c914215e2..645f15dc573 100644 --- a/components/tools/OmeroPy/test/integration/gatewaytest/test_multi_group.py +++ b/components/tools/OmeroPy/test/integration/gatewaytest/test_multi_group.py @@ -12,8 +12,6 @@ """ -from builtins import str -from builtins import object import omero import omero.scripts from omero.rtypes import rstring, rtime, rlong diff --git a/components/tools/OmeroPy/test/integration/gatewaytest/test_performance.py b/components/tools/OmeroPy/test/integration/gatewaytest/test_performance.py index 43d0a1a931d..82a384e8d34 100644 --- a/components/tools/OmeroPy/test/integration/gatewaytest/test_performance.py +++ b/components/tools/OmeroPy/test/integration/gatewaytest/test_performance.py @@ -16,8 +16,6 @@ """ -from builtins import range -from builtins import object import pytest import omero import time diff --git a/components/tools/OmeroPy/test/integration/gatewaytest/test_pixels.py b/components/tools/OmeroPy/test/integration/gatewaytest/test_pixels.py index ea0b83873ab..728363f8c0b 100644 --- a/components/tools/OmeroPy/test/integration/gatewaytest/test_pixels.py +++ b/components/tools/OmeroPy/test/integration/gatewaytest/test_pixels.py @@ -14,9 +14,6 @@ """ -from builtins import str -from builtins import range -from builtins import object import omero import pytest diff --git a/components/tools/OmeroPy/test/integration/gatewaytest/test_plate_wrapper.py b/components/tools/OmeroPy/test/integration/gatewaytest/test_plate_wrapper.py index c292dc37aeb..e2c4d5809fe 100644 --- a/components/tools/OmeroPy/test/integration/gatewaytest/test_plate_wrapper.py +++ b/components/tools/OmeroPy/test/integration/gatewaytest/test_plate_wrapper.py @@ -13,9 +13,6 @@ """ -from builtins import str -from builtins import range -from builtins import object import pytest from omero.model import PlateI, WellI, WellSampleI, ImageI diff --git a/components/tools/OmeroPy/test/integration/gatewaytest/test_rdefs.py b/components/tools/OmeroPy/test/integration/gatewaytest/test_rdefs.py index b2a227e2587..bc98f283c76 100644 --- a/components/tools/OmeroPy/test/integration/gatewaytest/test_rdefs.py +++ b/components/tools/OmeroPy/test/integration/gatewaytest/test_rdefs.py @@ -14,8 +14,6 @@ """ -from builtins import str -from builtins import object import pytest from io import BytesIO diff --git a/components/tools/OmeroPy/test/integration/gatewaytest/test_search_objects.py b/components/tools/OmeroPy/test/integration/gatewaytest/test_search_objects.py index 76b845ee2c3..044f3485f04 100644 --- a/components/tools/OmeroPy/test/integration/gatewaytest/test_search_objects.py +++ b/components/tools/OmeroPy/test/integration/gatewaytest/test_search_objects.py @@ -29,9 +29,6 @@ """ -from builtins import object - - class TestGetObject (object): def testSearchObjects(self, gatewaywrapper): diff --git a/components/tools/OmeroPy/test/integration/gatewaytest/test_services.py b/components/tools/OmeroPy/test/integration/gatewaytest/test_services.py index 9432a5bad4b..0e12bb36ea7 100644 --- a/components/tools/OmeroPy/test/integration/gatewaytest/test_services.py +++ b/components/tools/OmeroPy/test/integration/gatewaytest/test_services.py @@ -13,8 +13,6 @@ """ -from builtins import str -from builtins import object import omero from omero.grid import StringColumn diff --git a/components/tools/OmeroPy/test/integration/gatewaytest/test_ticket10618.py b/components/tools/OmeroPy/test/integration/gatewaytest/test_ticket10618.py index 1669f6b6733..f8cb92f6af6 100644 --- a/components/tools/OmeroPy/test/integration/gatewaytest/test_ticket10618.py +++ b/components/tools/OmeroPy/test/integration/gatewaytest/test_ticket10618.py @@ -25,7 +25,6 @@ """ -from builtins import str from omero.testlib import ITest diff --git a/components/tools/OmeroPy/test/integration/gatewaytest/test_user.py b/components/tools/OmeroPy/test/integration/gatewaytest/test_user.py index 134a0ff9b67..43dc48abe39 100644 --- a/components/tools/OmeroPy/test/integration/gatewaytest/test_user.py +++ b/components/tools/OmeroPy/test/integration/gatewaytest/test_user.py @@ -12,8 +12,6 @@ """ -from builtins import str -from builtins import object import omero import pytest diff --git a/components/tools/OmeroPy/test/integration/gatewaytest/test_wrapper.py b/components/tools/OmeroPy/test/integration/gatewaytest/test_wrapper.py index c9d492ef1a7..ec18cdc8c47 100644 --- a/components/tools/OmeroPy/test/integration/gatewaytest/test_wrapper.py +++ b/components/tools/OmeroPy/test/integration/gatewaytest/test_wrapper.py @@ -13,8 +13,6 @@ """ -from builtins import str -from builtins import object import Ice import omero import os diff --git a/components/tools/OmeroPy/test/integration/helpers.py b/components/tools/OmeroPy/test/integration/helpers.py index 33519e6b69c..e15f64c8272 100644 --- a/components/tools/OmeroPy/test/integration/helpers.py +++ b/components/tools/OmeroPy/test/integration/helpers.py @@ -24,7 +24,6 @@ """ -from builtins import range import omero.util.script_utils as scriptUtil from numpy import arange, uint8 diff --git a/components/tools/OmeroPy/test/integration/metadata/test_metadata_mapannotations.py b/components/tools/OmeroPy/test/integration/metadata/test_metadata_mapannotations.py index a58f7fbcc4b..9ca270e62ba 100644 --- a/components/tools/OmeroPy/test/integration/metadata/test_metadata_mapannotations.py +++ b/components/tools/OmeroPy/test/integration/metadata/test_metadata_mapannotations.py @@ -23,7 +23,6 @@ Integration test of metadata_mapannotation """ -from builtins import zip from omero.testlib import ITest from omero.model import MapAnnotationI, NamedValue from omero.rtypes import unwrap, wrap diff --git a/components/tools/OmeroPy/test/integration/metadata/test_populate.py b/components/tools/OmeroPy/test/integration/metadata/test_populate.py index 460f82fe683..4a35e778942 100644 --- a/components/tools/OmeroPy/test/integration/metadata/test_populate.py +++ b/components/tools/OmeroPy/test/integration/metadata/test_populate.py @@ -24,10 +24,6 @@ and populate_roi.py scripts. """ -from builtins import str -from builtins import zip -from builtins import range -from builtins import object from omero.testlib import ITest import string import csv diff --git a/components/tools/OmeroPy/test/integration/metadata/test_pydict_text.py b/components/tools/OmeroPy/test/integration/metadata/test_pydict_text.py index eebb53f3e03..5048f810e1d 100644 --- a/components/tools/OmeroPy/test/integration/metadata/test_pydict_text.py +++ b/components/tools/OmeroPy/test/integration/metadata/test_pydict_text.py @@ -23,7 +23,6 @@ Test of the yaml/json parameters file handling """ -from builtins import str from omero.testlib import ITest from omero.rtypes import unwrap from omero.util import pydict_text_io diff --git a/components/tools/OmeroPy/test/integration/scriptstest/test_cli.py b/components/tools/OmeroPy/test/integration/scriptstest/test_cli.py index d5d713f3a85..d8ea0b56b38 100644 --- a/components/tools/OmeroPy/test/integration/scriptstest/test_cli.py +++ b/components/tools/OmeroPy/test/integration/scriptstest/test_cli.py @@ -22,7 +22,6 @@ """ -from builtins import str from omero.testlib import ITest import os diff --git a/components/tools/OmeroPy/test/integration/scriptstest/test_ping.py b/components/tools/OmeroPy/test/integration/scriptstest/test_ping.py index 0090048eeda..5ee2a3a999d 100644 --- a/components/tools/OmeroPy/test/integration/scriptstest/test_ping.py +++ b/components/tools/OmeroPy/test/integration/scriptstest/test_ping.py @@ -25,7 +25,6 @@ """ -from builtins import str from omero.testlib import ITest import pytest import os diff --git a/components/tools/OmeroPy/test/integration/scriptstest/test_script_utils.py b/components/tools/OmeroPy/test/integration/scriptstest/test_script_utils.py index b16a585f333..d444553bc54 100644 --- a/components/tools/OmeroPy/test/integration/scriptstest/test_script_utils.py +++ b/components/tools/OmeroPy/test/integration/scriptstest/test_script_utils.py @@ -22,8 +22,6 @@ """ -from builtins import str -from builtins import range import pytest from omero.testlib import ITest import omero.util.script_utils as scriptUtil diff --git a/components/tools/OmeroPy/test/integration/tablestest/test_populate_metadata.py b/components/tools/OmeroPy/test/integration/tablestest/test_populate_metadata.py index 64fe8f828cd..fcb7ea165b8 100644 --- a/components/tools/OmeroPy/test/integration/tablestest/test_populate_metadata.py +++ b/components/tools/OmeroPy/test/integration/tablestest/test_populate_metadata.py @@ -24,7 +24,6 @@ """ -from builtins import range from omero.testlib import ITest import os diff --git a/components/tools/OmeroPy/test/integration/tablestest/test_service.py b/components/tools/OmeroPy/test/integration/tablestest/test_service.py index 03dbc36aa1f..865d716714a 100755 --- a/components/tools/OmeroPy/test/integration/tablestest/test_service.py +++ b/components/tools/OmeroPy/test/integration/tablestest/test_service.py @@ -23,8 +23,6 @@ Test of the Tables service """ -from builtins import str -from builtins import range from omero_ext.path import path import omero import omero.tables diff --git a/components/tools/OmeroPy/test/integration/test_chgrp.py b/components/tools/OmeroPy/test/integration/test_chgrp.py index fe8c82faeed..a627f511fd2 100644 --- a/components/tools/OmeroPy/test/integration/test_chgrp.py +++ b/components/tools/OmeroPy/test/integration/test_chgrp.py @@ -24,7 +24,6 @@ """ -from builtins import range import omero import omero.gateway from omero.testlib import ITest diff --git a/components/tools/OmeroPy/test/integration/test_chmod.py b/components/tools/OmeroPy/test/integration/test_chmod.py index 8dda6bb9eb3..7c6efce9963 100644 --- a/components/tools/OmeroPy/test/integration/test_chmod.py +++ b/components/tools/OmeroPy/test/integration/test_chmod.py @@ -24,7 +24,6 @@ """ -from builtins import str import time from omero.testlib import ITest import omero diff --git a/components/tools/OmeroPy/test/integration/test_cmdcallback.py b/components/tools/OmeroPy/test/integration/test_cmdcallback.py index 576970c754d..c28af482cc1 100644 --- a/components/tools/OmeroPy/test/integration/test_cmdcallback.py +++ b/components/tools/OmeroPy/test/integration/test_cmdcallback.py @@ -23,7 +23,6 @@ Test of the CmdCallbackI object """ -from builtins import range import threading from omero.testlib import ITest diff --git a/components/tools/OmeroPy/test/integration/test_delete.py b/components/tools/OmeroPy/test/integration/test_delete.py index 6b9b45c03de..6146070f570 100644 --- a/components/tools/OmeroPy/test/integration/test_delete.py +++ b/components/tools/OmeroPy/test/integration/test_delete.py @@ -24,8 +24,6 @@ """ -from builtins import str -from builtins import range import traceback from omero.testlib import ITest import pytest diff --git a/components/tools/OmeroPy/test/integration/test_files.py b/components/tools/OmeroPy/test/integration/test_files.py index 2d8ff59109b..b772bb6573e 100644 --- a/components/tools/OmeroPy/test/integration/test_files.py +++ b/components/tools/OmeroPy/test/integration/test_files.py @@ -25,7 +25,6 @@ """ -from builtins import str import pytest from omero.testlib import ITest diff --git a/components/tools/OmeroPy/test/integration/test_icontainer.py b/components/tools/OmeroPy/test/integration/test_icontainer.py index 25d63884ea8..35dc8306318 100644 --- a/components/tools/OmeroPy/test/integration/test_icontainer.py +++ b/components/tools/OmeroPy/test/integration/test_icontainer.py @@ -24,8 +24,6 @@ """ -from builtins import str -from builtins import range from omero.testlib import ITest import omero from omero_model_CommentAnnotationI import CommentAnnotationI diff --git a/components/tools/OmeroPy/test/integration/test_iquery.py b/components/tools/OmeroPy/test/integration/test_iquery.py index 0789ef2dcc6..9c961b2bcf8 100644 --- a/components/tools/OmeroPy/test/integration/test_iquery.py +++ b/components/tools/OmeroPy/test/integration/test_iquery.py @@ -24,7 +24,6 @@ """ -from builtins import range from omero.testlib import ITest from omero.rtypes import rstring from omero.rtypes import unwrap, wrap diff --git a/components/tools/OmeroPy/test/integration/test_itimeline.py b/components/tools/OmeroPy/test/integration/test_itimeline.py index 1824bb012a6..b4729f73954 100644 --- a/components/tools/OmeroPy/test/integration/test_itimeline.py +++ b/components/tools/OmeroPy/test/integration/test_itimeline.py @@ -9,7 +9,6 @@ Use is subject to license terms supplied in LICENSE.txt """ -from builtins import range import time import pytest from omero.testlib import ITest diff --git a/components/tools/OmeroPy/test/integration/test_itypes.py b/components/tools/OmeroPy/test/integration/test_itypes.py index acfa5da8248..7fbbd338417 100644 --- a/components/tools/OmeroPy/test/integration/test_itypes.py +++ b/components/tools/OmeroPy/test/integration/test_itypes.py @@ -9,7 +9,6 @@ Use is subject to license terms supplied in LICENSE.txt """ -from builtins import str from omero.testlib import ITest from omero.rtypes import rstring diff --git a/components/tools/OmeroPy/test/integration/test_iupdate.py b/components/tools/OmeroPy/test/integration/test_iupdate.py index e22993484ad..5dc53714a3d 100644 --- a/components/tools/OmeroPy/test/integration/test_iupdate.py +++ b/components/tools/OmeroPy/test/integration/test_iupdate.py @@ -10,7 +10,6 @@ Integration test focused on the omero.api.IUpdate interface. """ -from builtins import range from omero.testlib import ITest import omero import pytest diff --git a/components/tools/OmeroPy/test/integration/test_mail.py b/components/tools/OmeroPy/test/integration/test_mail.py index 0c0acee9f49..ea7c647b60e 100644 --- a/components/tools/OmeroPy/test/integration/test_mail.py +++ b/components/tools/OmeroPy/test/integration/test_mail.py @@ -25,7 +25,6 @@ etc/blitz/mail-server.example """ -from builtins import str from omero.testlib import ITest import omero diff --git a/components/tools/OmeroPy/test/integration/test_mapannotation.py b/components/tools/OmeroPy/test/integration/test_mapannotation.py index ff1e20d37a8..248e5c66a5e 100644 --- a/components/tools/OmeroPy/test/integration/test_mapannotation.py +++ b/components/tools/OmeroPy/test/integration/test_mapannotation.py @@ -24,7 +24,6 @@ introduced in 5.1. """ -from builtins import range from omero.testlib import ITest import pytest import omero diff --git a/components/tools/OmeroPy/test/integration/test_model51.py b/components/tools/OmeroPy/test/integration/test_model51.py index 51416caf21e..fc17aefbd15 100644 --- a/components/tools/OmeroPy/test/integration/test_model51.py +++ b/components/tools/OmeroPy/test/integration/test_model51.py @@ -23,7 +23,6 @@ Basic tests for additions/changes to the 5.1 model. """ -from builtins import str from omero.testlib import ITest import pytest import omero diff --git a/components/tools/OmeroPy/test/integration/test_permissions.py b/components/tools/OmeroPy/test/integration/test_permissions.py index db2bd3f62f6..2d050d407b1 100644 --- a/components/tools/OmeroPy/test/integration/test_permissions.py +++ b/components/tools/OmeroPy/test/integration/test_permissions.py @@ -24,8 +24,6 @@ """ -from builtins import str -from builtins import object import pytest from omero.testlib import ITest, PFS import omero diff --git a/components/tools/OmeroPy/test/integration/test_rawpixelsstore.py b/components/tools/OmeroPy/test/integration/test_rawpixelsstore.py index f8534e0f267..fe3a496c334 100644 --- a/components/tools/OmeroPy/test/integration/test_rawpixelsstore.py +++ b/components/tools/OmeroPy/test/integration/test_rawpixelsstore.py @@ -9,8 +9,6 @@ """ -from builtins import hex -from builtins import range import omero import threading from omero.testlib import ITest diff --git a/components/tools/OmeroPy/test/integration/test_reimport.py b/components/tools/OmeroPy/test/integration/test_reimport.py index 8e506220589..a48216ce4ae 100644 --- a/components/tools/OmeroPy/test/integration/test_reimport.py +++ b/components/tools/OmeroPy/test/integration/test_reimport.py @@ -20,8 +20,6 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -from builtins import str -from builtins import range from omero.testlib import ITest from omero.callbacks import CmdCallbackI diff --git a/components/tools/OmeroPy/test/integration/test_render.py b/components/tools/OmeroPy/test/integration/test_render.py index c12570d2d50..061268dc57a 100644 --- a/components/tools/OmeroPy/test/integration/test_render.py +++ b/components/tools/OmeroPy/test/integration/test_render.py @@ -24,7 +24,6 @@ rendering a 'region' of big images. """ -from builtins import range import omero import logging from omero.testlib import ITest diff --git a/components/tools/OmeroPy/test/integration/test_repository.py b/components/tools/OmeroPy/test/integration/test_repository.py index b271ee2886f..07e4ed3730d 100644 --- a/components/tools/OmeroPy/test/integration/test_repository.py +++ b/components/tools/OmeroPy/test/integration/test_repository.py @@ -9,10 +9,6 @@ """ -from builtins import zip -from builtins import str -from builtins import range -from builtins import object import pytest import omero diff --git a/components/tools/OmeroPy/test/integration/test_rois.py b/components/tools/OmeroPy/test/integration/test_rois.py index 20658a9fe24..1a1c5070e3f 100644 --- a/components/tools/OmeroPy/test/integration/test_rois.py +++ b/components/tools/OmeroPy/test/integration/test_rois.py @@ -8,7 +8,6 @@ Use is subject to license terms supplied in LICENSE.txt """ -from builtins import object from omero.testlib import ITest import omero from omero.rtypes import rdouble, rstring, rint diff --git a/components/tools/OmeroPy/test/integration/test_scripts.py b/components/tools/OmeroPy/test/integration/test_scripts.py index 14ad7845607..943cbd14fe8 100644 --- a/components/tools/OmeroPy/test/integration/test_scripts.py +++ b/components/tools/OmeroPy/test/integration/test_scripts.py @@ -9,8 +9,6 @@ """ -from builtins import str -from builtins import range import os import time import pytest diff --git a/components/tools/OmeroPy/test/integration/test_simple.py b/components/tools/OmeroPy/test/integration/test_simple.py index fa874062dbe..858967af4d3 100644 --- a/components/tools/OmeroPy/test/integration/test_simple.py +++ b/components/tools/OmeroPy/test/integration/test_simple.py @@ -10,7 +10,6 @@ """ -from builtins import str from omero.testlib import ITest diff --git a/components/tools/OmeroPy/test/integration/test_thumbs.py b/components/tools/OmeroPy/test/integration/test_thumbs.py index eaf06ce9cd9..0d7d4688a3c 100644 --- a/components/tools/OmeroPy/test/integration/test_thumbs.py +++ b/components/tools/OmeroPy/test/integration/test_thumbs.py @@ -9,7 +9,6 @@ """ -from builtins import range from omero.testlib import ITest import pytest diff --git a/components/tools/OmeroPy/test/integration/test_tickets2000.py b/components/tools/OmeroPy/test/integration/test_tickets2000.py index fe4268af951..5292ab0844c 100644 --- a/components/tools/OmeroPy/test/integration/test_tickets2000.py +++ b/components/tools/OmeroPy/test/integration/test_tickets2000.py @@ -9,8 +9,6 @@ Use is subject to license terms supplied in LICENSE.txt """ -from builtins import str -from builtins import range import time from omero.testlib import ITest import pytest diff --git a/components/tools/OmeroPy/test/integration/test_tickets3000.py b/components/tools/OmeroPy/test/integration/test_tickets3000.py index 79433613733..d0e09ffd869 100644 --- a/components/tools/OmeroPy/test/integration/test_tickets3000.py +++ b/components/tools/OmeroPy/test/integration/test_tickets3000.py @@ -8,8 +8,6 @@ Use is subject to license terms supplied in LICENSE.txt """ -from builtins import str -from builtins import range import omero from omero.testlib import ITest import pytest diff --git a/components/tools/OmeroPy/test/integration/test_util.py b/components/tools/OmeroPy/test/integration/test_util.py index 9a24dcfc77a..08fb36a3357 100644 --- a/components/tools/OmeroPy/test/integration/test_util.py +++ b/components/tools/OmeroPy/test/integration/test_util.py @@ -24,7 +24,6 @@ Test of various things under omero.util """ -from builtins import object from omero.util.upgrade_check import UpgradeCheck diff --git a/components/tools/OmeroWeb/test/integration/test_annotate.py b/components/tools/OmeroWeb/test/integration/test_annotate.py index 71cdf36816f..21e8078c169 100644 --- a/components/tools/OmeroWeb/test/integration/test_annotate.py +++ b/components/tools/OmeroWeb/test/integration/test_annotate.py @@ -21,7 +21,6 @@ Tests adding & removing annotations """ -from builtins import str import pytest import omero import omero.clients diff --git a/components/tools/OmeroWeb/test/integration/test_api_containers.py b/components/tools/OmeroWeb/test/integration/test_api_containers.py index 55b37ec7c34..aa0a8f716b5 100644 --- a/components/tools/OmeroWeb/test/integration/test_api_containers.py +++ b/components/tools/OmeroWeb/test/integration/test_api_containers.py @@ -19,9 +19,6 @@ """Tests querying & editing Containers with webgateway json api.""" -from builtins import zip -from builtins import str -from builtins import range import copy from omeroweb.testlib import IWebTest, get_json, \ post_json, put_json, delete_json diff --git a/components/tools/OmeroWeb/test/integration/test_api_images.py b/components/tools/OmeroWeb/test/integration/test_api_images.py index 6a75ba5ccdd..436f33e18d5 100644 --- a/components/tools/OmeroWeb/test/integration/test_api_images.py +++ b/components/tools/OmeroWeb/test/integration/test_api_images.py @@ -19,8 +19,6 @@ """Tests querying Images with web json api.""" -from builtins import zip -from builtins import range from omeroweb.testlib import IWebTest, get_json from django.urls import reverse from omeroweb.api import api_settings diff --git a/components/tools/OmeroWeb/test/integration/test_api_projects.py b/components/tools/OmeroWeb/test/integration/test_api_projects.py index 3fe6fe0d567..2bf999f3d80 100644 --- a/components/tools/OmeroWeb/test/integration/test_api_projects.py +++ b/components/tools/OmeroWeb/test/integration/test_api_projects.py @@ -21,9 +21,6 @@ Tests querying & editing Projects with webgateway json api """ - -from builtins import zip -from builtins import range from omeroweb.testlib import IWebTest, get_json, \ post_json, put_json, delete_json from django.urls import reverse diff --git a/components/tools/OmeroWeb/test/integration/test_api_wells.py b/components/tools/OmeroWeb/test/integration/test_api_wells.py index 906d9bcc184..6c588592e1d 100644 --- a/components/tools/OmeroWeb/test/integration/test_api_wells.py +++ b/components/tools/OmeroWeb/test/integration/test_api_wells.py @@ -19,8 +19,6 @@ """Tests querying Wells with web json api.""" -from builtins import zip -from builtins import range from omeroweb.testlib import IWebTest, get_json from django.urls import reverse from omeroweb.api import api_settings diff --git a/components/tools/OmeroWeb/test/integration/test_containers.py b/components/tools/OmeroWeb/test/integration/test_containers.py index d8cdb712947..2cc6212afa3 100644 --- a/components/tools/OmeroWeb/test/integration/test_containers.py +++ b/components/tools/OmeroWeb/test/integration/test_containers.py @@ -21,8 +21,6 @@ Tests creation, linking, editing & deletion of containers """ -from builtins import str -from builtins import range import omero import omero.clients from omero.rtypes import rtime diff --git a/components/tools/OmeroWeb/test/integration/test_csrf.py b/components/tools/OmeroWeb/test/integration/test_csrf.py index 7eaaec61180..451596662d9 100644 --- a/components/tools/OmeroWeb/test/integration/test_csrf.py +++ b/components/tools/OmeroWeb/test/integration/test_csrf.py @@ -22,7 +22,6 @@ working correctly. """ -from builtins import range import omero import omero.clients from omero.rtypes import rstring diff --git a/components/tools/OmeroWeb/test/integration/test_links.py b/components/tools/OmeroWeb/test/integration/test_links.py index daaf5315035..31b2a95bbf4 100644 --- a/components/tools/OmeroWeb/test/integration/test_links.py +++ b/components/tools/OmeroWeb/test/integration/test_links.py @@ -21,8 +21,6 @@ Tests creation and deletion of links between e.g. Projects & Datasets etc. """ -from builtins import str -from builtins import range import omero from omero.rtypes import rstring diff --git a/components/tools/OmeroWeb/test/integration/test_login.py b/components/tools/OmeroWeb/test/integration/test_login.py index f998ba852af..516cb341bd0 100644 --- a/components/tools/OmeroWeb/test/integration/test_login.py +++ b/components/tools/OmeroWeb/test/integration/test_login.py @@ -20,7 +20,6 @@ """ Tests webclient login """ -from builtins import str from django.conf import settings from django.urls import re_path from importlib import import_module diff --git a/components/tools/OmeroWeb/test/integration/test_plategrid.py b/components/tools/OmeroWeb/test/integration/test_plategrid.py index a7e960ccc31..474cf32dce5 100644 --- a/components/tools/OmeroWeb/test/integration/test_plategrid.py +++ b/components/tools/OmeroWeb/test/integration/test_plategrid.py @@ -9,10 +9,6 @@ Integration tests for the "plategrid" module. """ -from builtins import map -from builtins import str -from builtins import range -from builtins import object import pytest from omeroweb.testlib import IWebTest diff --git a/components/tools/OmeroWeb/test/integration/test_rendering.py b/components/tools/OmeroWeb/test/integration/test_rendering.py index 61efd22f658..db4c1b1983c 100644 --- a/components/tools/OmeroWeb/test/integration/test_rendering.py +++ b/components/tools/OmeroWeb/test/integration/test_rendering.py @@ -21,7 +21,6 @@ Tests copying and pasting of rendering settings in webclient """ -from builtins import str import json import omero import omero.clients diff --git a/components/tools/OmeroWeb/test/integration/test_scripts.py b/components/tools/OmeroWeb/test/integration/test_scripts.py index 2caab2ca295..31ec0aba01e 100644 --- a/components/tools/OmeroWeb/test/integration/test_scripts.py +++ b/components/tools/OmeroWeb/test/integration/test_scripts.py @@ -19,7 +19,6 @@ """Test OMERO.scripts usage in the webclient.""" -from builtins import str from omeroweb.testlib import IWebTest from omeroweb.testlib import get, post, get_json import time diff --git a/components/tools/OmeroWeb/test/integration/test_show.py b/components/tools/OmeroWeb/test/integration/test_show.py index 17f8e6749e7..8ecdd58c0b5 100644 --- a/components/tools/OmeroWeb/test/integration/test_show.py +++ b/components/tools/OmeroWeb/test/integration/test_show.py @@ -9,8 +9,6 @@ """ -from builtins import str -from builtins import range import omero import omero.clients import pytest diff --git a/components/tools/OmeroWeb/test/integration/test_tags.py b/components/tools/OmeroWeb/test/integration/test_tags.py index 4e286b8e9ea..9994790b6ed 100644 --- a/components/tools/OmeroWeb/test/integration/test_tags.py +++ b/components/tools/OmeroWeb/test/integration/test_tags.py @@ -21,8 +21,6 @@ Tests creation, linking, editing and deletion of Tags """ -from builtins import str -from builtins import range import omero import omero.clients from omero.rtypes import rstring diff --git a/components/tools/OmeroWeb/test/integration/test_thumbnails.py b/components/tools/OmeroWeb/test/integration/test_thumbnails.py index 0cc3dcf67a5..9fc9e4a593d 100644 --- a/components/tools/OmeroWeb/test/integration/test_thumbnails.py +++ b/components/tools/OmeroWeb/test/integration/test_thumbnails.py @@ -19,7 +19,6 @@ """Tests rendering of thumbnails.""" -from builtins import range import base64 import json from omero.model import EllipseI, LengthI, LineI, \ diff --git a/components/tools/OmeroWeb/test/integration/test_tree.py b/components/tools/OmeroWeb/test/integration/test_tree.py index 86002ebcfa1..77375aab6fe 100644 --- a/components/tools/OmeroWeb/test/integration/test_tree.py +++ b/components/tools/OmeroWeb/test/integration/test_tree.py @@ -21,7 +21,6 @@ Simple integration tests for the "tree" module. """ -from builtins import str import pytest from omero.testlib import ITest diff --git a/components/tools/OmeroWeb/test/integration/test_tree_annotations.py b/components/tools/OmeroWeb/test/integration/test_tree_annotations.py index e7e911808b4..6fce89687a4 100644 --- a/components/tools/OmeroWeb/test/integration/test_tree_annotations.py +++ b/components/tools/OmeroWeb/test/integration/test_tree_annotations.py @@ -21,7 +21,6 @@ Integration tests for annotations methods in the "tree" module. """ -from builtins import zip import pytest import pytz from omero.testlib import ITest diff --git a/components/tools/OmeroWeb/test/integration/test_webadmin.py b/components/tools/OmeroWeb/test/integration/test_webadmin.py index 0983cbcd873..eb095f2c23d 100644 --- a/components/tools/OmeroWeb/test/integration/test_webadmin.py +++ b/components/tools/OmeroWeb/test/integration/test_webadmin.py @@ -20,7 +20,6 @@ along with this program. If not, see . """ -from builtins import zip import pytest from omeroweb.testlib import IWebTest from omeroweb.testlib import post, get diff --git a/examples/Training/python/Bulk_Shapes.py b/examples/Training/python/Bulk_Shapes.py index 85ce698d1e0..d57f76a7bab 100755 --- a/examples/Training/python/Bulk_Shapes.py +++ b/examples/Training/python/Bulk_Shapes.py @@ -11,7 +11,6 @@ FOR TRAINING PURPOSES ONLY! """ -from builtins import range import omero from omero.gateway import BlitzGateway from omero.rtypes import rdouble diff --git a/examples/Training/python/Create_Image.py b/examples/Training/python/Create_Image.py index 3f97428a00a..dc9921f00e1 100755 --- a/examples/Training/python/Create_Image.py +++ b/examples/Training/python/Create_Image.py @@ -11,7 +11,6 @@ FOR TRAINING PURPOSES ONLY! """ -from builtins import range from omero.gateway import BlitzGateway from Parse_OMERO_Properties import USERNAME, PASSWORD, HOST, PORT from Parse_OMERO_Properties import imageId diff --git a/examples/Training/python/Groups_Permissions.py b/examples/Training/python/Groups_Permissions.py index a69f26f0489..be320ac23a6 100755 --- a/examples/Training/python/Groups_Permissions.py +++ b/examples/Training/python/Groups_Permissions.py @@ -11,7 +11,6 @@ FOR TRAINING PURPOSES ONLY! """ -from builtins import str from omero.gateway import BlitzGateway from Parse_OMERO_Properties import USERNAME, PASSWORD, HOST, PORT from Parse_OMERO_Properties import imageId diff --git a/examples/Training/python/ROIs.py b/examples/Training/python/ROIs.py index 2eda1244d23..faca90cea4f 100755 --- a/examples/Training/python/ROIs.py +++ b/examples/Training/python/ROIs.py @@ -11,8 +11,6 @@ FOR TRAINING PURPOSES ONLY! """ -from builtins import str -from builtins import range import numpy import struct import math diff --git a/examples/Training/python/Raw_Data_Access.py b/examples/Training/python/Raw_Data_Access.py index c0f98d137f8..8073f23eadd 100755 --- a/examples/Training/python/Raw_Data_Access.py +++ b/examples/Training/python/Raw_Data_Access.py @@ -11,7 +11,6 @@ FOR TRAINING PURPOSES ONLY! """ -from builtins import range from omero.gateway import BlitzGateway from Parse_OMERO_Properties import USERNAME, PASSWORD, HOST, PORT from Parse_OMERO_Properties import imageId diff --git a/examples/Training/python/Read_Data.py b/examples/Training/python/Read_Data.py index 7c4a7b3f9b3..aad42868681 100755 --- a/examples/Training/python/Read_Data.py +++ b/examples/Training/python/Read_Data.py @@ -11,7 +11,6 @@ FOR TRAINING PURPOSES ONLY! """ -from builtins import range import omero from omero.gateway import BlitzGateway from Parse_OMERO_Properties import USERNAME, PASSWORD, HOST, PORT diff --git a/examples/Training/python/Render_Images.py b/examples/Training/python/Render_Images.py index 3fd0301ad40..1644fa471c4 100644 --- a/examples/Training/python/Render_Images.py +++ b/examples/Training/python/Render_Images.py @@ -11,7 +11,6 @@ FOR TRAINING PURPOSES ONLY! """ -from builtins import range from omero.gateway import BlitzGateway from io import BytesIO try: diff --git a/examples/Training/python/Tables.py b/examples/Training/python/Tables.py index 4a69d4f63d2..913c964e06a 100755 --- a/examples/Training/python/Tables.py +++ b/examples/Training/python/Tables.py @@ -11,8 +11,6 @@ FOR TRAINING PURPOSES ONLY! """ -from builtins import str -from builtins import range import omero import os import omero.grid diff --git a/examples/Training/python/Write_Data.py b/examples/Training/python/Write_Data.py index 7782076b45e..8f032eb79ed 100755 --- a/examples/Training/python/Write_Data.py +++ b/examples/Training/python/Write_Data.py @@ -11,7 +11,6 @@ FOR TRAINING PURPOSES ONLY! """ -from builtins import str import os import omero from omero.rtypes import rstring From 06081f1d8e14c4e7cb37d47e23c7c942e11eb981 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Besson?= Date: Mon, 22 Jan 2024 09:34:25 +0000 Subject: [PATCH 12/16] Fix miscellaneous flake8 warnings --- .../tools/OmeroPy/test/integration/gatewaytest/test_helpers.py | 1 - .../test/integration/metadata/test_metadata_mapannotations.py | 1 - .../tools/OmeroPy/test/integration/metadata/test_populate.py | 1 - .../tools/OmeroPy/test/integration/metadata/test_pydict_text.py | 1 - .../tools/OmeroPy/test/integration/test_rawpixelsstore.py | 1 - examples/Training/python/__main__.py | 2 +- 6 files changed, 1 insertion(+), 6 deletions(-) diff --git a/components/tools/OmeroPy/test/integration/gatewaytest/test_helpers.py b/components/tools/OmeroPy/test/integration/gatewaytest/test_helpers.py index e96f3b4e369..916b3c4f6ec 100644 --- a/components/tools/OmeroPy/test/integration/gatewaytest/test_helpers.py +++ b/components/tools/OmeroPy/test/integration/gatewaytest/test_helpers.py @@ -32,7 +32,6 @@ def testColorHolder(self): assert c1.getCss() == 'rgba(50,100,200,1.000)' def testOmeroType(self): - import sys omero_type = omero.gateway.omero_type assert isinstance(omero_type('rstring'), omero.RString) assert isinstance(omero_type(u'rstring'), omero.RString) diff --git a/components/tools/OmeroPy/test/integration/metadata/test_metadata_mapannotations.py b/components/tools/OmeroPy/test/integration/metadata/test_metadata_mapannotations.py index 9ca270e62ba..296764cf7b6 100644 --- a/components/tools/OmeroPy/test/integration/metadata/test_metadata_mapannotations.py +++ b/components/tools/OmeroPy/test/integration/metadata/test_metadata_mapannotations.py @@ -29,7 +29,6 @@ from omero.util.metadata_mapannotations import ( CanonicalMapAnnotation, MapAnnotationManager) import pytest -import sys def assert_equal_map_value(mva, mvb): diff --git a/components/tools/OmeroPy/test/integration/metadata/test_populate.py b/components/tools/OmeroPy/test/integration/metadata/test_populate.py index 4a35e778942..6a2b9ec07bd 100644 --- a/components/tools/OmeroPy/test/integration/metadata/test_populate.py +++ b/components/tools/OmeroPy/test/integration/metadata/test_populate.py @@ -31,7 +31,6 @@ import os.path import re import shutil -import sys from omero.api import RoiOptions from omero.grid import ImageColumn diff --git a/components/tools/OmeroPy/test/integration/metadata/test_pydict_text.py b/components/tools/OmeroPy/test/integration/metadata/test_pydict_text.py index 5048f810e1d..7ef851c73c0 100644 --- a/components/tools/OmeroPy/test/integration/metadata/test_pydict_text.py +++ b/components/tools/OmeroPy/test/integration/metadata/test_pydict_text.py @@ -28,7 +28,6 @@ from omero.util import pydict_text_io import pytest -import sys class TestPydictTextIo(ITest): diff --git a/components/tools/OmeroPy/test/integration/test_rawpixelsstore.py b/components/tools/OmeroPy/test/integration/test_rawpixelsstore.py index fe3a496c334..de9542a9489 100644 --- a/components/tools/OmeroPy/test/integration/test_rawpixelsstore.py +++ b/components/tools/OmeroPy/test/integration/test_rawpixelsstore.py @@ -12,7 +12,6 @@ import omero import threading from omero.testlib import ITest -import pytest from omero.util.tiles import TileLoopIteration from omero.util.tiles import RPSTileLoop diff --git a/examples/Training/python/__main__.py b/examples/Training/python/__main__.py index ff09529b38c..0bf664d0dc1 100755 --- a/examples/Training/python/__main__.py +++ b/examples/Training/python/__main__.py @@ -26,7 +26,7 @@ exec(os.path.join(training_dir, 'Tables.py')) exec(os.path.join(training_dir, 'Write_Data.py')) exec(os.path.join(training_dir, - 'Advanced/Create_Image_advanced.py')) + 'Advanced/Create_Image_advanced.py')) exec(os.path.join(training_dir, 'Advanced/Raw_Data_advanced.py')) exec(os.path.join(training_dir, 'Advanced/Read_Data_advanced.py')) exec(os.path.join(training_dir, 'Advanced/Write_data_advanced.py')) From 5d1f4d4e99a10b80a15e4dc6315b1d1395a644c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Besson?= Date: Tue, 23 Jan 2024 07:00:29 +0000 Subject: [PATCH 13/16] Fix exec invocation for training scripts --- examples/Training/python/__main__.py | 53 ++++++++++++++++------------ 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/examples/Training/python/__main__.py b/examples/Training/python/__main__.py index 0bf664d0dc1..058a6c95cee 100755 --- a/examples/Training/python/__main__.py +++ b/examples/Training/python/__main__.py @@ -12,26 +12,33 @@ if __name__ == "__main__": print("Running training suite") - exec(os.path.join(training_dir, 'Bulk_Shapes.py')) - exec(os.path.join(training_dir, 'Connect_To_OMERO.py')) - exec(os.path.join(training_dir, 'Create_Image.py')) - exec(os.path.join(training_dir, 'Delete.py')) - exec(os.path.join(training_dir, 'Filesets.py')) - exec(os.path.join(training_dir, 'Groups_Permissions.py')) - exec(os.path.join(training_dir, 'Metadata.py')) - exec(os.path.join(training_dir, 'Raw_Data_Access.py')) - exec(os.path.join(training_dir, 'Read_Data.py')) - exec(os.path.join(training_dir, 'Render_Images.py')) - exec(os.path.join(training_dir, 'ROIs.py')) - exec(os.path.join(training_dir, 'Tables.py')) - exec(os.path.join(training_dir, 'Write_Data.py')) - exec(os.path.join(training_dir, - 'Advanced/Create_Image_advanced.py')) - exec(os.path.join(training_dir, 'Advanced/Raw_Data_advanced.py')) - exec(os.path.join(training_dir, 'Advanced/Read_Data_advanced.py')) - exec(os.path.join(training_dir, 'Advanced/Write_data_advanced.py')) - exec(os.path.join(training_dir, 'Task_Scripts/Raw_Data2.py')) - exec(os.path.join(training_dir, 'Task_Scripts/Raw_Data_Task.py')) - exec(os.path.join(training_dir, 'Task_Scripts/Write_Data_4.py')) - exec(os.path.join(training_dir, 'Task_Scripts/Write_Data_3.py')) - exec(os.path.join(training_dir, 'Json_Api/Login.py')) + exec(open(os.path.join(training_dir, 'Bulk_Shapes.py')).read()) + exec(open(os.path.join(training_dir, 'Connect_To_OMERO.py')).read()) + exec(open(os.path.join(training_dir, 'Create_Image.py')).read()) + exec(open(os.path.join(training_dir, 'Delete.py')).read()) + exec(open(os.path.join(training_dir, 'Filesets.py')).read()) + exec(open(os.path.join(training_dir, 'Groups_Permissions.py')).read()) + exec(open(os.path.join(training_dir, 'Metadata.py')).read()) + exec(open(os.path.join(training_dir, 'Raw_Data_Access.py')).read()) + exec(open(os.path.join(training_dir, 'Read_Data.py')).read()) + exec(open(os.path.join(training_dir, 'Render_Images.py')).read()) + exec(open(os.path.join(training_dir, 'ROIs.py')).read()) + exec(open(os.path.join(training_dir, 'Tables.py')).read()) + exec(open(os.path.join(training_dir, 'Write_Data.py')).read()) + exec(open(os.path.join(training_dir, + 'Advanced/Create_Image_advanced.py')).read()) + exec(open(os.path.join(training_dir, + 'Advanced/Raw_Data_advanced.py')).read()) + exec(open(os.path.join(training_dir, + 'Advanced/Read_Data_advanced.py')).read()) + exec(open(os.path.join(training_dir, + 'Advanced/Write_data_advanced.py')).read()) + exec(open(os.path.join(training_dir, + 'Task_Scripts/Raw_Data2.py')).read()) + exec(open(os.path.join(training_dir, + 'Task_Scripts/Raw_Data_Task.py')).read()) + exec(open(os.path.join(training_dir, + 'Task_Scripts/Write_Data_4.py')).read()) + exec(open(os.path.join(training_dir, + 'Task_Scripts/Write_Data_3.py')).read()) + exec(open(os.path.join(training_dir, 'Json_Api/Login.py')).read()) From 2cab58de2fc7bb2713d8eb8ecd61f12d2678a32f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Besson?= Date: Tue, 23 Jan 2024 07:01:17 +0000 Subject: [PATCH 14/16] OMERO.web integration tests: expect timestamp without milliseconds --- .../tools/OmeroWeb/test/integration/test_tree_annotations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/tools/OmeroWeb/test/integration/test_tree_annotations.py b/components/tools/OmeroWeb/test/integration/test_tree_annotations.py index 6fce89687a4..c91f263112d 100644 --- a/components/tools/OmeroWeb/test/integration/test_tree_annotations.py +++ b/components/tools/OmeroWeb/test/integration/test_tree_annotations.py @@ -160,7 +160,7 @@ def annotate_project(ann, project, user): def expected_date(time): - d = datetime.fromtimestamp(time / 1000) + d = datetime.fromtimestamp(time // 1000) # Add time-zone awareness. Use default TIME_ZONE setting tz = pytz.timezone("Europe/London") d = tz.localize(d) From d8697c322ea0028105f855c6db3ea8e8b2e0d440 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Fri, 15 Mar 2024 21:40:03 +0000 Subject: [PATCH 15/16] build with various Python version --- .github/workflows/source_build.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/source_build.yml b/.github/workflows/source_build.yml index 9941f3743e1..64b9174e23e 100644 --- a/.github/workflows/source_build.yml +++ b/.github/workflows/source_build.yml @@ -12,15 +12,22 @@ jobs: build_bf: [false] build_zarr: [false] build_snapshot: [false] + python-version: + - '3.10' + - '3.11' + - '3.12' name: Build OMERO from source runs-on: ubuntu-22.04 env: ICE_HOME: /opt/ice-3.6.5 steps: - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} - name: Install Ice and Ice python binding if: matrix.build_snapshot - uses: ome/action-ice@v3 + uses: jburel/action-ice@v3 - name: Set up Gradle 6.8.3 if: matrix.build_snapshot uses: gradle/gradle-build-action@v2 @@ -30,7 +37,7 @@ jobs: build-root-directory: components/tools/OmeroJava # required by the action to have a *.gradle file" - name: Install and run flake8 run: | - pip install flake8 + pip install flake8 setuptools flake8 . - name: install dependencies run: | From 25b2c9195986ee978bacd6b4ae32d6dca42587c2 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Sat, 16 Mar 2024 19:59:30 +0000 Subject: [PATCH 16/16] cap setuptools --- .github/workflows/source_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/source_build.yml b/.github/workflows/source_build.yml index 64b9174e23e..ca698df75b4 100644 --- a/.github/workflows/source_build.yml +++ b/.github/workflows/source_build.yml @@ -37,7 +37,7 @@ jobs: build-root-directory: components/tools/OmeroJava # required by the action to have a *.gradle file" - name: Install and run flake8 run: | - pip install flake8 setuptools + pip install flake8 'setuptools<69' flake8 . - name: install dependencies run: |