-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add type Path on web app run #6843
Conversation
@Dreamsorcerer Here the new |
for more information, see https://pre-commit.ci
The previous error was due to a python library ? |
Mypy gets its type information from typeshed, which is just a collection of annotations, because cpython doesn't have any annotations itself. |
So, that error will disappear when there's a new mypy release which will include the updated typeshed. |
Oh okay thanks for the information now we have this error : aiohttp/web_runner.py:199: error: Incompatible return value type (got "Union[str, Path]", expected "str") [return-value] I need to change str to Union[str, Path] for the name(self) function ? |
You had partial changes to NamedPipeSite, I was just playing with them. I've reverted the change, as it's not clear to me whether someone would actually want to use a |
Oh okay, use Path permit to avoid doing some convertion between Path and str i thinks |
For the doc web_reference.rst how can i says str or Path :param str path: ? |
Ah, good point. Take a look at add_static(), it mentions Path there: https://docs.aiohttp.org/en/stable/web_reference.html#aiohttp.web.UrlDispatcher.add_static |
Codecov Report
@@ Coverage Diff @@
## master #6843 +/- ##
===========================================
+ Coverage 21.76% 93.44% +71.68%
===========================================
Files 104 104
Lines 30627 30629 +2
Branches 3076 3076
===========================================
+ Hits 6666 28622 +21956
+ Misses 23849 1838 -22011
- Partials 112 169 +57
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. |
I just commit the change, i hope all test will pass |
The test which fail it's because of a gcc error |
Backport to 3.9: 💔 cherry-picking failed — conflicts found❌ Failed to cleanly apply f90cb19 on top of patchback/backports/3.9/f90cb1952c272936845b93a8f424b32e703d545c/pr-6843 Backporting merged PR #6843 into master
🤖 @patchback |
If you could follow the steps above to get this in to 3.9, that'd be great. |
I just do it @Dreamsorcerer and now i wait |
@@ -290,7 +291,7 @@ async def _run_app( | |||
*, | |||
host: Optional[Union[str, HostSequence]] = None, | |||
port: Optional[int] = None, | |||
path: Optional[str] = None, | |||
path: Optional[Union[str, Path]] = None, |
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.
@Dreamsorcerer I wonder if this should've been os.PathLike
instead...
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.
Hmm, seems we even have a PathLike in typedefs.py.
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.
i didn't see it, you want me to use it or keep path from Pathlib ?
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.
I'm already on it. Updating a couple of other places too.
#6876
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.
You update this pull request ? #6874
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.
You update this pull request ? #6874
No, backports must be as close to the original patch as possible, for traceability.
(cherry picked from commit f90cb19)
3.9 backport PR: #6957. |
Co-authored-by: SamirAk <[email protected]> Co-authored-by: Samir Akarioh <[email protected]>
What do these changes do?
I modify the web.py file and add Union[str,pathlib.Path] for path
Are there changes in behavior for the user?
For the option of path, we can have str or pathlib.path
Related issue number
#6839
Checklist
CONTRIBUTORS.txt
CHANGES
folder<issue_id>.<type>
for example (588.bugfix)issue_id
change it to the pr id after creating the pr.feature
: Signifying a new feature..bugfix
: Signifying a bug fix..doc
: Signifying a documentation improvement..removal
: Signifying a deprecation or removal of public API..misc
: A ticket has been closed, but it is not of interest to users.