Commit ffa2153e authored by Vasilis Tsiligiannis's avatar Vasilis Tsiligiannis

tox: Introduce 'isort' check, reformat imports

Signed-off-by: Vasilis Tsiligiannis's avatarVasilis Tsiligiannis <[email protected]>
parent 6a2fde91
...@@ -4,6 +4,7 @@ ignore=_version.py ...@@ -4,6 +4,7 @@ ignore=_version.py
[MESSAGES CONTROL] [MESSAGES CONTROL]
disable= disable=
C0111, C0111,
C0412,
R0902, R0902,
R0912, R0912,
R0913, R0913,
......
...@@ -11,11 +11,11 @@ import time ...@@ -11,11 +11,11 @@ import time
from validators.url import url from validators.url import url
import satnogsclient.config import satnogsclient.config
from satnogsclient.settings import (SATNOGS_API_TOKEN, DEFAULT_LOGGING, SATNOGS_STATION_ID,
SATNOGS_STATION_LAT, SATNOGS_STATION_LON, SATNOGS_STATION_ELEV,
SATNOGS_NETWORK_API_URL, GPSD_ENABLED)
from satnogsclient.scheduler.tasks import status_listener, exec_rigctld
from satnogsclient.locator import locator from satnogsclient.locator import locator
from satnogsclient.scheduler.tasks import exec_rigctld, status_listener
from satnogsclient.settings import DEFAULT_LOGGING, GPSD_ENABLED, \
SATNOGS_API_TOKEN, SATNOGS_NETWORK_API_URL, SATNOGS_STATION_ELEV, \
SATNOGS_STATION_ID, SATNOGS_STATION_LAT, SATNOGS_STATION_LON
__author__ = satnogsclient.config.AUTHOR __author__ = satnogsclient.config.AUTHOR
__email__ = satnogsclient.config.EMAIL __email__ = satnogsclient.config.EMAIL
......
...@@ -4,6 +4,7 @@ SatNOGS Client module main function ...@@ -4,6 +4,7 @@ SatNOGS Client module main function
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
import sys import sys
import satnogsclient import satnogsclient
if __name__ == '__main__': if __name__ == '__main__':
......
import time
import logging import logging
import logging.config import logging.config
import time
import gps import gps
from satnogsclient import settings from satnogsclient import settings
LOGGER = logging.getLogger('satnogsclient') LOGGER = logging.getLogger('satnogsclient')
......
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
import json
import logging import logging
import os import os
try:
from urllib.parse import urljoin
except ImportError:
from urlparse import urljoin
from datetime import datetime
from time import sleep
import json
import shlex import shlex
import subprocess import subprocess
import requests from datetime import datetime
from time import sleep
import numpy as np
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import numpy as np
import requests
import satnogsclient.config import satnogsclient.config
from satnogsclient import settings from satnogsclient import settings
from satnogsclient.observer.worker import WorkerFreq, WorkerTrack from satnogsclient.observer.worker import WorkerFreq, WorkerTrack
from satnogsclient.upsat import gnuradio_handler from satnogsclient.upsat import gnuradio_handler
try:
from urllib.parse import urljoin
except ImportError:
from urlparse import urljoin
plt.switch_backend('Agg') plt.switch_backend('Agg')
LOGGER = logging.getLogger('default') LOGGER = logging.getLogger('default')
......
...@@ -2,7 +2,6 @@ from __future__ import absolute_import, division, print_function ...@@ -2,7 +2,6 @@ from __future__ import absolute_import, division, print_function
import logging import logging
import sys import sys
from datetime import datetime from datetime import datetime
import ephem import ephem
......
...@@ -2,21 +2,19 @@ from __future__ import absolute_import, division, print_function ...@@ -2,21 +2,19 @@ from __future__ import absolute_import, division, print_function
import logging import logging
import math import math
import threading
import time
import os import os
import signal import signal
import threading
import time
from datetime import datetime, timedelta from datetime import datetime, timedelta
import ephem import ephem
import pytz import pytz
from satnogsclient import settings
from satnogsclient.observer.commsocket import Commsocket from satnogsclient.observer.commsocket import Commsocket
from satnogsclient.observer.orbital import pinpoint from satnogsclient.observer.orbital import pinpoint
from satnogsclient import settings
LOGGER = logging.getLogger('default') LOGGER = logging.getLogger('default')
......
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
from pytz import utc
from apscheduler.executors.pool import ThreadPoolExecutor from apscheduler.executors.pool import ThreadPoolExecutor
from apscheduler.jobstores.sqlalchemy import SQLAlchemyJobStore from apscheduler.jobstores.sqlalchemy import SQLAlchemyJobStore
from apscheduler.schedulers.background import BackgroundScheduler from apscheduler.schedulers.background import BackgroundScheduler
from pytz import utc
from satnogsclient import settings from satnogsclient import settings
......
...@@ -3,20 +3,21 @@ from __future__ import absolute_import, division, print_function ...@@ -3,20 +3,21 @@ from __future__ import absolute_import, division, print_function
import logging import logging
import os import os
import signal import signal
try:
from urllib.parse import urljoin
except ImportError:
from urlparse import urljoin
from multiprocessing import Process
import subprocess import subprocess
from multiprocessing import Process
import requests import requests
from dateutil import parser from dateutil import parser
from satnogsclient.scheduler import SCHEDULER
from satnogsclient import settings from satnogsclient import settings
from satnogsclient.observer.observer import Observer
from satnogsclient.locator import locator from satnogsclient.locator import locator
from satnogsclient.observer.observer import Observer
from satnogsclient.scheduler import SCHEDULER
try:
from urllib.parse import urljoin
except ImportError:
from urlparse import urljoin
LOGGER = logging.getLogger('default') LOGGER = logging.getLogger('default')
LOG_PATH = settings.SATNOGS_OUTPUT_PATH + "/files/" LOG_PATH = settings.SATNOGS_OUTPUT_PATH + "/files/"
......
...@@ -4,8 +4,8 @@ SatNOGS Client settings file ...@@ -4,8 +4,8 @@ SatNOGS Client settings file
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
import os import os
from os import environ, path
from distutils.util import strtobool # pylint: disable=E0401,E0611 from distutils.util import strtobool # pylint: disable=E0401,E0611
from os import environ, path
def _cast_or_none(func, value): def _cast_or_none(func, value):
......
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
import json
import logging import logging
import subprocess
import os import os
import json import subprocess
from satnogsclient import settings as client_settings from satnogsclient import settings as client_settings
......
...@@ -43,6 +43,13 @@ exclude = satnogsclient/_version.py,versioneer.py,doc,build,.tox ...@@ -43,6 +43,13 @@ exclude = satnogsclient/_version.py,versioneer.py,doc,build,.tox
[yapf] [yapf]
column_limit = 99 column_limit = 99
[tool:isort]
use_parentheses = True
skip_glob = doc,build,.tox
skip = _version.py,versioneer.py
line_width = 99
multi_line_output = 2
# See the docstring in versioneer.py for instructions. Note that you must # See the docstring in versioneer.py for instructions. Note that you must
# re-run 'versioneer.py setup' after changing this section, and commit the # re-run 'versioneer.py setup' after changing this section, and commit the
# resulting files. # resulting files.
......
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
from setuptools import setup from setuptools import setup
import versioneer import versioneer
setup( setup(
......
[tox] [tox]
envlist = {py2,py3}-flake8,yapf,{py2,py3}-{pylint,build},robot_lint,py2,py3 envlist = {py2,py3}-flake8,isort,yapf,{py2,py3}-{pylint,build},robot_lint,py2,py3
[testenv:py2-flake8] [testenv:py2-flake8]
deps = deps =
...@@ -13,6 +13,11 @@ deps = ...@@ -13,6 +13,11 @@ deps =
skip_install = True skip_install = True
commands = flake8 commands = flake8
[testenv:isort]
deps =
isort==4.3.18
commands = isort -rc -c -df
[testenv:yapf] [testenv:yapf]
deps = deps =
yapf==0.27.0 yapf==0.27.0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment