From 14b46c04bff9ec2136f0dbe14e0eed575de5d9a0 Mon Sep 17 00:00:00 2001 From: Unrud Date: Sat, 15 Jun 2019 09:01:55 +0200 Subject: [PATCH] Create configuration for isort --- .isort.cfg | 3 +++ radicale/app/__init__.py | 3 +-- radicale/app/get.py | 3 +-- radicale/app/mkcalendar.py | 3 +-- radicale/app/mkcol.py | 3 +-- radicale/app/move.py | 3 +-- radicale/app/propfind.py | 3 +-- radicale/app/put.py | 3 +-- radicale/app/report.py | 3 +-- radicale/pathutils.py | 3 +-- radicale/storage/multifilesystem/discover.py | 3 +-- radicale/tests/__init__.py | 3 ++- radicale/tests/test_auth.py | 4 ++-- radicale/tests/test_base.py | 7 +++---- radicale/tests/test_server.py | 4 ++-- radicale/web/internal.py | 3 +-- 16 files changed, 23 insertions(+), 31 deletions(-) create mode 100644 .isort.cfg diff --git a/.isort.cfg b/.isort.cfg new file mode 100644 index 0000000..77bd055 --- /dev/null +++ b/.isort.cfg @@ -0,0 +1,3 @@ +[settings] +known_standard_libary=posixpath +known_third_party=gunicorn,passlib,pkg_resources,pytest,pytest_cov,vobject diff --git a/radicale/app/__init__.py b/radicale/app/__init__.py index 5e5a81c..3c2930b 100644 --- a/radicale/app/__init__.py +++ b/radicale/app/__init__.py @@ -28,6 +28,7 @@ import base64 import datetime import io import logging +import posixpath import pprint import random import time @@ -52,8 +53,6 @@ from radicale.app.put import ApplicationPutMixin from radicale.app.report import ApplicationReportMixin from radicale.log import logger -import posixpath # isort:skip - VERSION = pkg_resources.get_distribution("radicale").version diff --git a/radicale/app/get.py b/radicale/app/get.py index d38723e..6c0e71d 100644 --- a/radicale/app/get.py +++ b/radicale/app/get.py @@ -17,14 +17,13 @@ # You should have received a copy of the GNU General Public License # along with Radicale. If not, see . +import posixpath from http import client from urllib.parse import quote from radicale import httputils, pathutils, storage, xmlutils from radicale.log import logger -import posixpath # isort:skip - def propose_filename(collection): """Propose a filename for a collection.""" diff --git a/radicale/app/mkcalendar.py b/radicale/app/mkcalendar.py index 129b058..11e0123 100644 --- a/radicale/app/mkcalendar.py +++ b/radicale/app/mkcalendar.py @@ -17,6 +17,7 @@ # You should have received a copy of the GNU General Public License # along with Radicale. If not, see . +import posixpath import socket from http import client @@ -25,8 +26,6 @@ from radicale import item as radicale_item from radicale import pathutils, storage, xmlutils from radicale.log import logger -import posixpath # isort:skip - class ApplicationMkcalendarMixin: def do_MKCALENDAR(self, environ, base_prefix, path, user): diff --git a/radicale/app/mkcol.py b/radicale/app/mkcol.py index e6d3dda..6771546 100644 --- a/radicale/app/mkcol.py +++ b/radicale/app/mkcol.py @@ -17,6 +17,7 @@ # You should have received a copy of the GNU General Public License # along with Radicale. If not, see . +import posixpath import socket from http import client @@ -25,8 +26,6 @@ from radicale import item as radicale_item from radicale import pathutils, storage, xmlutils from radicale.log import logger -import posixpath # isort:skip - class ApplicationMkcolMixin: def do_MKCOL(self, environ, base_prefix, path, user): diff --git a/radicale/app/move.py b/radicale/app/move.py index 3e20df1..79155b5 100644 --- a/radicale/app/move.py +++ b/radicale/app/move.py @@ -17,14 +17,13 @@ # You should have received a copy of the GNU General Public License # along with Radicale. If not, see . +import posixpath from http import client from urllib.parse import urlparse from radicale import httputils, pathutils, storage from radicale.log import logger -import posixpath # isort:skip - class ApplicationMoveMixin: def do_MOVE(self, environ, base_prefix, path, user): diff --git a/radicale/app/propfind.py b/radicale/app/propfind.py index bcaa80c..c67a1f4 100644 --- a/radicale/app/propfind.py +++ b/radicale/app/propfind.py @@ -18,6 +18,7 @@ # along with Radicale. If not, see . import itertools +import posixpath import socket from http import client from xml.etree import ElementTree as ET @@ -25,8 +26,6 @@ from xml.etree import ElementTree as ET from radicale import httputils, pathutils, rights, storage, xmlutils from radicale.log import logger -import posixpath # isort:skip - def xml_propfind(base_prefix, path, xml_request, allowed_items, user): """Read and answer PROPFIND requests. diff --git a/radicale/app/put.py b/radicale/app/put.py index 9fd7dfe..0e693e6 100644 --- a/radicale/app/put.py +++ b/radicale/app/put.py @@ -18,6 +18,7 @@ # along with Radicale. If not, see . import itertools +import posixpath import socket import sys from http import client @@ -29,8 +30,6 @@ from radicale import item as radicale_item from radicale import pathutils, storage, xmlutils from radicale.log import logger -import posixpath # isort:skip - class ApplicationPutMixin: def do_PUT(self, environ, base_prefix, path, user): diff --git a/radicale/app/report.py b/radicale/app/report.py index 8c915fd..8186ad7 100644 --- a/radicale/app/report.py +++ b/radicale/app/report.py @@ -18,6 +18,7 @@ # along with Radicale. If not, see . import contextlib +import posixpath import socket from http import client from urllib.parse import unquote, urlparse @@ -27,8 +28,6 @@ from radicale import httputils, pathutils, storage, xmlutils from radicale.item import filter as radicale_filter from radicale.log import logger -import posixpath # isort:skip - def xml_report(base_prefix, path, xml_request, collection, unlock_storage_fn): """Read and answer REPORT requests. diff --git a/radicale/pathutils.py b/radicale/pathutils.py index eee3e6d..5faaa90 100644 --- a/radicale/pathutils.py +++ b/radicale/pathutils.py @@ -18,10 +18,9 @@ import contextlib import os +import posixpath import threading -import posixpath # isort:skip - if os.name == "nt": import ctypes import ctypes.wintypes diff --git a/radicale/storage/multifilesystem/discover.py b/radicale/storage/multifilesystem/discover.py index f41cf35..e2992bf 100644 --- a/radicale/storage/multifilesystem/discover.py +++ b/radicale/storage/multifilesystem/discover.py @@ -18,12 +18,11 @@ import contextlib import os +import posixpath from radicale import pathutils from radicale.log import logger -import posixpath # isort:skip - class CollectionDiscoverMixin: @classmethod diff --git a/radicale/tests/__init__.py b/radicale/tests/__init__.py index 41ed047..41a8eda 100644 --- a/radicale/tests/__init__.py +++ b/radicale/tests/__init__.py @@ -25,8 +25,9 @@ import os import sys from io import BytesIO -import radicale from pytest_cov import embed + +import radicale from radicale import server # Measure coverage of forked processes diff --git a/radicale/tests/test_auth.py b/radicale/tests/test_auth.py index a655b25..988d298 100644 --- a/radicale/tests/test_auth.py +++ b/radicale/tests/test_auth.py @@ -26,12 +26,12 @@ import os import shutil import tempfile +import pytest + from radicale import Application, config from .test_base import BaseTest -import pytest # isort:skip - class TestBaseAuthRequests(BaseTest): """Tests basic requests with auth. diff --git a/radicale/tests/test_base.py b/radicale/tests/test_base.py index dab31e2..aa0ef85 100644 --- a/radicale/tests/test_base.py +++ b/radicale/tests/test_base.py @@ -22,21 +22,20 @@ Radicale tests with simple requests. import base64 import os +import posixpath import shutil import sys import tempfile import xml.etree.ElementTree as ET from functools import partial +import pytest + from radicale import Application, config, storage from . import BaseTest from .helpers import get_file_content -import posixpath # isort:skip - -import pytest # isort:skip - class BaseRequestsMixIn: """Tests with simple requests.""" diff --git a/radicale/tests/test_server.py b/radicale/tests/test_server.py index 509cb22..564287e 100644 --- a/radicale/tests/test_server.py +++ b/radicale/tests/test_server.py @@ -32,12 +32,12 @@ from configparser import ConfigParser from urllib import request from urllib.error import HTTPError, URLError +import pytest + from radicale import config, server from .helpers import get_file_path -import pytest # isort:skip - try: import gunicorn except ImportError: diff --git a/radicale/web/internal.py b/radicale/web/internal.py index de8b6ed..7c9fa4a 100644 --- a/radicale/web/internal.py +++ b/radicale/web/internal.py @@ -15,6 +15,7 @@ # along with Radicale. If not, see . import os +import posixpath import time from http import client @@ -23,8 +24,6 @@ import pkg_resources from radicale import httputils, pathutils, web from radicale.log import logger -import posixpath # isort:skip - MIMETYPES = { ".css": "text/css", ".eot": "application/vnd.ms-fontobject",