Skip to content

Commit

Permalink
Remove unused imports
Browse files Browse the repository at this point in the history
  • Loading branch information
deepsource-autofix[bot] authored Apr 23, 2020
1 parent 37502fa commit f07e005
Show file tree
Hide file tree
Showing 24 changed files with 8 additions and 47 deletions.
1 change: 0 additions & 1 deletion examples/properties_dictionary.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from labthings.server.types import data_dict_to_schema

import logging
from pprint import pprint

logger = logging.getLogger(__name__)
logger.setLevel(logging.ERROR)
Expand Down
12 changes: 1 addition & 11 deletions examples/simple_extensions.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,14 @@
import random
import math
import time
import logging

from labthings.server.quick import create_app
from labthings.server.decorators import (
ThingAction,
ThingProperty,
PropertySchema,
use_args,
use_body,
marshal_task,
marshal_with,
)
ThingProperty, PropertySchema)
from labthings.server.view import View
from labthings.server.find import find_component
from labthings.server import fields
from labthings.core.tasks import taskify
from labthings.core.utilities import path_relative_to
import os

from labthings.server.extensions import BaseExtension

Expand Down
5 changes: 1 addition & 4 deletions labthings/server/decorators.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from webargs import flaskparser
from functools import wraps, update_wrapper
from flask import make_response, abort, request
from flask import abort, request
from werkzeug.wrappers import Response as ResponseBase
from http import HTTPStatus
from marshmallow.exceptions import ValidationError
Expand All @@ -20,9 +20,6 @@

import logging

# Useful externals to have included here
from marshmallow import pre_dump, pre_load


class marshal_with:
def __init__(self, schema, code=200):
Expand Down
6 changes: 2 additions & 4 deletions labthings/server/labthing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from flask import url_for, jsonify
from flask import url_for
from apispec import APISpec
from apispec.ext.marshmallow import MarshmallowPlugin

Expand All @@ -9,7 +9,7 @@
EXTENSION_LIST_ENDPOINT,
)
from .extensions import BaseExtension
from .utilities import description_from_view, clean_url_string
from .utilities import clean_url_string
from .exceptions import JSONExceptionHandler
from .logging import LabThingLogger
from .representations import LabThingsJSONEncoder
Expand All @@ -25,8 +25,6 @@
from .default_views.root import RootView
from .default_views.sockets import socket_handler

from ..core.utilities import get_docstring

import weakref
import logging

Expand Down
1 change: 0 additions & 1 deletion labthings/server/quick.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from flask_cors import CORS

from .labthing import LabThing
from .exceptions import JSONExceptionHandler


def create_app(
Expand Down
2 changes: 1 addition & 1 deletion labthings/server/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from werkzeug.routing import BuildError
import marshmallow

from .names import TASK_ENDPOINT, TASK_LIST_ENDPOINT, EXTENSION_LIST_ENDPOINT
from .names import TASK_ENDPOINT, EXTENSION_LIST_ENDPOINT
from .utilities import view_class_from_endpoint, description_from_view
from . import fields

Expand Down
4 changes: 0 additions & 4 deletions labthings/server/sockets/base.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# -*- coding: utf-8 -*-

from werkzeug.routing import Map, Rule
from werkzeug.exceptions import NotFound
from werkzeug.http import parse_cookie
from flask import request, current_app
import logging
from abc import ABC, abstractmethod

from ..representations import encode_json
Expand Down
2 changes: 0 additions & 2 deletions labthings/server/sockets/gevent.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
from werkzeug.http import parse_cookie
from flask import request
import gevent
import time
import logging

from .base import BaseSockets, process_socket_message

Expand Down
2 changes: 1 addition & 1 deletion labthings/server/view/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
)
from . import View

from flask import send_from_directory, abort
from flask import send_from_directory
import uuid


Expand Down
2 changes: 0 additions & 2 deletions labthings/server/wsgi/gevent.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
import gevent
import socket
import logging
import sys
import os
import signal
from werkzeug.debug import DebuggedApplication

Expand Down
2 changes: 0 additions & 2 deletions tests/test_core_event.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import pytest
import gevent
from gevent.hub import getcurrent

from labthings.core import event

Expand Down
1 change: 0 additions & 1 deletion tests/test_core_exceptions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from labthings.core import exceptions
import pytest


def test_lockerror_valid_code():
Expand Down
1 change: 0 additions & 1 deletion tests/test_core_tasks_pool.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from labthings.core import tasks
import pytest

import gevent

Expand Down
1 change: 0 additions & 1 deletion tests/test_core_tasks_thread.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from labthings.core.tasks import thread
import pytest

import gevent
from gevent.thread import get_ident
Expand Down
2 changes: 0 additions & 2 deletions tests/test_server_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

from marshmallow import Schema as _Schema
from flask import make_response

from labthings.server.schema import Schema
from labthings.server import fields
from labthings.server.view import View
from labthings.core.tasks.thread import TaskThread
Expand Down
1 change: 0 additions & 1 deletion tests/test_server_quick.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import pytest

from labthings.server import quick

Expand Down
2 changes: 1 addition & 1 deletion tests/test_server_representations.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from labthings.server import representations
from flask import Flask, Response
from flask import Response
import pytest


Expand Down
1 change: 0 additions & 1 deletion tests/test_server_sockets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import json
from flask import Blueprint
from werkzeug.routing import Map


def test_socket_subscriber_property_notify(view_cls, fake_websocket):
Expand Down
1 change: 0 additions & 1 deletion tests/test_server_spec_apispec.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import pytest

from labthings.server.spec import apispec
from labthings.server.view import View
Expand Down
1 change: 0 additions & 1 deletion tests/test_server_spec_paths.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import pytest

from labthings.server.spec import paths

Expand Down
1 change: 0 additions & 1 deletion tests/test_server_spec_utilities.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from labthings.server.spec import utilities
import json
from marshmallow import fields
import pytest

Expand Down
2 changes: 1 addition & 1 deletion tests/test_server_types.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from labthings.server import types, fields
from labthings.server.types.registry import TypeRegistry, _field_factory
from labthings.server.types.registry import TypeRegistry
import pytest

from fractions import Fraction
Expand Down
1 change: 0 additions & 1 deletion tests/test_server_utilities.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import pytest

from labthings.server import utilities
from labthings.server.view import View
Expand Down
1 change: 0 additions & 1 deletion tests/test_server_view_builder.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import pytest

from labthings.server.view import builder

Expand Down

0 comments on commit f07e005

Please sign in to comment.