-
Notifications
You must be signed in to change notification settings - Fork 51
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
Replace (part of) pretest of CI with Pre-commit equivalent #918
Conversation
Hmm this doesnt quite work: seems like it's only running the pre-commit workflow at the moment. |
Is there a corrector is the pre-commit? 😯 That's great! It seems the pre-commit is missing the doc compilation. That's to long to be included in the pre-commit indeed but should still be part of the pre-tests. |
There also seems to be no equivalent for pylint in the pre-commit. |
Ok @bouthilx I left the |
.github/workflows/build.yml
Outdated
pretest: | ||
needs: pre-commit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we not wait for pre-commit? If we could set the execution of pre-commit in tox we could have toxenv: [pylint, docs, pre-commit]
so that the main tests still depends on the same pretests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main tests still depend on the same pretests though, right?
I dont quite understand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would be the advantage of running pre-commit through tox vs running pre-commit as a github action with the same jobs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running them through tox would make it possible to include the pre-commit tests in the current pre-test matrix. Having the pre-commit tests available in the tox config would also make it possible to run these tests locally if necessary outside of the pre-commit hook.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: The tests can be run locally with pre-commit run <hook_name>, and either --all-files
, or --files <files>
.
What is blocking this PR at the moment? |
As far as I recall, I need to basically fix a few tests that got broken by removing unused imports in all modules. |
Signed-off-by: Fabrice Normandin <normandf@mila.quebec>
Signed-off-by: Fabrice Normandin <normandf@mila.quebec>
Signed-off-by: Fabrice Normandin <normandf@mila.quebec>
Signed-off-by: Fabrice Normandin <normandf@mila.quebec>
Signed-off-by: Fabrice Normandin <normandf@mila.quebec>
Signed-off-by: Fabrice Normandin <normandf@mila.quebec>
Signed-off-by: Fabrice Normandin <normandf@mila.quebec>
I was previously adding some more hooks. I'll instead keep those locally, but only replicate the current CI setup with pre-commit. Signed-off-by: Fabrice Normandin <normandf@mila.quebec>
This removes the need to import fixtures as unused variables in the other test packages. The autoflake hook removed those unused imports, and with this, we don't need to import them in the first place. Signed-off-by: Fabrice Normandin <normandf@mila.quebec>
Signed-off-by: Fabrice Normandin <normandf@mila.quebec>
Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
@@ -219,7 +219,7 @@ def load_data( | |||
raise RuntimeError( | |||
f"Download finished, but file {file} still doesn't exist!" | |||
) | |||
with open(file, "r") as f: | |||
with open(file) as f: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't pylint complain about not specifying the encoding? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be awesome to use, thanks a lot!
Addresses #918
Also applies the formatting, spelling mistakes, and python upgrade hooks to all files.