diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 853198f..861bb73 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: trailing-whitespace args: [--markdown-linebreak-ext=md] @@ -9,11 +9,11 @@ repos: - id: check-added-large-files - id: debug-statements - repo: https://github.com/psf/black - rev: "23.9.1" + rev: "24.1.1" hooks: - id: black - repo: https://github.com/pre-commit/mirrors-mypy - rev: "v1.5.1" + rev: "v1.8.0" hooks: - id: mypy files: vdirsyncer/.* @@ -23,7 +23,7 @@ repos: - types-requests - types-atomicwrites - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: 'v0.0.291' + rev: 'v0.1.15' hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] diff --git a/setup.py b/setup.py index 279df5d..d264aa2 100644 --- a/setup.py +++ b/setup.py @@ -4,6 +4,7 @@ Vdirsyncer synchronizes calendars and contacts. Please refer to https://vdirsyncer.pimutils.org/en/stable/packaging.html for how to package vdirsyncer. """ + from __future__ import annotations from setuptools import Command diff --git a/tests/__init__.py b/tests/__init__.py index 72007f6..bb65412 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,6 +1,7 @@ """ Test suite for vdirsyncer. """ + from __future__ import annotations import hypothesis.strategies as st diff --git a/tests/conftest.py b/tests/conftest.py index 3eb2b62..813deb5 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,6 +1,7 @@ """ General-purpose fixtures for vdirsyncer's testsuite. """ + from __future__ import annotations import logging diff --git a/vdirsyncer/__init__.py b/vdirsyncer/__init__.py index 9d5b310..e1d4e70 100644 --- a/vdirsyncer/__init__.py +++ b/vdirsyncer/__init__.py @@ -1,6 +1,7 @@ """ Vdirsyncer synchronizes calendars and contacts. """ + from __future__ import annotations PROJECT_HOME = "https://github.com/pimutils/vdirsyncer" diff --git a/vdirsyncer/exceptions.py b/vdirsyncer/exceptions.py index 5bab293..82ba0c2 100644 --- a/vdirsyncer/exceptions.py +++ b/vdirsyncer/exceptions.py @@ -2,6 +2,7 @@ Contains exception classes used by vdirsyncer. Not all exceptions are here, only the most commonly used ones. """ + from __future__ import annotations diff --git a/vdirsyncer/storage/base.py b/vdirsyncer/storage/base.py index dc27b1c..fcbc379 100644 --- a/vdirsyncer/storage/base.py +++ b/vdirsyncer/storage/base.py @@ -34,7 +34,6 @@ class StorageMeta(ABCMeta): class Storage(metaclass=StorageMeta): - """Superclass of all storages, interface that all storages have to implement. @@ -67,8 +66,8 @@ class Storage(metaclass=StorageMeta): # The machine-readable name of this collection. collection = None - #A value of False means storage does not support delete requests. A - #value of True mean the storage supports it. + # A value of False means storage does not support delete requests. A + # value of True mean the storage supports it. no_delete = False # A value of True means the storage does not support write-methods such as @@ -79,7 +78,13 @@ class Storage(metaclass=StorageMeta): # The attribute values to show in the representation of the storage. _repr_attributes: list[str] = [] - def __init__(self, instance_name=None, read_only=None, no_delete=None, collection=None): + def __init__( + self, + instance_name=None, + read_only=None, + no_delete=None, + collection=None, + ): if read_only is None: read_only = self.read_only if self.read_only and not read_only: diff --git a/vdirsyncer/sync/__init__.py b/vdirsyncer/sync/__init__.py index b719c4d..9e3fec1 100644 --- a/vdirsyncer/sync/__init__.py +++ b/vdirsyncer/sync/__init__.py @@ -9,6 +9,7 @@ Yang: http://blog.ezyang.com/2012/08/how-offlineimap-works/ Some modifications to it are explained in https://unterwaditzer.net/2016/sync-algorithm.html """ + from __future__ import annotations import contextlib @@ -244,7 +245,9 @@ class Delete(Action): async def _run_impl(self, a, b): meta = self.dest.status.get_new(self.ident) if self.dest.storage.read_only or self.dest.storage.no_delete: - sync_logger.debug(f"Skipping deletion of item {self.ident} from {self.dest.storage}") + sync_logger.debug( + f"Skipping deletion of item {self.ident} from {self.dest.storage}" + ) else: sync_logger.info(f"Deleting item {self.ident} from {self.dest.storage}") await self.dest.storage.delete(meta.href, meta.etag) diff --git a/vdirsyncer/vobject.py b/vdirsyncer/vobject.py index aae9fb9..5148221 100644 --- a/vdirsyncer/vobject.py +++ b/vdirsyncer/vobject.py @@ -36,7 +36,6 @@ IGNORE_PROPS = ( class Item: - """Immutable wrapper class for VCALENDAR (VEVENT, VTODO) and VCARD"""