-
Notifications
You must be signed in to change notification settings - Fork 58
Add type hints to aioftp #164
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
Comments
How will they benefit the project? 🤔 |
Ok, |
Are there any updates? Is there anything I can do to help? |
It looks like #165 is stuck a little. So it is up to you to make new pr. |
Okay, I'm on it. Is the target version of Python now 3.8? Previously as I see in the pr it was 3.11 |
Yep, I set to 3.11 before, but forget about old versions life cycle. So right now it is 3.8+. |
Hi, working on a pull request with added typing is nearing completion, but I've run into some issues. First I would like to know if a comparison of type analyzer tools has been done? I saw that mypy was discussed in a past pull request, is it still the choice? Or maybe there is an option to use pyright? My main type analyzer tool at work is pyright, so I decided to simplify things a bit and use a more familiar tool to start with. So, I used it to fix (actually most of it, the rest needs discussion because it goes beyond just type checking and I didn't dare touch it without discussion) all the typing errors and turned on mypy, assuming that there might be some minor differences that could be fixed. But I encountered missing functionality in mypy. I'm talking about this use case, which pyright implemented a few years ago: microsoft/pyright#2737. Regarding mypy, I also think in this case I can fix the code using the protocol. |
IDK which is better, but for me mypy is 99% ok. I'm using it in some projects. You can use any type checker you want, since there are no type linters right now. |
@pohmelie Hi, is there any information somewhere about what you need to run to run the tests? |
I mean I get a timeout error when running tests. |
There are no «special» requirements for tests. You can check instructions in github workflows ( |
Yeah, that's what I did. But I get an error on test 45 |
Is there any traceback? |
|
Maybe you have something on |
Tried a different set of addresses, nothing worked. |
Try test this inside docker container. Maybe it is MacOS relevant problem? |
Or, maybe you have pushed code somewhere so I can take a look why it is stuck. |
It could be macOS. I'll run it in docker tomorrow first. |
And I checked running tests from the main branch, I get the same timeout error. |
Here is the code to reproduce expected behavior: import asyncio
import time
async def main():
try:
start = time.perf_counter()
await asyncio.open_connection("127.0.0.2", 2121)
except OSError as e:
print("open_connection exception", e)
finally:
print("time elapsed", time.perf_counter() - start)
asyncio.run(main()) I have such output on ubuntu 22.04 and python 3.11.2:
|
I have:
|
@9en9i try to use non-existent hostname instead of |
If I change the IP to localhost, I get this output:
|
For any non-existent I get the output:
|
Ok, so I need a fix for tests from my side. I will note in pr when it landed. |
Since the aioftp requires Python3.7+ right now, type hints may benefit the project.
The text was updated successfully, but these errors were encountered: