Skip to content

Commit b50f9de

Browse files
committed
Ensure type annotations are backwards compatible
Related: pimutils/todoman#544
1 parent 91c16b3 commit b50f9de

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+140
-23
lines changed

contrib/conflict_resolution/resolve_interactively.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
SPDX-FileCopyrightText: 2021 Intevation GmbH <https://intevation.de>
1717
1818
"""
19+
from __future__ import annotations
20+
1921
import re
2022
import subprocess
2123
import sys

docs/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import datetime
24
import os
35

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ target-version = "py37"
1414

1515
[tool.ruff.isort]
1616
force-single-line = true
17+
required-imports = ["from __future__ import annotations"]
1718

1819
[tool.pytest.ini_options]
1920
addopts = """

setup.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
Please refer to https://vdirsyncer.pimutils.org/en/stable/packaging.html for
55
how to package vdirsyncer.
66
"""
7+
from __future__ import annotations
8+
79
from setuptools import Command
810
from setuptools import find_packages
911
from setuptools import setup

tests/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
"""
22
Test suite for vdirsyncer.
33
"""
4+
from __future__ import annotations
5+
46
import hypothesis.strategies as st
57
import urllib3.exceptions
68

tests/conftest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
"""
22
General-purpose fixtures for vdirsyncer's testsuite.
33
"""
4+
from __future__ import annotations
5+
46
import logging
57
import os
68

tests/storage/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import random
24
import textwrap
35
import uuid

tests/storage/conftest.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
from __future__ import annotations
2+
13
import asyncio
24
import contextlib
35
import subprocess
46
import time
57
import uuid
6-
from typing import Type
78

89
import aiostream
910
import pytest
@@ -90,7 +91,7 @@ async def slow_create_collection(request, aio_connector):
9091
# storage limits.
9192
to_delete = []
9293

93-
async def inner(cls: Type, args: dict, collection_name: str) -> dict:
94+
async def inner(cls: type, args: dict, collection_name: str) -> dict:
9495
"""Create a collection
9596
9697
Returns args necessary to create a Storage instance pointing to it.

tests/storage/dav/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import os
24
import uuid
35

tests/storage/dav/test_caldav.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import datetime
24
from textwrap import dedent
35

0 commit comments

Comments
 (0)