Upgrade longwei to 2.0 (context manager pattern) #40
No reviewers
Labels
No labels
bug
contribution welcome
duplicate
enhancement
good first issue
help wanted
invalid
question
upstream
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Reference
marvin8/fedinesia!40
Loading…
Reference in a new issue
No description provided.
Delete branch "refs/pull/40/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #39
Summary
longweifrom~=1.5.1to>=2.0,<3httpxdependency (now managed internally by longwei 2.0 via httpx2)FediHelper.connect(): dropsAsyncClientconstruction and theclient=arg; passeshttp2=True, timeout=30directly toAPClient.create()FediHelper.aclose(): dropsAsyncClient.aclose()in favour ofAPClient.close(); removes theclientfield from the structwizard.collect_mastodon_config(): removes theasync with AsyncClientwrapper andclient=args from the three static auth methodssrc/fedinesia/wizard.pyline 57 — @marvin8🔴 Not actionable. The three static auth methods in longwei 2.0 do not accept
http2ortimeoutparameters — confirmed by reading the source signatures inlongwei/_mixin_auth.py:These methods manage their own internal HTTP client; the settings are not exposed. Additionally,
generate_authorization_urlmakes no HTTP request at all — it constructs a URL locally.APClient.create()(the main runtime client used byFediHelper) does receivehttp2=True, timeout=30. The lack of these settings on the auth methods is an upstream design decision in longwei 2.0 with no workaround.