Skip to content

chore(runtime-sdk): relocate asgi.py into workers directory for consistency - #194

Merged
ryanking13 merged 1 commit into
mainfrom
gyeongjae/asgi-workers
Aug 13, 2026
Merged

chore(runtime-sdk): relocate asgi.py into workers directory for consistency#194
ryanking13 merged 1 commit into
mainfrom
gyeongjae/asgi-workers

Conversation

@ryanking13

Copy link
Copy Markdown
Contributor

moving asgi.py to workers/asgi.py so that users can import both wsgi and asgi modules from

from workers import asgi
from workers import wsgi

I made the existing asgi.py work as-is by importing from workers/asgi.py and re-exporting.

@ask-bonk

ask-bonk Bot commented Aug 12, 2026

Copy link
Copy Markdown

I've reviewed the full diff and all changed files. The changes are straightforward:

  1. The original asgi.py content moved verbatim to workers/asgi.py.
  2. The old asgi.py replaced with a sys.modules shim to maintain backward compatibility.
  3. A test verifies the shim makes the legacy and new module the same object.

The sys.modules[__name__] = _asgi trick is a well-known Python idiom for module aliasing -- after execution, any import of asgi gets the workers.asgi module object, so all attributes, functions, and even __getattr__ resolve identically. The test at line 15-18 correctly validates this.

No logic bugs, no security issues, no backward compatibility problems. The test coverage is appropriate.

LGTM

github run

Comment thread packages/runtime-sdk/src/asgi.py
@ryanking13
ryanking13 merged commit 16cac5c into main Aug 13, 2026
36 of 37 checks passed
@ryanking13
ryanking13 deleted the gyeongjae/asgi-workers branch August 13, 2026 15:36
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