-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
Reduce pytest warnings to zero #2707
Reduce pytest warnings to zero #2707
Conversation
- Remove `lint_python` CI job - Move `pyupgrade` job to `pre-commit` workflow
…er.py by using the self._frames_per_sec value as default value if video.frames_per_second is missing
… video.output_frames_per_seconds are the updated frames_per_sec and output_frames_per_sec values
…ime steps (this happened with CartPole), if step is done then reset the environment _check_box_obs, fixed spelling of maxmimum to maximum for ignoring the warning
…space that throw a warning to ignore them
…that produce a single element (not an array as contains expected)
I'm not sure it's a good idea to transform warnings into errors, I think warnings and errors are two different things and having the flexibility of allowing warnings to pass the CI can sometimes be a good thing. |
Thanks for the comment. I agree with you but in your example, couldn't they just create a separate PR to address the DeprecatedWarnings? Do you think we should only be throwing errors for user warnings? |
# Conflicts: # .pre-commit-config.yaml # CONTRIBUTING.md # gym/envs/classic_control/acrobot.py # gym/envs/toy_text/blackjack.py # gym/envs/toy_text/frozen_lake.py # gym/wrappers/__init__.py
# Conflicts: # .pre-commit-config.yaml # CONTRIBUTING.md # gym/envs/classic_control/acrobot.py # gym/envs/toy_text/blackjack.py # gym/envs/toy_text/frozen_lake.py # gym/wrappers/__init__.py
…pytest-warnings-to-errors # Conflicts: # gym/envs/toy_text/blackjack.py
… from the low and high array dtypes
Yes they could, but maybe they're working on something unrelated to this warning, which could be fixed in its own specific PR.
IMHO I don't think we should force any warnings to become errors. I agree those are annoying but I think the situation you're referring to was different as we got all those warnings at once because of a bug in Also I don't know if you saw that but there's now a checkbox in the PR template so that developers keep in mind to check for new warnings. |
Thanks for the feedback @kir0ul, I agree that this is an important PR that we should consider carefully before merging and I think it would be reasonable not to do so. However, I think there are several important advantages to it
I agree with this however, if it is a separate issue, then it would naturally make sense for another PR to make such changes. Or if necessary I believe a force merge could ignore the failing tests As well, as this commit, sets the number of warnings to zero, then any new warnings that arise should be caused by the changes made by the PR. Meaning that the PR would address their own issues. This is one of the advantages of stopping warnings early is that the person causing the issue, also has to solve them. Rather than waiting for a while before fixing, by possibly someone new who may misunderstand the original code or the original author who may have forgotten their implementation.
This is fair, but as I explained above, I think that is very unlikely get ~1500 warnings again, due to eliminating them as they occur and that they would only have to address the warnings caused by themselves most likely.
I hadn't noticed that changes, thanks for doing that, the problem is that the github build actions don't show the number of warnings so it is easy to forget to check if the person has removed warnings. Allowing the number of warnings to increase again, causing the issue above. Is there something I missing? If this is too radical a change to make then I can understand if we don't want to move forward with this PR |
@pseudo-rnd-thoughts could you please fix merge conflicts? |
…e, the function needs to be moved
…o warnings were produced, then we can just remove this
@kir0ul Talking to @jkterry1, while I still think that the idea of reducing warnings is good, this method of doing it could cause too many issues to be helpful. |
Hey, I'm closing this per our discussion, please create a new PR with the changes that are still needed |
As I noted in #2602, it would be nice if the pytest warnings were thrown as errors so if new changes caused issues
Building upon #2602 that updated the CI and #2703 that fixed warnings (but hasn't been PR yet)
This fixes all warnings from #2660, mostly through added filterwarnings to prevent the warnings from being thrown