-
Notifications
You must be signed in to change notification settings - Fork 55
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
Develop Decouple Issue #99 #100
base: main
Are you sure you want to change the base?
Conversation
nest/engine/types.py
Outdated
@@ -0,0 +1,3 @@ | |||
from typing import Callable, TypeAlias, Any |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Failed check: CLI Test / test (MySQLSync)
I’ve attached the relevant part of the log for your convenience:
ImportError: cannot import name 'TypeAlias' from 'typing' module in Python 3.9
Finding type: Log Error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this comment has been addressed. The commit 417821f
has modified the import statement in nest/engine/types.py to resolve the ImportError. The TypeAlias import has been moved from 'typing' to 'typing_extensions', which should fix the issue with Python 3.9 compatibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed using import from typing_extensions instead of typing.
Maybe should check version and decide according to the version
router = APIRouter(tags=[tag] if tag else None) | ||
tags = [tag] if tag else None | ||
# TODO: replace with factory | ||
router: Router = FastAPIRouter(tags=tags) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to think of a way to remove router intilization.
Could be done by creating abs for controller and make instace for fastapi/others.
instead of
from nest.core.decrator import Controller
from nest.decrator.fastapi import Controller
Importent point is creating difference Controller for each framework. Where each one is implementing Controller protocol |
User description
#99
Generated description
Below is a concise technical summary of the changes proposed in this PR:
Decouples the PyNest framework from FastAPI by introducing abstraction layers and protocols. Replaces direct FastAPI imports with custom protocol implementations, allowing for potential future support of different web frameworks. Modifies core classes and decorators to work with these new abstractions. Introduces new modules in the
nest.engine.proto
package to define protocol interfaces for App, Router, and Route.Modified files (7)
Latest Contributors(2)
Modified files (6)
Latest Contributors(0)