Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: import aiostream only if sys.version < python 3.9 #1023

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion tests/storage/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import random
import sys
import textwrap
import uuid
from urllib.parse import quote as urlquote
from urllib.parse import unquote as urlunquote

import aiostream
if sys.version_info < (3, 9):
import aiostream

import pytest
import pytest_asyncio

Expand Down
5 changes: 4 additions & 1 deletion tests/storage/conftest.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import asyncio
import contextlib
import subprocess
import sys
import time
import uuid
from typing import Type

import aiostream
if sys.version_info < (3, 9):
import aiostream

import pytest
import pytest_asyncio
import requests
Expand Down
6 changes: 5 additions & 1 deletion tests/storage/dav/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import os
import sys
import uuid

import aiohttp
import aiostream

if sys.version_info < (3, 9):
import aiostream

import pytest

from tests import assert_item_equals
Expand Down
6 changes: 5 additions & 1 deletion tests/storage/dav/test_caldav.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import datetime
import sys
from textwrap import dedent

import aiohttp
import aiostream

if sys.version_info < (3, 9):
import aiostream

import pytest
from aioresponses import aioresponses

Expand Down
5 changes: 4 additions & 1 deletion tests/storage/test_filesystem.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import subprocess
import sys

if sys.version_info < (3, 9):
import aiostream

import aiostream
import pytest

from vdirsyncer.storage.filesystem import FilesystemStorage
Expand Down
5 changes: 4 additions & 1 deletion tests/storage/test_http_with_singlefile.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import aiostream
import sys

if sys.version_info < (3, 9):
import aiostream
import pytest
from aioresponses import CallbackResult
from aioresponses import aioresponses
Expand Down
5 changes: 4 additions & 1 deletion tests/unit/cli/test_discover.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import aiostream
import sys

if sys.version_info < (3, 9):
import aiostream
import pytest

from vdirsyncer.cli.discover import expand_collections
Expand Down
5 changes: 4 additions & 1 deletion tests/unit/sync/test_sync.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import asyncio
import sys
from copy import deepcopy

import aiostream
if sys.version_info < (3, 9):
import aiostream

import hypothesis.strategies as st
import pytest
from hypothesis import assume
Expand Down
5 changes: 4 additions & 1 deletion tests/unit/test_repair.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import aiostream
import sys

if sys.version_info < (3, 9):
import aiostream
import pytest
from hypothesis import HealthCheck
from hypothesis import given
Expand Down
4 changes: 3 additions & 1 deletion vdirsyncer/cli/discover.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
import sys

import aiohttp
import aiostream

if sys.version_info < (3, 9):
import aiostream

from .. import exceptions
from .utils import handle_collection_not_found
Expand Down
4 changes: 3 additions & 1 deletion vdirsyncer/repair.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import logging
import sys
from os.path import basename

import aiostream
if sys.version_info < (3, 9):
import aiostream

from .utils import generate_href
from .utils import href_safe
Expand Down
5 changes: 4 additions & 1 deletion vdirsyncer/storage/dav.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import datetime
import logging
import sys
import urllib.parse as urlparse
import xml.etree.ElementTree as etree
from abc import abstractmethod
Expand All @@ -9,7 +10,9 @@
from typing import Type

import aiohttp
import aiostream

if sys.version_info < (3, 9):
import aiostream

from vdirsyncer.exceptions import Error
from vdirsyncer.vobject import Item
Expand Down