Skip to content

Type hinting needed for 'psycopg2' and 'psutil' functions #8502

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

Closed
tareqpi opened this issue Aug 6, 2022 · 1 comment · Fixed by #8500 or #8501
Closed

Type hinting needed for 'psycopg2' and 'psutil' functions #8502

tareqpi opened this issue Aug 6, 2022 · 1 comment · Fixed by #8500 or #8501

Comments

@tareqpi
Copy link
Contributor

tareqpi commented Aug 6, 2022

I am currently working on a project that checks for static typing in its CI workflow. When running mypy, errors occur because untyped third-party libraries functions are called in a typed context in the project. Therefore, the addition of the correct type hinting is needed so that mypy stops complaining. Below is the mentioned test result.

https://github.com/tareqpi/Nominatim/runs/7705136880?check_suite_focus=true#step:14:12

@tareqpi tareqpi changed the title Type hinting needed for psycopg2 fetch and parsing of DSN functions Type hinting needed for 'psycopg2' and 'psutil' functions Aug 6, 2022
@Akuli
Copy link
Collaborator

Akuli commented Aug 7, 2022

I recommend adding disable_error_code = no-untyped-call to your mypy.ini. This tells mypy to not complain when you call untyped functions. Lots of things are still untyped, so limiting yourself to functions that happen to be typed isn't reasonable yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants