diff --git a/bin/radicale b/bin/radicale index 619aca5..fbd4c79 100755 --- a/bin/radicale +++ b/bin/radicale @@ -1,10 +1,9 @@ #!/usr/bin/env python -# -*- coding: utf-8 -*- # # This file is part of Radicale Server - Calendar Server # Copyright © 2008 Nicolas Kandel # Copyright © 2008 Pascal Halter -# Copyright © 2008-2013 Guillaume Ayoub +# Copyright © 2008-2016 Guillaume Ayoub # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/radicale.fcgi b/radicale.fcgi index 01a3c07..ec00581 100755 --- a/radicale.fcgi +++ b/radicale.fcgi @@ -1,8 +1,7 @@ #!/usr/bin/env python -# -*- coding: utf-8 -*- # # This file is part of Radicale Server - Calendar Server -# Copyright © 2011-2013 Guillaume Ayoub +# Copyright © 2011-2016 Guillaume Ayoub # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/radicale.py b/radicale.py index 619aca5..fbd4c79 100755 --- a/radicale.py +++ b/radicale.py @@ -1,10 +1,9 @@ #!/usr/bin/env python -# -*- coding: utf-8 -*- # # This file is part of Radicale Server - Calendar Server # Copyright © 2008 Nicolas Kandel # Copyright © 2008 Pascal Halter -# Copyright © 2008-2013 Guillaume Ayoub +# Copyright © 2008-2016 Guillaume Ayoub # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/radicale.wsgi b/radicale.wsgi index 0520dc6..4576080 100755 --- a/radicale.wsgi +++ b/radicale.wsgi @@ -1,8 +1,7 @@ #!/usr/bin/env python -# -*- coding: utf-8 -*- # # This file is part of Radicale Server - Calendar Server -# Copyright © 2011-2013 Guillaume Ayoub +# Copyright © 2011-2016 Guillaume Ayoub # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/radicale/__init__.py b/radicale/__init__.py index 17aca24..a41a8ca 100644 --- a/radicale/__init__.py +++ b/radicale/__init__.py @@ -1,9 +1,7 @@ -# -*- coding: utf-8 -*- -# # This file is part of Radicale Server - Calendar Server # Copyright © 2008 Nicolas Kandel # Copyright © 2008 Pascal Halter -# Copyright © 2008-2015 Guillaume Ayoub +# Copyright © 2008-2016 Guillaume Ayoub # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -29,28 +27,20 @@ should have been included in this package. """ import os -import sys import pprint import base64 import socket import ssl import wsgiref.simple_server import re -# Manage Python2/3 different modules -# pylint: disable=F0401,E0611 -try: - from http import client - from urllib.parse import unquote, urlparse -except ImportError: - import httplib as client - from urllib import unquote - from urlparse import urlparse -# pylint: enable=F0401,E0611 + +from http import client +from urllib.parse import unquote, urlparse from . import auth, config, ical, log, pathutils, rights, storage, xmlutils -VERSION = "1.1.1" +VERSION = "2.0.0-pre" # Standard "not allowed" response that is returned when an authenticated user # tries to access information they don't have rights to @@ -69,7 +59,7 @@ class HTTPServer(wsgiref.simple_server.WSGIServer, object): self.address_family = socket.AF_INET6 # Do not bind and activate, as we might change socket options - super(HTTPServer, self).__init__(address, handler, False) + super().__init__(address, handler, False) if ipv6: # Only allow IPv6 connections to the IPv6 socket @@ -84,7 +74,7 @@ class HTTPSServer(HTTPServer): """HTTPS server.""" def __init__(self, address, handler): """Create server by wrapping HTTP socket in an SSL socket.""" - super(HTTPSServer, self).__init__(address, handler, False) + super().__init__(address, handler, False) # Test if the SSL files can be read for name in ("certificate", "key"): @@ -102,9 +92,8 @@ class HTTPSServer(HTTPServer): keyfile=config.get("server", "key"), ssl_version=getattr( ssl, config.get("server", "protocol"), ssl.PROTOCOL_SSLv23)) - # add ciphers argument only if supported (Python 2.7+) - if sys.version_info >= (2, 7): - ssl_kwargs["ciphers"] = config.get("server", "ciphers") or None + + ssl_kwargs["ciphers"] = config.get("server", "ciphers") or None self.socket = ssl.wrap_socket(self.socket, **ssl_kwargs) @@ -120,8 +109,8 @@ class RequestHandler(wsgiref.simple_server.WSGIRequestHandler): def address_string(self): """Client address, formatted for logging.""" if config.getboolean("server", "dns_lookup"): - return \ - wsgiref.simple_server.WSGIRequestHandler.address_string(self) + return ( + wsgiref.simple_server.WSGIRequestHandler.address_string(self)) else: return self.client_address[0] @@ -130,7 +119,7 @@ class Application(object): """WSGI application managing collections.""" def __init__(self): """Initialize application.""" - super(Application, self).__init__() + super().__init__() auth.load() storage.load() rights.load() @@ -295,8 +284,6 @@ class Application(object): else: status = client.SEE_OTHER log.LOGGER.info("/.well-known/ redirection to: %s" % redirect) - if sys.version_info < (3, 0): - redirect = redirect.encode(self.encoding) headers = {"Location": redirect} status = "%i %s" % ( status, client.responses.get(status, "Unknown")) diff --git a/radicale/__main__.py b/radicale/__main__.py index c84e00d..c7c50af 100644 --- a/radicale/__main__.py +++ b/radicale/__main__.py @@ -1,7 +1,5 @@ -# -*- coding: utf-8 -*- -# # This file is part of Radicale Server - Calendar Server -# Copyright © 2011-2013 Guillaume Ayoub +# Copyright © 2011-2016 Guillaume Ayoub # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -162,14 +160,14 @@ def run(): # Create a socket pair to notify the select syscall of program shutdown # This is not available in python < 3.5 on Windows if hasattr(socket, "socketpair"): - shutdown_program_socket_in, shutdown_program_socket_out = \ - socket.socketpair() + shutdown_program_socket_in, shutdown_program_socket_out = ( + socket.socketpair()) else: shutdown_program_socket_in, shutdown_program_socket_out = None, None # SIGTERM and SIGINT (aka KeyboardInterrupt) should just mark this for # shutdown - def shutdown(*_): + def shutdown(*args): if shutdown_program[0]: # Ignore following signals return @@ -192,11 +190,11 @@ def run(): log.LOGGER.debug("Radicale server ready") while not shutdown_program[0]: try: - rlist, _, xlist = select.select(sockets, [], sockets, - select_timeout) + rlist, _, xlist = select.select( + sockets, [], sockets, select_timeout) except (KeyboardInterrupt, select.error): - # SIGINT ist handled by signal handler above - rlist, _, xlist = [], [], [] + # SIGINT is handled by signal handler above + rlist, xlist = [], [] if xlist: raise RuntimeError("Unhandled socket error") if rlist: diff --git a/radicale/auth/IMAP.py b/radicale/auth/IMAP.py index ecca086..088a9b9 100644 --- a/radicale/auth/IMAP.py +++ b/radicale/auth/IMAP.py @@ -1,9 +1,7 @@ -# -*- coding: utf-8 -*- -# # This file is part of Radicale Server - Calendar Server # Copyright © 2012 Daniel Aleksandersen # Copyright © 2013 Nikita Koshikov -# Copyright © 2013 Guillaume Ayoub +# Copyright © 2013-2016 Guillaume Ayoub # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -28,8 +26,6 @@ port 143. Legacy SSL (often on legacy port 993) is deprecated and thus unsupported. STARTTLS is enforced except if host is ``localhost`` as passwords are sent in PLAIN. -Python 3.2 or newer is required for TLS. - """ import imaplib diff --git a/radicale/auth/LDAP.py b/radicale/auth/LDAP.py index 9247387..732a93f 100644 --- a/radicale/auth/LDAP.py +++ b/radicale/auth/LDAP.py @@ -1,8 +1,6 @@ -# -*- coding: utf-8 -*- -# # This file is part of Radicale Server - Calendar Server # Copyright © 2011 Corentin Le Bail -# Copyright © 2011-2013 Guillaume Ayoub +# Copyright © 2011-2016 Guillaume Ayoub # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/radicale/auth/PAM.py b/radicale/auth/PAM.py index 25e66b1..b0178d5 100644 --- a/radicale/auth/PAM.py +++ b/radicale/auth/PAM.py @@ -1,7 +1,6 @@ -# -*- coding: utf-8 -*- -# # This file is part of Radicale Server - Calendar Server # Copyright © 2011 Henry-Nicolas Tourneur +# Copyright © 2016 Guillaume Ayoub # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -24,9 +23,10 @@ Authentication based on the ``pam-python`` module. """ import grp -import pam import pwd +import pam + from .. import config, log diff --git a/radicale/auth/__init__.py b/radicale/auth/__init__.py index 5dbdde4..0ecafe8 100644 --- a/radicale/auth/__init__.py +++ b/radicale/auth/__init__.py @@ -1,9 +1,7 @@ -# -*- coding: utf-8 -*- -# # This file is part of Radicale Server - Calendar Server # Copyright © 2008 Nicolas Kandel # Copyright © 2008 Pascal Halter -# Copyright © 2008-2013 Guillaume Ayoub +# Copyright © 2008-2016 Guillaume Ayoub # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/radicale/auth/courier.py b/radicale/auth/courier.py index ef833b7..77d9482 100644 --- a/radicale/auth/courier.py +++ b/radicale/auth/courier.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -# # This file is part of Radicale Server - Calendar Server # Copyright © 2011 Henry-Nicolas Tourneur # diff --git a/radicale/auth/htpasswd.py b/radicale/auth/htpasswd.py index c973299..f65a779 100644 --- a/radicale/auth/htpasswd.py +++ b/radicale/auth/htpasswd.py @@ -1,9 +1,7 @@ -# -*- coding: utf-8 -*- -# # This file is part of Radicale Server - Calendar Server # Copyright © 2008 Nicolas Kandel # Copyright © 2008 Pascal Halter -# Copyright © 2008-2013 Guillaume Ayoub +# Copyright © 2008-2016 Guillaume Ayoub # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -104,7 +102,7 @@ def _bcrypt(hash_value, password): def _md5apr1(hash_value, password): - return _passlib_md5apr1.verify(password, hash_value) + return _passlib_md5apr1.verify(password, hash_value) # Prepare mapping between encryption names and verification functions. diff --git a/radicale/auth/http.py b/radicale/auth/http.py index 76adf56..0ab524f 100644 --- a/radicale/auth/http.py +++ b/radicale/auth/http.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -# # This file is part of Radicale Server - Calendar Server # Copyright © 2012 Ehsanul Hoque # Copyright © 2013 Guillaume Ayoub diff --git a/radicale/auth/remote_user.py b/radicale/auth/remote_user.py index c7d789b..46ed24e 100644 --- a/radicale/auth/remote_user.py +++ b/radicale/auth/remote_user.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -# # This file is part of Radicale Server - Calendar Server # Copyright © 2012 Ehsanul Hoque # Copyright © 2013 Guillaume Ayoub diff --git a/radicale/config.py b/radicale/config.py index 656266e..518c7d4 100644 --- a/radicale/config.py +++ b/radicale/config.py @@ -1,7 +1,5 @@ -# -*- coding: utf-8 -*- -# # This file is part of Radicale Server - Calendar Server -# Copyright © 2008-2015 Guillaume Ayoub +# Copyright © 2008-2016 Guillaume Ayoub # Copyright © 2008 Nicolas Kandel # Copyright © 2008 Pascal Halter # @@ -27,13 +25,8 @@ Give a configparser-like interface to read and write configuration. import os import sys -# Manage Python2/3 different modules -# pylint: disable=F0401 -try: - from configparser import RawConfigParser as ConfigParser -except ImportError: - from ConfigParser import RawConfigParser as ConfigParser -# pylint: enable=F0401 + +from configparser import RawConfigParser as ConfigParser # Default configuration diff --git a/radicale/ical.py b/radicale/ical.py index 590751c..a3439c4 100644 --- a/radicale/ical.py +++ b/radicale/ical.py @@ -1,9 +1,7 @@ -# -*- coding: utf-8 -*- -# # This file is part of Radicale Server - Calendar Server # Copyright © 2008 Nicolas Kandel # Copyright © 2008 Pascal Halter -# Copyright © 2008-2015 Guillaume Ayoub +# Copyright © 2008-2016 Guillaume Ayoub # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/radicale/log.py b/radicale/log.py index 18c4de5..641ca09 100644 --- a/radicale/log.py +++ b/radicale/log.py @@ -1,7 +1,5 @@ -# -*- coding: utf-8 -*- -# # This file is part of Radicale Server - Calendar Server -# Copyright © 2011-2013 Guillaume Ayoub +# Copyright © 2011-2016 Guillaume Ayoub # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/radicale/pathutils.py b/radicale/pathutils.py index 6d1a96f..3cb355c 100644 --- a/radicale/pathutils.py +++ b/radicale/pathutils.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -# # This file is part of Radicale Server - Calendar Server # # This library is free software: you can redistribute it and/or modify @@ -81,7 +79,7 @@ def is_safe_filesystem_path_component(path): def path_to_filesystem(path, base_folder): """Convert path to a local filesystem path relative to base_folder. - Conversion is done in a secure manner, or raises ValueError. + Conversion is done in a secure manner, or raises ``ValueError``. """ sane_path = sanitize_path(path).strip("/") diff --git a/radicale/rights/__init__.py b/radicale/rights/__init__.py index be8ddff..a04bcd8 100644 --- a/radicale/rights/__init__.py +++ b/radicale/rights/__init__.py @@ -1,7 +1,5 @@ -# -*- coding: utf-8 -*- -# # This file is part of Radicale Server - Calendar Server -# Copyright © 2012-2013 Guillaume Ayoub +# Copyright © 2012-2016 Guillaume Ayoub # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/radicale/rights/regex.py b/radicale/rights/regex.py index 6730d6d..0b6d7df 100644 --- a/radicale/rights/regex.py +++ b/radicale/rights/regex.py @@ -1,9 +1,7 @@ -# -*- coding: utf-8 -*- -# # This file is part of Radicale Server - Calendar Server # Copyright © 2008 Nicolas Kandel # Copyright © 2008 Pascal Halter -# Copyright © 2008-2013 Guillaume Ayoub +# Copyright © 2008-2016 Guillaume Ayoub # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/radicale/storage/__init__.py b/radicale/storage/__init__.py index ab698f4..d477123 100644 --- a/radicale/storage/__init__.py +++ b/radicale/storage/__init__.py @@ -1,7 +1,5 @@ -# -*- coding: utf-8 -*- -# # This file is part of Radicale Server - Calendar Server -# Copyright © 2012-2013 Guillaume Ayoub +# Copyright © 2012-2016 Guillaume Ayoub # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -23,7 +21,9 @@ This module loads the storage backend, according to the storage configuration. """ + import sys + from .. import config, ical diff --git a/radicale/storage/database.py b/radicale/storage/database.py index dd2317e..7007601 100644 --- a/radicale/storage/database.py +++ b/radicale/storage/database.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -# # This file is part of Radicale Server - Calendar Server # Copyright © 2013 Guillaume Ayoub # @@ -24,6 +22,7 @@ SQLAlchemy storage backend. import time from datetime import datetime from contextlib import contextmanager + from sqlalchemy import create_engine, Column, Unicode, Integer, ForeignKey from sqlalchemy import func from sqlalchemy.orm import sessionmaker, relationship @@ -104,7 +103,7 @@ class Collection(ical.Collection): """Collection stored in a database.""" def __init__(self, path, principal=False): self.session = Session() - super(Collection, self).__init__(path, principal) + super().__init__(path, principal) def __del__(self): self.session.commit() diff --git a/radicale/storage/filesystem.py b/radicale/storage/filesystem.py index deeba20..293560a 100644 --- a/radicale/storage/filesystem.py +++ b/radicale/storage/filesystem.py @@ -1,7 +1,5 @@ -# -*- coding: utf-8 -*- -# # This file is part of Radicale Server - Calendar Server -# Copyright © 2012-2015 Guillaume Ayoub +# Copyright © 2012-2016 Guillaume Ayoub # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/radicale/storage/multifilesystem.py b/radicale/storage/multifilesystem.py index 0e622b5..327ec92 100644 --- a/radicale/storage/multifilesystem.py +++ b/radicale/storage/multifilesystem.py @@ -1,8 +1,6 @@ -# -*- coding: utf-8 -*- -# # This file is part of Radicale Server - Calendar Server # Copyright © 2014 Jean-Marc Martins -# Copyright © 2014-2015 Guillaume Ayoub +# Copyright © 2014-2016 Guillaume Ayoub # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -27,8 +25,8 @@ import json import shutil import time import sys - from contextlib import contextmanager + from . import filesystem from .. import ical from .. import log @@ -52,9 +50,7 @@ class Collection(filesystem.Collection): for component in self.components: text = ical.serialize( self.tag, self.headers, [component] + self.timezones) - name = ( - component.name if sys.version_info[0] >= 3 else - component.name.encode(filesystem.FILESYSTEM_ENCODING)) + name = component.name if not pathutils.is_safe_filesystem_path_component(name): log.LOGGER.debug( "Can't tranlate name safely to filesystem, " diff --git a/radicale/xmlutils.py b/radicale/xmlutils.py index 0828e87..8bfdd15 100644 --- a/radicale/xmlutils.py +++ b/radicale/xmlutils.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -# # This file is part of Radicale Server - Calendar Server # Copyright © 2008 Nicolas Kandel # Copyright © 2008 Pascal Halter @@ -27,23 +25,10 @@ in them for XML requests (all but PUT). """ -try: - from collections import OrderedDict -except ImportError: - # Python 2.6 has no OrderedDict, use a dict instead - OrderedDict = dict # pylint: disable=C0103 - -# Manage Python2/3 different modules -# pylint: disable=F0401,E0611 -try: - from urllib.parse import unquote, urlparse -except ImportError: - from urllib import unquote - from urlparse import urlparse -# pylint: enable=F0401,E0611 - import re import xml.etree.ElementTree as ET +from collections import OrderedDict +from urllib.parse import unquote, urlparse from . import client, config, ical, rights @@ -62,12 +47,7 @@ NAMESPACES_REV = {} for short, url in NAMESPACES.items(): NAMESPACES_REV[url] = short - if hasattr(ET, "register_namespace"): - # Register namespaces cleanly with Python 2.7+ and 3.2+ ... - ET.register_namespace("" if short == "D" else short, url) - else: - # ... and badly with Python 2.6 and 3.1 - ET._namespace_map[url] = short # pylint: disable=W0212 + ET.register_namespace("" if short == "D" else short, url) CLARK_TAG_REGEX = re.compile(r""" diff --git a/setup.py b/setup.py index 66e894e..c6bf607 100755 --- a/setup.py +++ b/setup.py @@ -1,8 +1,7 @@ #!/usr/bin/python -# -*- coding: utf-8 -*- # # This file is part of Radicale Server - Calendar Server -# Copyright © 2009-2013 Guillaume Ayoub +# Copyright © 2009-2016 Guillaume Ayoub # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -67,11 +66,7 @@ setup( "Intended Audience :: Information Technology", "License :: OSI Approved :: GNU General Public License (GPL)", "Operating System :: OS Independent", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.6", - "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", diff --git a/tests/__init__.py b/tests/__init__.py index 6c4dd9b..9583022 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,7 +1,5 @@ -# -*- coding: utf-8 -*- -# # This file is part of Radicale Server - Calendar Server -# Copyright © 2012-2013 Guillaume Ayoub +# Copyright © 2012-2016 Guillaume Ayoub # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -30,8 +28,6 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(__file__))) os.environ["RADICALE_CONFIG"] = os.path.join(os.path.dirname( os.path.dirname(__file__)), "config") -from .helpers import get_file_content - class BaseTest(object): """Base class for tests.""" @@ -46,8 +42,7 @@ class BaseTest(object): args["REQUEST_METHOD"] = method.upper() args["PATH_INFO"] = path if data: - if sys.version_info[0] >= 3: - data = data.encode("utf-8") + data = data.encode("utf-8") args["wsgi.input"] = BytesIO(data) args["CONTENT_LENGTH"] = str(len(data)) self.application._answer = self.application(args, self.start_response) diff --git a/tests/custom/__init__.py b/tests/custom/__init__.py index bf893c0..e69de29 100644 --- a/tests/custom/__init__.py +++ b/tests/custom/__init__.py @@ -1 +0,0 @@ -# coding=utf-8 \ No newline at end of file diff --git a/tests/custom/auth.py b/tests/custom/auth.py index 6fc1352..f3d678f 100644 --- a/tests/custom/auth.py +++ b/tests/custom/auth.py @@ -1,9 +1,7 @@ -# -*- coding: utf-8 -*- -# # This file is part of Radicale Server - Calendar Server # Copyright © 2008 Nicolas Kandel # Copyright © 2008 Pascal Halter -# Copyright © 2008-2013 Guillaume Ayoub +# Copyright © 2008-2016 Guillaume Ayoub # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/custom/storage.py b/tests/custom/storage.py index bc12356..70e9872 100644 --- a/tests/custom/storage.py +++ b/tests/custom/storage.py @@ -1,7 +1,5 @@ -# -*- coding: utf-8 -*- -# # This file is part of Radicale Server - Calendar Server -# Copyright © 2012-2013 Guillaume Ayoub +# Copyright © 2012-2016 Guillaume Ayoub # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/helpers.py b/tests/helpers.py index fdc2248..f3efb82 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -1,9 +1,7 @@ -# -*- coding: utf-8 -*- -# # This file is part of Radicale Server - Calendar Server # Copyright © 2008 Nicolas Kandel # Copyright © 2008 Pascal Halter -# Copyright © 2008-2013 Guillaume Ayoub +# Copyright © 2008-2016 Guillaume Ayoub # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/test_auth.py b/tests/test_auth.py index 9c3374f..7b9163d 100644 --- a/tests/test_auth.py +++ b/tests/test_auth.py @@ -1,8 +1,6 @@ -# -*- coding: utf-8 -*- -# # This file is part of Radicale Server - Calendar Server # Copyright © 2012-2013 Guillaume Ayoub -# Copyright © 2012-2013 Jean-Marc Martins +# Copyright © 2012-2016 Jean-Marc Martins # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -27,9 +25,11 @@ import hashlib import os import radicale import tempfile + from radicale import config from radicale.auth import htpasswd -from tests import BaseTest + +from . import BaseTest class TestBaseAuthRequests(BaseTest): diff --git a/tests/test_base.py b/tests/test_base.py index ffcffbe..eb63dc0 100644 --- a/tests/test_base.py +++ b/tests/test_base.py @@ -1,7 +1,5 @@ -# -*- coding: utf-8 -*- -# # This file is part of Radicale Server - Calendar Server -# Copyright © 2012-2013 Guillaume Ayoub +# Copyright © 2012-2016 Guillaume Ayoub # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -120,7 +118,7 @@ class TestDataBaseSystem(BaseRequests, BaseTest): storage_type = "database" def setup(self): - super(TestDataBaseSystem, self).setup() + super().setup() radicale.config.set("storage", "database_url", "sqlite://") from radicale.storage import database database.Session = sessionmaker() @@ -134,7 +132,7 @@ class TestDataBaseSystem(BaseRequests, BaseTest): class TestGitFileSystem(TestFileSystem): """Base class for filesystem tests using Git""" def setup(self): - super(TestGitFileSystem, self).setup() + super().setup() Repo.init(self.colpath) from radicale.storage import filesystem filesystem.GIT_REPOSITORY = Repo(self.colpath) @@ -150,7 +148,7 @@ class TestCustomStorageSystem(BaseRequests, BaseTest): def setup(self): """Setup function for each test.""" - super(TestCustomStorageSystem, self).setup() + super().setup() self.colpath = tempfile.mkdtemp() radicale.config.set( "storage", "custom_handler", "tests.custom.storage") diff --git a/tox.ini b/tox.ini index fc35b31..eef0df9 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py26, py27, py32, py33, py34#, pypy +envlist = py33, py34, py35 [base] deps = @@ -11,23 +11,6 @@ deps = [testenv] commands = nosetests [] -[testenv:py26] -deps = - python-ldap - dulwich<=0.9.5 - {[base]deps} - -[testenv:py27] -deps = - python-ldap - dulwich - {[base]deps} - -[testenv:py32] -deps = - git+https://github.com/eberle1080/dulwich-py3k.git - {[base]deps} - [testenv:py33] deps = git+https://github.com/eberle1080/dulwich-py3k.git @@ -38,8 +21,7 @@ deps = git+https://github.com/eberle1080/dulwich-py3k.git {[base]deps} -# Pypy support seems to be broken, at least with sqlalchemy -#[testenv:pypy] -#deps = -# dulwich -# {[base]deps} +[testenv:py35] +deps = + git+https://github.com/eberle1080/dulwich-py3k.git + {[base]deps}