Skip to content

Commit 407bc95

Browse files
authored
remove imap_tools from dependencies (#6238)
1 parent daeeca3 commit 407bc95

File tree

5 files changed

+15
-20
lines changed

5 files changed

+15
-20
lines changed

deltachat-rpc-client/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ $ pip install .
2525
## Testing
2626

2727
1. Build `deltachat-rpc-server` with `cargo build -p deltachat-rpc-server`.
28-
2. Run `CHATMAIL_DOMAIN=nine.testrun.org PATH="../target/debug:$PATH" tox`.
28+
2. Install tox `pip install -U tox`
29+
3. Run `CHATMAIL_DOMAIN=nine.testrun.org PATH="../target/debug:$PATH" tox`.
2930

3031
Additional arguments to `tox` are passed to pytest, e.g. `tox -- -s` does not capture test output.
3132

deltachat-rpc-client/pyproject.toml

-3
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ classifiers = [
2424
"Topic :: Communications :: Email"
2525
]
2626
readme = "README.md"
27-
dependencies = [
28-
"imap-tools",
29-
]
3027

3128
[tool.setuptools.package-data]
3229
deltachat_rpc_client = [

deltachat-rpc-client/src/deltachat_rpc_client/direct_imap.py deltachat-rpc-client/tests/conftest.py

+10-13
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
"""
2-
Internal Python-level IMAP handling used by the tests.
3-
"""
4-
51
from __future__ import annotations
62

73
import imaplib
@@ -11,24 +7,20 @@
117
from contextlib import contextmanager
128
from typing import TYPE_CHECKING
139

14-
from imap_tools import (
15-
AND,
16-
Header,
17-
MailBox,
18-
MailMessage,
19-
MailMessageFlags,
20-
errors,
21-
)
10+
import pytest
11+
from imap_tools import AND, Header, MailBox, MailMessage, MailMessageFlags, errors
2212

2313
if TYPE_CHECKING:
24-
from . import Account
14+
from deltachat_rpc_client import Account
2515

2616
FLAGS = b"FLAGS"
2717
FETCH = b"FETCH"
2818
ALL = "1:*"
2919

3020

3121
class DirectImap:
22+
"""Internal Python-level IMAP handling."""
23+
3224
def __init__(self, account: Account) -> None:
3325
self.account = account
3426
self.logid = account.get_config("displayname") or id(account)
@@ -212,3 +204,8 @@ def wait_for_seen(self, timeout=None) -> int:
212204
def done(self):
213205
"""send idle-done to server if we are currently in idle mode."""
214206
return self.direct_imap.conn.idle.stop()
207+
208+
209+
@pytest.fixture
210+
def direct_imap():
211+
return DirectImap

deltachat-rpc-client/tests/test_something.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
from deltachat_rpc_client import Contact, EventType, Message, events
1414
from deltachat_rpc_client.const import DownloadState, MessageState
15-
from deltachat_rpc_client.direct_imap import DirectImap
1615
from deltachat_rpc_client.rpc import JsonRpcError
1716

1817

@@ -536,7 +535,7 @@ def test_reaction_to_partially_fetched_msg(acfactory, tmp_path):
536535
assert list(reactions.reactions_by_contact.values())[0] == [react_str]
537536

538537

539-
def test_reactions_for_a_reordering_move(acfactory):
538+
def test_reactions_for_a_reordering_move(acfactory, direct_imap):
540539
"""When a batch of messages is moved from Inbox to DeltaChat folder with a single MOVE command,
541540
their UIDs may be reordered (e.g. Gmail is known for that) which led to that messages were
542541
processed by receive_imf in the wrong order, and, particularly, reactions were processed before
@@ -560,7 +559,7 @@ def test_reactions_for_a_reordering_move(acfactory):
560559
msg1.send_reaction(react_str).wait_until_delivered()
561560

562561
logging.info("moving messages to ac2's DeltaChat folder in the reverse order")
563-
ac2_direct_imap = DirectImap(ac2)
562+
ac2_direct_imap = direct_imap(ac2)
564563
ac2_direct_imap.connect()
565564
for uid in sorted([m.uid for m in ac2_direct_imap.get_all_messages()], reverse=True):
566565
ac2_direct_imap.conn.move(uid, "DeltaChat")

deltachat-rpc-client/tox.ini

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ deps =
1616
pytest
1717
pytest-timeout
1818
pytest-xdist
19+
imap-tools
1920

2021
[testenv:lint]
2122
skipsdist = True

0 commit comments

Comments
 (0)