-
Notifications
You must be signed in to change notification settings - Fork 16
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
Use globals of original(wrapped) function #97
Conversation
Thank you a lot for the PR! I'll take a look, what we can do with old versions this evening |
Also, it will be really glad, if you add a test for your case, that fails for current impl and passes with your changes |
could you briefly share where i should implement the test? can i make a tests/import_test folder and write the test there? |
I'll add the test somewhere and fix the code so it runs in 3.8 and 3.9 also. |
You can just add a test to "tests/test_locals.py" case |
I've added the test in |
I've addressed your comment, and this time hopefully it will pass all the tests |
Yeah, thank you a lot for the fix! |
Would it be possible to release another version by the weekend? |
I tried to release it yesterday already, but there are some troubles with |
@yuyupopo the job is done - you can update FastDepends to 2.4.4 - all should works fine |
Thanks a lot! |
Thank your for the PR! |
Fixes: airtai/faststream#1492
The original issue happens because the function is wrapped with a decorator, and type annotation resolution is done in the the decorator's globals. The fix uses
func.__module__
instead offunc.__globals__
This is because
wraps
copies the__module__
of the wrapped function, but not the__globals__