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

feat: add types for mypy #101

Merged
merged 10 commits into from
Feb 1, 2024
Merged

feat: add types for mypy #101

merged 10 commits into from
Feb 1, 2024

Conversation

lexi-k
Copy link
Contributor

@lexi-k lexi-k commented Nov 6, 2023

No description provided.

@augi
Copy link
Member

augi commented Jan 25, 2024

May I ask you to resolve the conflicts? 🙏 Thanks!

@lexi-k
Copy link
Contributor Author

lexi-k commented Jan 30, 2024

The integration tests are failing on my Windows machine so I am not sure if os is the issue. Let's wait for the tests here.

Copy link
Contributor

@n1ngu n1ngu left a comment

Choose a reason for hiding this comment

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

Why is pylint being removed?

setup.cfg Outdated

[options.entry_points]
pytest11 =
docker = pytest_docker

[tool:pytest]
addopts = --verbose --pylint-rcfile=setup.cfg
# --pylint --pycodestyle
addopts = --verbose --mypy --pycodestyle
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd expect the --mypy flag no to be enabled by default, just as --pycodestyle or --pylint

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I initially removed pylint since the usage of it was commented out and it really was broken when uncommented and run on master branch. Same for pycodestyle. With pycodestyle it was a 2min easy fix so I kept it. With pylint the issue seemed harder to fix and since it could not be used I removed the dependency. But it got me thinking that it can't be that hard and that I can't be that lazy so I added it back and fixed the issues with it.

Let me disagree in the most possible way please, that it should not be enabled by default. I kind of strongly think the opposite. The pylint, pycodestyle and now mypy are included to enforce some coding standards. If you want to test the code without it, feel free to disable it, but for the code to be accepted, the automatic tests should always pass with these tools enabled (and the code rules therefore be enforced). That being said, I am open to argument and changing my stands here if you would have a strong case for not enabling it by default.

One more thing to add, mypy is being added primarily because I got fond of adding # type: ignore in our code every time we import this library so even if we could technically disable pycodestyle and pylint in tests, I think that we kindof need mypy to be "happy" all the time, so we can rely on the type hints of the imported code used in our apps.

Copy link
Member

@augi augi Jan 31, 2024

Choose a reason for hiding this comment

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

The pylint is enabled again, so we can resolve this discussion, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd just expect those not to be enabled by default from config files.

Totally agree that all those checks should be enforced for code to be accepted. IMHO pytest --mypy --pycodestyle --pylint should be the test instruction in CI, but not the default for local runs.

Just a comment, no strong opinion about it!

@lexi-k lexi-k requested a review from n1ngu January 30, 2024 18:43
CHANGELOG.md Outdated
@@ -1,5 +1,11 @@
# Changelog
Copy link
Member

Choose a reason for hiding this comment

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

Please remove this file completely, the Releases page is used instead 🙏 Or, change the version to 3.1.0. Or don´t touch this file in this PR, and I will remove this file in another PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, please remove the file in another PR I will undo my changes.

@augi augi merged commit 0b89c76 into avast:master Feb 1, 2024
20 checks passed
hsheth2 added a commit to hsheth2/pytest-docker that referenced this pull request Feb 1, 2024
This is already supported in the code, just fixing a regression in the type annotations from avast#101
augi pushed a commit that referenced this pull request Feb 2, 2024
This is already supported in the code, just fixing a regression in the type annotations from #101
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.

3 participants