Skip to content

fix: make sync clients work without async http library - #827

Merged
tobixen merged 2 commits into
python-caldav:masterfrom
przemub:sync-without-async-library
Oct 25, 2026
Merged

tobixen merged 2 commits into
python-caldav:masterfrom
przemub:sync-without-async-library

Conversation

@przemub

@przemub przemub commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

is_async_client imported AsyncDAVClient, which raised
ImportError if no async HTTP library was installed.

Clients now have an is_async class attribute instead,
so the check does not require an async library to be installed.

przemub and others added 2 commits October 25, 2026 09:53
is_async_client imports AsyncDAVClient, which raises
ImportError if no async HTTP library is installed.

Clients now have an is_async class attribute instead.
is_async_client now reads the attribute with getattr, so duck-typed
clients that do not derive from BaseDAVClient count as sync, as the old
isinstance check did.  Add a regression test that blocks every async
HTTP library in a subprocess and checks the sync client still works,
and a changelog fragment for the PR.

Prompt: Let Opus do a code review of PR#827.  LGTM, and if Opus agree, merge it using the /merge-prs skill.  If Opus says something should be changed, then add another commit to the PR.

Assisted-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@tobixen

tobixen commented Oct 25, 2026

Copy link
Copy Markdown
Member

LGTM. I had Claude Opus 5.5 do a code review, and it always finds things to complain about: a duck typed client object without this attribute would cause an AttributeError to be raised. It's sort of a nit, nobody is supposed to be using duck-typed client objects, but the belts-and-braces is just one line of code, so I'll add it in a separate commit.

@tobixen
tobixen merged commit 34b05b9 into python-caldav:master Oct 25, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants