From 95c35f9c4b9f8b06150f4ffedc5440d9d2119ad4 Mon Sep 17 00:00:00 2001 From: Ba Thien Le Date: Thu, 7 Nov 2024 16:01:05 +0100 Subject: [PATCH] chore: remove future import (#66) --- cytomine/cytomine.py | 25 ++++++++++++------------- cytomine/models/__init__.py | 5 +---- cytomine/models/_utilities/__init__.py | 6 +++--- cytomine/models/_utilities/parallel.py | 2 +- cytomine/models/annotation.py | 12 +++--------- cytomine/models/collection.py | 11 ++++------- cytomine/models/image.py | 9 ++------- cytomine/models/imagegroup.py | 8 -------- cytomine/models/model.py | 7 +------ cytomine/models/ontology.py | 7 ------- cytomine/models/project.py | 7 ------- cytomine/models/property.py | 8 +------- cytomine/models/social.py | 6 ------ cytomine/models/storage.py | 5 ----- cytomine/models/track.py | 6 ------ cytomine/models/user.py | 5 ----- cytomine/utilities/annotations.py | 1 - examples/add_annotation.py | 13 ++++++------- examples/add_annotation_links.py | 13 +++++++------ examples/add_imagegroup.py | 6 ------ examples/add_ontology.py | 14 ++++++-------- examples/add_properties.py | 9 +-------- examples/add_tag.py | 14 ++++++-------- examples/add_user.py | 7 ------- examples/calibrate_image.py | 4 +++- examples/delete_annotations.py | 7 ------- examples/get_annotations.py | 10 +--------- examples/get_annotations_bbox.py | 5 ----- examples/get_images.py | 7 ------- examples/get_included_annotations.py | 7 ------- examples/get_projects_paginator.py | 7 ------- examples/get_terms.py | 7 ------- examples/test.py | 1 - examples/upload_image.py | 11 ++--------- requirements.txt | 2 -- setup.py | 1 - tests/__init__.py | 5 ----- tests/conftest.py | 25 +++++++++++++------------ tests/test_annotation.py | 13 ------------- tests/test_image.py | 9 +-------- tests/test_ontology.py | 7 ------- tests/test_project.py | 9 --------- tests/test_property.py | 7 ------- tests/test_social.py | 9 --------- tests/test_storage.py | 7 ------- tests/test_user.py | 7 ------- 46 files changed, 74 insertions(+), 299 deletions(-) diff --git a/cytomine/cytomine.py b/cytomine/cytomine.py index 641f539..4a9418f 100644 --- a/cytomine/cytomine.py +++ b/cytomine/cytomine.py @@ -14,31 +14,26 @@ # * See the License for the specific language governing permissions and # * limitations under the License. -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - try: from json.decoder import JSONDecodeError except ImportError: # Python 2 JSONDecodeError = ValueError -import logging import base64 +import functools import hashlib import hmac -import sys +import logging import os -import requests import shutil -import warnings -import functools +import sys import time -from time import strftime, gmtime -from future.builtins import bytes +import warnings from argparse import ArgumentParser +from time import gmtime, strftime + +import requests from cachecontrol import CacheControlAdapter from requests_toolbelt import MultipartEncoder from requests_toolbelt.utils import dump @@ -729,8 +724,12 @@ def upload_image(self, filename, id_storage, id_project=None, return False def _process_upload_response(self, response_data): + from .models.image import ( + AbstractImage, + ImageInstance, + ImageInstanceCollection, + ) from .models.storage import UploadedFile - from .models.image import AbstractImage, ImageInstance, ImageInstanceCollection self._logger.debug("Entering _process_upload_response(response_data=%s)", response_data) diff --git a/cytomine/models/__init__.py b/cytomine/models/__init__.py index fa45c39..4b56a3e 100755 --- a/cytomine/models/__init__.py +++ b/cytomine/models/__init__.py @@ -51,10 +51,7 @@ Term, TermCollection, ) -from .project import ( - Project, - ProjectCollection, -) +from .project import Project, ProjectCollection from .property import ( AttachedFile, AttachedFileCollection, diff --git a/cytomine/models/_utilities/__init__.py b/cytomine/models/_utilities/__init__.py index 6ca8c20..e945bc3 100644 --- a/cytomine/models/_utilities/__init__.py +++ b/cytomine/models/_utilities/__init__.py @@ -14,6 +14,6 @@ # * See the License for the specific language governing permissions and # * limitations under the License. -from .parallel import generic_download, makedirs, is_false -from .dump import generic_image_dump, DumpError -from .pattern_matching import resolve_pattern, is_iterable \ No newline at end of file +from .dump import DumpError, generic_image_dump +from .parallel import generic_download, is_false, makedirs +from .pattern_matching import is_iterable, resolve_pattern diff --git a/cytomine/models/_utilities/parallel.py b/cytomine/models/_utilities/parallel.py index 37c8b9b..3761cbe 100644 --- a/cytomine/models/_utilities/parallel.py +++ b/cytomine/models/_utilities/parallel.py @@ -22,8 +22,8 @@ except ImportError: import Queue as queue -from threading import Thread from multiprocessing import cpu_count +from threading import Thread def is_false(v): diff --git a/cytomine/models/annotation.py b/cytomine/models/annotation.py index ed70bb3..ed8eb6a 100644 --- a/cytomine/models/annotation.py +++ b/cytomine/models/annotation.py @@ -14,19 +14,13 @@ # * See the License for the specific language governing permissions and # * limitations under the License. -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - - import os -import re from cytomine.cytomine import Cytomine -from cytomine.models.collection import Collection, CollectionPartialUploadException +from cytomine.models.collection import Collection from cytomine.models.model import Model -from ._utilities import generic_image_dump, generic_download, is_false + +from ._utilities import generic_download, generic_image_dump, is_false class Annotation(Model): diff --git a/cytomine/models/collection.py b/cytomine/models/collection.py index fac0c07..ca42732 100644 --- a/cytomine/models/collection.py +++ b/cytomine/models/collection.py @@ -14,25 +14,22 @@ # * See the License for the specific language governing permissions and # * limitations under the License. -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - - # Importing collections.abc objects from collections is deprecated # since python 3.3. from sys import version_info + if version_info.major < 3 or \ (version_info.major == 3 and version_info.minor < 3): from collections import MutableSequence else: from collections.abc import MutableSequence -import six import copy +import six + from cytomine.cytomine import Cytomine + from ._utilities.parallel import generic_chunk_parallel diff --git a/cytomine/models/image.py b/cytomine/models/image.py index c7a36f9..c3c3be1 100755 --- a/cytomine/models/image.py +++ b/cytomine/models/image.py @@ -14,18 +14,13 @@ # * See the License for the specific language governing permissions and # * limitations under the License. -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - - -import re import os +import re from cytomine.cytomine import Cytomine, deprecated from cytomine.models.collection import Collection from cytomine.models.model import Model + from ._utilities import generic_image_dump diff --git a/cytomine/models/imagegroup.py b/cytomine/models/imagegroup.py index 4993aa2..919c064 100644 --- a/cytomine/models/imagegroup.py +++ b/cytomine/models/imagegroup.py @@ -14,14 +14,6 @@ # * See the License for the specific language governing permissions and # * limitations under the License. -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - -import re -import os - __author__ = "Rubens Ulysse " __contributors__ = ["Marée Raphaël ", "Mormont Romain "] __copyright__ = "Copyright 2010-2022 University of Liège, Belgium, http://www.cytomine.be/" diff --git a/cytomine/models/model.py b/cytomine/models/model.py index 958ab8f..f0bd836 100755 --- a/cytomine/models/model.py +++ b/cytomine/models/model.py @@ -14,14 +14,9 @@ # * See the License for the specific language governing permissions and # * limitations under the License. -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - +import json import six -import json from cytomine.cytomine import Cytomine diff --git a/cytomine/models/ontology.py b/cytomine/models/ontology.py index 2921043..7b13e63 100755 --- a/cytomine/models/ontology.py +++ b/cytomine/models/ontology.py @@ -14,14 +14,7 @@ # * See the License for the specific language governing permissions and # * limitations under the License. -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - from cytomine.cytomine import Cytomine - - from cytomine.models.collection import Collection from cytomine.models.model import Model diff --git a/cytomine/models/project.py b/cytomine/models/project.py index 1a02dc5..d5aa223 100755 --- a/cytomine/models/project.py +++ b/cytomine/models/project.py @@ -14,14 +14,7 @@ # * See the License for the specific language governing permissions and # * limitations under the License. -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - from cytomine import Cytomine - - from cytomine.models.collection import Collection from cytomine.models.model import Model diff --git a/cytomine/models/property.py b/cytomine/models/property.py index 8b41d4d..c30a4d4 100644 --- a/cytomine/models/property.py +++ b/cytomine/models/property.py @@ -14,18 +14,12 @@ # * See the License for the specific language governing permissions and # * limitations under the License. -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - import re - from cytomine.cytomine import Cytomine from cytomine.models.annotation import Annotation from cytomine.models.collection import Collection, DomainCollection -from cytomine.models.model import Model, DomainModel +from cytomine.models.model import DomainModel, Model class Property(DomainModel): diff --git a/cytomine/models/social.py b/cytomine/models/social.py index b52d610..34dba3a 100644 --- a/cytomine/models/social.py +++ b/cytomine/models/social.py @@ -14,12 +14,6 @@ # * See the License for the specific language governing permissions and # * limitations under the License. -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - - from cytomine.models.collection import Collection from cytomine.models.model import Model diff --git a/cytomine/models/storage.py b/cytomine/models/storage.py index c393c3c..26dfc43 100644 --- a/cytomine/models/storage.py +++ b/cytomine/models/storage.py @@ -14,11 +14,6 @@ # * See the License for the specific language governing permissions and # * limitations under the License. -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - from cytomine.models.collection import Collection from cytomine.models.model import Model diff --git a/cytomine/models/track.py b/cytomine/models/track.py index f4fcfdd..2b0771c 100644 --- a/cytomine/models/track.py +++ b/cytomine/models/track.py @@ -14,12 +14,6 @@ # * See the License for the specific language governing permissions and # * limitations under the License. -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - - from cytomine.cytomine import Cytomine from cytomine.models.collection import Collection from cytomine.models.model import Model diff --git a/cytomine/models/user.py b/cytomine/models/user.py index c0127d6..0c1133b 100755 --- a/cytomine/models/user.py +++ b/cytomine/models/user.py @@ -14,11 +14,6 @@ # * See the License for the specific language governing permissions and # * limitations under the License. -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - from cytomine.cytomine import Cytomine from cytomine.models.collection import Collection diff --git a/cytomine/utilities/annotations.py b/cytomine/utilities/annotations.py index 57ddfb1..54f2d5e 100644 --- a/cytomine/utilities/annotations.py +++ b/cytomine/utilities/annotations.py @@ -1,6 +1,5 @@ from cytomine.models import AnnotationCollection - REVIEWED_INCLUDE = 1 REVIEWED_ONLY = 2 REVIEWED_EXCLUDE = 0 diff --git a/examples/add_annotation.py b/examples/add_annotation.py index 6d862d4..1456b6d 100644 --- a/examples/add_annotation.py +++ b/examples/add_annotation.py @@ -14,10 +14,6 @@ # * See the License for the specific language governing permissions and # * limitations under the License. -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals import logging import sys @@ -26,9 +22,12 @@ from shapely.geometry import Point, box from cytomine import Cytomine -from cytomine.models import Property, Annotation, AnnotationTerm, AnnotationCollection - - +from cytomine.models import ( + Annotation, + AnnotationCollection, + AnnotationTerm, + Property, +) logging.basicConfig() logger = logging.getLogger("cytomine.client") diff --git a/examples/add_annotation_links.py b/examples/add_annotation_links.py index 8e88994..2216a38 100644 --- a/examples/add_annotation_links.py +++ b/examples/add_annotation_links.py @@ -14,10 +14,6 @@ # * See the License for the specific language governing permissions and # * limitations under the License. -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals import logging import sys @@ -26,8 +22,13 @@ from shapely.geometry import Point, box from cytomine import Cytomine -from cytomine.models import Annotation, AnnotationCollection, \ - ImageGroupImageInstanceCollection, AnnotationGroup, AnnotationLink +from cytomine.models import ( + Annotation, + AnnotationCollection, + AnnotationGroup, + AnnotationLink, + ImageGroupImageInstanceCollection, +) logging.basicConfig() logger = logging.getLogger("cytomine.client") diff --git a/examples/add_imagegroup.py b/examples/add_imagegroup.py index c94e061..21de5c9 100644 --- a/examples/add_imagegroup.py +++ b/examples/add_imagegroup.py @@ -14,16 +14,10 @@ # * See the License for the specific language governing permissions and # * limitations under the License. -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - import logging import sys from argparse import ArgumentParser - from cytomine import Cytomine from cytomine.models import ImageGroup, ImageGroupImageInstance from cytomine.models.image import ImageInstanceCollection diff --git a/examples/add_ontology.py b/examples/add_ontology.py index 90448a4..24b1c85 100644 --- a/examples/add_ontology.py +++ b/examples/add_ontology.py @@ -14,19 +14,17 @@ # * See the License for the specific language governing permissions and # * limitations under the License. -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - import logging import sys from argparse import ArgumentParser from cytomine import Cytomine -from cytomine.models.ontology import Ontology, Term, RelationTerm, TermCollection - - +from cytomine.models.ontology import ( + Ontology, + RelationTerm, + Term, + TermCollection, +) logging.basicConfig() logger = logging.getLogger("cytomine.client") diff --git a/examples/add_properties.py b/examples/add_properties.py index 443eb9a..b903654 100644 --- a/examples/add_properties.py +++ b/examples/add_properties.py @@ -14,19 +14,12 @@ # * See the License for the specific language governing permissions and # * limitations under the License. -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - import logging import sys from argparse import ArgumentParser from cytomine import Cytomine -from cytomine.models import Property, Project, Annotation, ImageInstance - - +from cytomine.models import Annotation, ImageInstance, Project, Property logging.basicConfig() logger = logging.getLogger("cytomine.client") diff --git a/examples/add_tag.py b/examples/add_tag.py index 0eb704a..005cf7a 100644 --- a/examples/add_tag.py +++ b/examples/add_tag.py @@ -14,19 +14,17 @@ # * See the License for the specific language governing permissions and # * limitations under the License. -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - import logging import sys from argparse import ArgumentParser from cytomine import Cytomine -from cytomine.models import ImageInstance, Tag, TagDomainAssociation, TagDomainAssociationCollection - - +from cytomine.models import ( + ImageInstance, + Tag, + TagDomainAssociation, + TagDomainAssociationCollection, +) logging.basicConfig() logger = logging.getLogger("cytomine.client") diff --git a/examples/add_user.py b/examples/add_user.py index 5cd85a8..a1984d4 100644 --- a/examples/add_user.py +++ b/examples/add_user.py @@ -14,17 +14,10 @@ # * See the License for the specific language governing permissions and # * limitations under the License. -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - import logging import sys from argparse import ArgumentParser - - logging.basicConfig() logger = logging.getLogger("cytomine.client") logger.setLevel(logging.INFO) diff --git a/examples/calibrate_image.py b/examples/calibrate_image.py index b99b3db..1664480 100644 --- a/examples/calibrate_image.py +++ b/examples/calibrate_image.py @@ -50,8 +50,10 @@ # Import of all python necessary modules, including the Cytomine Python client import logging from argparse import ArgumentParser + from cytomine import Cytomine -from cytomine.models import ImageInstance, AbstractImage +from cytomine.models import AbstractImage, ImageInstance + # ----------------------------------------------------------------------------------------------------------- # Parsing all the arguments from the command line if __name__ == '__main__': diff --git a/examples/delete_annotations.py b/examples/delete_annotations.py index 1a777d0..10d947d 100644 --- a/examples/delete_annotations.py +++ b/examples/delete_annotations.py @@ -14,11 +14,6 @@ # * See the License for the specific language governing permissions and # * limitations under the License. -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - import logging import sys from argparse import ArgumentParser @@ -28,8 +23,6 @@ from cytomine import Cytomine from cytomine.models import AnnotationCollection - - logging.basicConfig() logger = logging.getLogger("cytomine.client") logger.setLevel(logging.INFO) diff --git a/examples/get_annotations.py b/examples/get_annotations.py index df03dcb..a3a701e 100644 --- a/examples/get_annotations.py +++ b/examples/get_annotations.py @@ -14,17 +14,11 @@ # * See the License for the specific language governing permissions and # * limitations under the License. -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - import logging +import os import sys from argparse import ArgumentParser -import os - from shapely import wkt from shapely.affinity import affine_transform @@ -32,8 +26,6 @@ from cytomine.models import AnnotationCollection, ImageInstanceCollection - - def get_by_id(haystack, needle): return next((item for item in haystack if item.id == needle), None) diff --git a/examples/get_annotations_bbox.py b/examples/get_annotations_bbox.py index 2315880..e2fbd2d 100644 --- a/examples/get_annotations_bbox.py +++ b/examples/get_annotations_bbox.py @@ -14,11 +14,6 @@ # * See the License for the specific language governing permissions and # * limitations under the License. -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - import logging import sys from argparse import ArgumentParser diff --git a/examples/get_images.py b/examples/get_images.py index 5751e5f..eff2c3f 100644 --- a/examples/get_images.py +++ b/examples/get_images.py @@ -14,11 +14,6 @@ # * See the License for the specific language governing permissions and # * limitations under the License. -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - import logging import os import sys @@ -27,8 +22,6 @@ from cytomine import Cytomine from cytomine.models.image import ImageInstanceCollection - - # This example script allows you to get the list of images (metadata) in a given project. # If a download path is provided, it downloads all original images like they have been uploaded to Cytomine. diff --git a/examples/get_included_annotations.py b/examples/get_included_annotations.py index c13a99f..4c696f3 100644 --- a/examples/get_included_annotations.py +++ b/examples/get_included_annotations.py @@ -14,11 +14,6 @@ # * See the License for the specific language governing permissions and # * limitations under the License. -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - import logging import sys from argparse import ArgumentParser @@ -26,8 +21,6 @@ from cytomine import Cytomine from cytomine.models import AnnotationCollection - - logging.basicConfig() logger = logging.getLogger("cytomine.client") logger.setLevel(logging.INFO) diff --git a/examples/get_projects_paginator.py b/examples/get_projects_paginator.py index 3eb9f01..068b8fc 100644 --- a/examples/get_projects_paginator.py +++ b/examples/get_projects_paginator.py @@ -14,11 +14,6 @@ # * See the License for the specific language governing permissions and # * limitations under the License. -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - import logging import sys from argparse import ArgumentParser @@ -26,8 +21,6 @@ from cytomine import Cytomine from cytomine.models import ProjectCollection - - logging.basicConfig() logger = logging.getLogger("cytomine.client") logger.setLevel(logging.INFO) diff --git a/examples/get_terms.py b/examples/get_terms.py index c143c58..a096000 100644 --- a/examples/get_terms.py +++ b/examples/get_terms.py @@ -14,20 +14,13 @@ # * See the License for the specific language governing permissions and # * limitations under the License. -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - import logging import sys from argparse import ArgumentParser - from cytomine import Cytomine from cytomine.models import TermCollection - # This example script allows you to get the list of terms (labels) in a project. logging.basicConfig() diff --git a/examples/test.py b/examples/test.py index ce9009b..86b4801 100644 --- a/examples/test.py +++ b/examples/test.py @@ -21,7 +21,6 @@ import sys from argparse import ArgumentParser - if __name__ == '__main__': from cytomine import Cytomine from cytomine.models.user import * diff --git a/examples/upload_image.py b/examples/upload_image.py index 8f754e9..154e0a4 100644 --- a/examples/upload_image.py +++ b/examples/upload_image.py @@ -14,20 +14,13 @@ # * See the License for the specific language governing permissions and # * limitations under the License. -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - import logging +import os import sys from argparse import ArgumentParser -import os - from cytomine import Cytomine -from cytomine.models import StorageCollection, Project, UploadedFile - +from cytomine.models import Project, StorageCollection, UploadedFile logging.basicConfig() logger = logging.getLogger("cytomine.client") diff --git a/requirements.txt b/requirements.txt index c9c1aed..ac7c09d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,8 +10,6 @@ certifi==2022.12.7 # via requests charset-normalizer==2.0.12 # via requests -future==0.18.3 - # via cytomine-python-client (setup.py) idna==3.2 # via requests msgpack==1.0.2 diff --git a/setup.py b/setup.py index 28b6afb..5275940 100644 --- a/setup.py +++ b/setup.py @@ -42,7 +42,6 @@ 'CacheControl>=0.12.10', 'Shapely>=1.6.4', 'six>=1.11.0', - 'future>=0.17.1', 'requests>=2.27.1', 'urllib3>=1.25.2'], setup_requires=['pytest-runner'], diff --git a/tests/__init__.py b/tests/__init__.py index c28b03a..4a8f341 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -13,8 +13,3 @@ # * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # * See the License for the specific language governing permissions and # * limitations under the License. - -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals diff --git a/tests/conftest.py b/tests/conftest.py index 459a4ca..234c73a 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -14,25 +14,26 @@ # * See the License for the specific language governing permissions and # * limitations under the License. -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals +import logging +import random +import string + +import pytest from cytomine.cytomine import Cytomine -from cytomine.models.storage import Storage, UploadedFile from cytomine.models.annotation import Annotation -from cytomine.models.image import AbstractImage, ImageInstance, AbstractSlice, ImageServerCollection +from cytomine.models.image import ( + AbstractImage, + AbstractSlice, + ImageInstance, + ImageServerCollection, +) from cytomine.models.ontology import Ontology, Term from cytomine.models.project import Project from cytomine.models.property import Tag -from cytomine.models.user import User +from cytomine.models.storage import Storage, UploadedFile from cytomine.models.track import Track - -import pytest -import string -import random -import logging +from cytomine.models.user import User def random_string(length=10): diff --git a/tests/test_annotation.py b/tests/test_annotation.py index 81b4f70..cf639ae 100644 --- a/tests/test_annotation.py +++ b/tests/test_annotation.py @@ -14,20 +14,7 @@ # * See the License for the specific language governing permissions and # * limitations under the License. -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - from cytomine.models.annotation import * -from tests.conftest import random_string - - class TestAnnotation: diff --git a/tests/test_image.py b/tests/test_image.py index 4930a8c..937818a 100644 --- a/tests/test_image.py +++ b/tests/test_image.py @@ -14,18 +14,11 @@ # * See the License for the specific language governing permissions and # * limitations under the License. -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals +import pytest from cytomine.models.image import * from tests.conftest import random_string -import pytest - - - class TestAbstractImage: def test_abstract_image(self, connect, dataset): diff --git a/tests/test_ontology.py b/tests/test_ontology.py index c92ce0d..dbbb3e5 100644 --- a/tests/test_ontology.py +++ b/tests/test_ontology.py @@ -14,17 +14,10 @@ # * See the License for the specific language governing permissions and # * limitations under the License. -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - from cytomine.models.ontology import * from tests.conftest import random_string - - class TestOntology: def test_ontology(self, connect, dataset): name = random_string() diff --git a/tests/test_project.py b/tests/test_project.py index 7667a58..d6b10a9 100644 --- a/tests/test_project.py +++ b/tests/test_project.py @@ -14,19 +14,10 @@ # * See the License for the specific language governing permissions and # * limitations under the License. -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - -import pytest - from cytomine.models.project import * from tests.conftest import random_string - - class TestProject: def test_project(self, connect, dataset): name = random_string() diff --git a/tests/test_property.py b/tests/test_property.py index 76de9dd..9fd20f1 100644 --- a/tests/test_property.py +++ b/tests/test_property.py @@ -14,19 +14,12 @@ # * See the License for the specific language governing permissions and # * limitations under the License. -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - import os from cytomine.models.property import * from tests.conftest import random_string - - class TestProperty: def test_property(self, connect, dataset): value = random_string() diff --git a/tests/test_social.py b/tests/test_social.py index 1177b1a..1047f57 100644 --- a/tests/test_social.py +++ b/tests/test_social.py @@ -14,17 +14,8 @@ # * See the License for the specific language governing permissions and # * limitations under the License. -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - -import pytest from cytomine.models.social import * -from tests.conftest import random_string - - class TestPosition: diff --git a/tests/test_storage.py b/tests/test_storage.py index 44e84eb..df38110 100644 --- a/tests/test_storage.py +++ b/tests/test_storage.py @@ -14,17 +14,10 @@ # * See the License for the specific language governing permissions and # * limitations under the License. -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - from cytomine.models.storage import * from tests.conftest import random_string - - class TestStorage: def test_storage(self, connect, dataset): name = random_string() diff --git a/tests/test_user.py b/tests/test_user.py index b67ff66..20ba9c0 100644 --- a/tests/test_user.py +++ b/tests/test_user.py @@ -14,17 +14,10 @@ # * See the License for the specific language governing permissions and # * limitations under the License. -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - from cytomine.models.user import * from tests.conftest import random_string - - class TestUser: def test_user(self, connect, dataset): name = random_string()