-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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: Remove mypy deps install step in python_cache action #3956
Conversation
Somehow related to #3930. |
echo "changed_files=$changed_files" >> $GITHUB_OUTPUT | ||
with: | ||
files: | | ||
*.py |
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.
I think we can ignore files under test/
to make the job even faster, see https://github.com/deepset-ai/haystack/pull/3930/files#diff-1db27d93186e46d3b441ece35801b244db8ee144ff1405ca27a163bfe878957f
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.
Right, I forgot. Adding that.
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.
Noice one! LGTM
@@ -109,7 +103,7 @@ jobs: | |||
if: steps.python-files.outputs.changed_files | |||
run: | | |||
mkdir .mypy_cache/ | |||
mypy ${{ steps.python-files.outputs.changed_files }} | |||
mypy --install-types --non-interactive ${{ steps.python-files.outputs.changed_files }} --exclude=rest_api/build/ --exclude=rest_api/test/ |
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.
nit: you don't need to exclude anything at this point (provided you filter out changed files)?
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.
True that, but might as well leave it I guess? Better safe than sorry. 🤷
* Remove mypy deps install step in python_cache action * Remove step caching mypy dependencies * Add ignore files in changed files retrieval step
Related Issues
https://github.com/deepset-ai/haystack/actions/runs/4014088908/jobs/6894191362
Proposed Changes:
Remove the step that install
mypy
deps in thepython_cache
action.mypy
deps installation is now done directly when invoked on modified*.py
files, this should also make it faster since it only installs depedencies necessary to test those files.This PR also removes the
mypy
caching step inpython_cache
action as there would be nothing to cache.How did you test it?
I didn't, it's CI stuff. I just tested that the commands are correct by running them locally first.
Notes for the reviewer
The step that install
mypy
deps inpython_cache
was called with both--install-types
and--non-interactive
flags, as documented here those two flags used in combination forces type checking the code.For more info about the individual flags see
--install-types
and--non-interactive
documentation.Checklist
I have updated the related issue with new insights and changesI added tests that demonstrate the correct behavior of the changefix:
,feat:
,build:
,chore:
,ci:
,docs:
,style:
,refactor:
,perf:
,test:
.I documented my code