Skip to content
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 annotations for backend/base.py #717

Merged
merged 7 commits into from
Jul 21, 2023

Conversation

amaslenn
Copy link
Contributor

@amaslenn amaslenn commented Jul 20, 2023

To start with #619.

@ssbarnea could you please review?

I don't know how to configure mypy to check one module with different rules. If that is possible, we can lint backend/base.py more strictly (more changes will be needed).

@amaslenn amaslenn marked this pull request as ready for review July 20, 2023 15:21
testinfra/backend/base.py Outdated Show resolved Hide resolved
testinfra/backend/base.py Outdated Show resolved Hide resolved
@philpep philpep merged commit 8ecab66 into pytest-dev:main Jul 21, 2023
7 checks passed
@philpep
Copy link
Contributor

philpep commented Jul 21, 2023

Merged with minor modification (no need to re-type variables in __init__()).

Thanks!

We now have a strict mypy configuration for typed code https://github.com/pytest-dev/pytest-testinfra/blob/main/mypy.ini . So I think we can gradually add types from low-level code up to all code.

However I think some part of the code must be simplified to make adding types easier (refactoring & use some dataclasses).

@amaslenn amaslenn deleted the base-types branch July 22, 2023 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants