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

ci: introduce mypy to the project #145

Merged
merged 11 commits into from
May 6, 2022

Conversation

skarzi
Copy link
Contributor

@skarzi skarzi commented May 2, 2022

This PR is a draft and before merging it following things need to be done:

  • establish mypy configuration
  • fix type hintings

Copy link
Contributor

@youtux youtux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can have a separate PR just for the isort?

.pre-commit-config.yaml Outdated Show resolved Hide resolved
@youtux
Copy link
Contributor

youtux commented May 2, 2022

If it gives less headaches, we can use pyright instead of mypy

@skarzi skarzi changed the title ci: introduce isort and mypy to the project ci: introduce mypy to the project May 2, 2022
@skarzi skarzi force-pushed the feature/introduce-mypy-and-isort branch from 773f7b5 to 5f92690 Compare May 4, 2022 09:39
pytest_factoryboy/fixture.py Outdated Show resolved Hide resolved
pytest_factoryboy/fixture.py Outdated Show resolved Hide resolved
pytest_factoryboy/plugin.py Show resolved Hide resolved
pyproject.toml Show resolved Hide resolved
pyproject.toml Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
pytest_factoryboy/fixture.py Outdated Show resolved Hide resolved
pytest_factoryboy/fixture.py Outdated Show resolved Hide resolved
pytest_factoryboy/fixture.py Outdated Show resolved Hide resolved
pytest_factoryboy/fixture.py Show resolved Hide resolved
pytest_factoryboy/fixture.py Outdated Show resolved Hide resolved
pytest_factoryboy/plugin.py Show resolved Hide resolved
@youtux
Copy link
Contributor

youtux commented May 4, 2022

I notified mypy developers of the issue we have in CI with the call to staticmethod(...): python/mypy#4574 (comment)

@@ -191,7 +191,7 @@ def inject_into_caller(name: str, function: Callable, locals_: dict[str, Any]) -
# Therefore, we can just check for __qualname__ to figure out if we are in a class, and apply the @staticmethod.
is_class_or_function = "__qualname__" in locals_
if is_class_or_function:
function = staticmethod(function)
function = staticmethod(function) # type: ignore[assignment]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since the build is now failing because of a bug of mypy and this line, I would say to remove the type: ignore[assignment] from here, and change the mypy builds to do a "ignore_outcome = true" so that we won't block on a failure on mypy for now.

tox.ini Show resolved Hide resolved
@youtux youtux merged commit ad5175d into pytest-dev:master May 6, 2022
@youtux
Copy link
Contributor

youtux commented May 6, 2022

Thank you @skarzi !

@skarzi skarzi deleted the feature/introduce-mypy-and-isort branch May 9, 2022 06:16
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