Create configuration for isort

This commit is contained in:
Unrud 2019-06-15 09:01:55 +02:00
parent 7527998135
commit 14b46c04bf
16 changed files with 23 additions and 31 deletions

3
.isort.cfg Normal file
View File

@ -0,0 +1,3 @@
[settings]
known_standard_libary=posixpath
known_third_party=gunicorn,passlib,pkg_resources,pytest,pytest_cov,vobject

View File

@ -28,6 +28,7 @@ import base64
import datetime import datetime
import io import io
import logging import logging
import posixpath
import pprint import pprint
import random import random
import time import time
@ -52,8 +53,6 @@ from radicale.app.put import ApplicationPutMixin
from radicale.app.report import ApplicationReportMixin from radicale.app.report import ApplicationReportMixin
from radicale.log import logger from radicale.log import logger
import posixpath # isort:skip
VERSION = pkg_resources.get_distribution("radicale").version VERSION = pkg_resources.get_distribution("radicale").version

View File

@ -17,14 +17,13 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Radicale. If not, see <http://www.gnu.org/licenses/>. # along with Radicale. If not, see <http://www.gnu.org/licenses/>.
import posixpath
from http import client from http import client
from urllib.parse import quote from urllib.parse import quote
from radicale import httputils, pathutils, storage, xmlutils from radicale import httputils, pathutils, storage, xmlutils
from radicale.log import logger from radicale.log import logger
import posixpath # isort:skip
def propose_filename(collection): def propose_filename(collection):
"""Propose a filename for a collection.""" """Propose a filename for a collection."""

View File

@ -17,6 +17,7 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Radicale. If not, see <http://www.gnu.org/licenses/>. # along with Radicale. If not, see <http://www.gnu.org/licenses/>.
import posixpath
import socket import socket
from http import client from http import client
@ -25,8 +26,6 @@ from radicale import item as radicale_item
from radicale import pathutils, storage, xmlutils from radicale import pathutils, storage, xmlutils
from radicale.log import logger from radicale.log import logger
import posixpath # isort:skip
class ApplicationMkcalendarMixin: class ApplicationMkcalendarMixin:
def do_MKCALENDAR(self, environ, base_prefix, path, user): def do_MKCALENDAR(self, environ, base_prefix, path, user):

View File

@ -17,6 +17,7 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Radicale. If not, see <http://www.gnu.org/licenses/>. # along with Radicale. If not, see <http://www.gnu.org/licenses/>.
import posixpath
import socket import socket
from http import client from http import client
@ -25,8 +26,6 @@ from radicale import item as radicale_item
from radicale import pathutils, storage, xmlutils from radicale import pathutils, storage, xmlutils
from radicale.log import logger from radicale.log import logger
import posixpath # isort:skip
class ApplicationMkcolMixin: class ApplicationMkcolMixin:
def do_MKCOL(self, environ, base_prefix, path, user): def do_MKCOL(self, environ, base_prefix, path, user):

View File

@ -17,14 +17,13 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Radicale. If not, see <http://www.gnu.org/licenses/>. # along with Radicale. If not, see <http://www.gnu.org/licenses/>.
import posixpath
from http import client from http import client
from urllib.parse import urlparse from urllib.parse import urlparse
from radicale import httputils, pathutils, storage from radicale import httputils, pathutils, storage
from radicale.log import logger from radicale.log import logger
import posixpath # isort:skip
class ApplicationMoveMixin: class ApplicationMoveMixin:
def do_MOVE(self, environ, base_prefix, path, user): def do_MOVE(self, environ, base_prefix, path, user):

View File

@ -18,6 +18,7 @@
# along with Radicale. If not, see <http://www.gnu.org/licenses/>. # along with Radicale. If not, see <http://www.gnu.org/licenses/>.
import itertools import itertools
import posixpath
import socket import socket
from http import client from http import client
from xml.etree import ElementTree as ET 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 import httputils, pathutils, rights, storage, xmlutils
from radicale.log import logger from radicale.log import logger
import posixpath # isort:skip
def xml_propfind(base_prefix, path, xml_request, allowed_items, user): def xml_propfind(base_prefix, path, xml_request, allowed_items, user):
"""Read and answer PROPFIND requests. """Read and answer PROPFIND requests.

View File

@ -18,6 +18,7 @@
# along with Radicale. If not, see <http://www.gnu.org/licenses/>. # along with Radicale. If not, see <http://www.gnu.org/licenses/>.
import itertools import itertools
import posixpath
import socket import socket
import sys import sys
from http import client from http import client
@ -29,8 +30,6 @@ from radicale import item as radicale_item
from radicale import pathutils, storage, xmlutils from radicale import pathutils, storage, xmlutils
from radicale.log import logger from radicale.log import logger
import posixpath # isort:skip
class ApplicationPutMixin: class ApplicationPutMixin:
def do_PUT(self, environ, base_prefix, path, user): def do_PUT(self, environ, base_prefix, path, user):

View File

@ -18,6 +18,7 @@
# along with Radicale. If not, see <http://www.gnu.org/licenses/>. # along with Radicale. If not, see <http://www.gnu.org/licenses/>.
import contextlib import contextlib
import posixpath
import socket import socket
from http import client from http import client
from urllib.parse import unquote, urlparse 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.item import filter as radicale_filter
from radicale.log import logger from radicale.log import logger
import posixpath # isort:skip
def xml_report(base_prefix, path, xml_request, collection, unlock_storage_fn): def xml_report(base_prefix, path, xml_request, collection, unlock_storage_fn):
"""Read and answer REPORT requests. """Read and answer REPORT requests.

View File

@ -18,10 +18,9 @@
import contextlib import contextlib
import os import os
import posixpath
import threading import threading
import posixpath # isort:skip
if os.name == "nt": if os.name == "nt":
import ctypes import ctypes
import ctypes.wintypes import ctypes.wintypes

View File

@ -18,12 +18,11 @@
import contextlib import contextlib
import os import os
import posixpath
from radicale import pathutils from radicale import pathutils
from radicale.log import logger from radicale.log import logger
import posixpath # isort:skip
class CollectionDiscoverMixin: class CollectionDiscoverMixin:
@classmethod @classmethod

View File

@ -25,8 +25,9 @@ import os
import sys import sys
from io import BytesIO from io import BytesIO
import radicale
from pytest_cov import embed from pytest_cov import embed
import radicale
from radicale import server from radicale import server
# Measure coverage of forked processes # Measure coverage of forked processes

View File

@ -26,12 +26,12 @@ import os
import shutil import shutil
import tempfile import tempfile
import pytest
from radicale import Application, config from radicale import Application, config
from .test_base import BaseTest from .test_base import BaseTest
import pytest # isort:skip
class TestBaseAuthRequests(BaseTest): class TestBaseAuthRequests(BaseTest):
"""Tests basic requests with auth. """Tests basic requests with auth.

View File

@ -22,21 +22,20 @@ Radicale tests with simple requests.
import base64 import base64
import os import os
import posixpath
import shutil import shutil
import sys import sys
import tempfile import tempfile
import xml.etree.ElementTree as ET import xml.etree.ElementTree as ET
from functools import partial from functools import partial
import pytest
from radicale import Application, config, storage from radicale import Application, config, storage
from . import BaseTest from . import BaseTest
from .helpers import get_file_content from .helpers import get_file_content
import posixpath # isort:skip
import pytest # isort:skip
class BaseRequestsMixIn: class BaseRequestsMixIn:
"""Tests with simple requests.""" """Tests with simple requests."""

View File

@ -32,12 +32,12 @@ from configparser import ConfigParser
from urllib import request from urllib import request
from urllib.error import HTTPError, URLError from urllib.error import HTTPError, URLError
import pytest
from radicale import config, server from radicale import config, server
from .helpers import get_file_path from .helpers import get_file_path
import pytest # isort:skip
try: try:
import gunicorn import gunicorn
except ImportError: except ImportError:

View File

@ -15,6 +15,7 @@
# along with Radicale. If not, see <http://www.gnu.org/licenses/>. # along with Radicale. If not, see <http://www.gnu.org/licenses/>.
import os import os
import posixpath
import time import time
from http import client from http import client
@ -23,8 +24,6 @@ import pkg_resources
from radicale import httputils, pathutils, web from radicale import httputils, pathutils, web
from radicale.log import logger from radicale.log import logger
import posixpath # isort:skip
MIMETYPES = { MIMETYPES = {
".css": "text/css", ".css": "text/css",
".eot": "application/vnd.ms-fontobject", ".eot": "application/vnd.ms-fontobject",