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: Remove mypy deps install step in python_cache action #3956

Merged
merged 3 commits into from
Jan 26, 2023

Conversation

silvanocerza
Copy link
Contributor

@silvanocerza silvanocerza commented Jan 26, 2023

Related Issues

https://github.com/deepset-ai/haystack/actions/runs/4014088908/jobs/6894191362

Proposed Changes:

Remove the step that install mypy deps in the python_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 in python_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 in python_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.

Use --install-types with --non-interactive to install all suggested stub packages without asking for confirmation, and type check your code

For more info about the individual flags see --install-types and --non-interactive documentation.

Checklist

  • I have read the contributors guidelines and the code of conduct
  • I have updated the related issue with new insights and changes
  • I added tests that demonstrate the correct behavior of the change
  • I've used one of the conventional commit types for my PR title: fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, test:.
  • I documented my code
  • I ran pre-commit hooks and fixed any issue

@silvanocerza silvanocerza requested a review from a team as a code owner January 26, 2023 11:32
@silvanocerza silvanocerza self-assigned this Jan 26, 2023
@silvanocerza silvanocerza requested review from vblagoje and bogdankostic and removed request for a team January 26, 2023 11:32
@anakin87
Copy link
Member

Somehow related to #3930.

echo "changed_files=$changed_files" >> $GITHUB_OUTPUT
with:
files: |
*.py
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

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.

Copy link
Contributor

@masci masci left a 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/
Copy link
Contributor

@masci masci Jan 26, 2023

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)?

Copy link
Contributor Author

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. 🤷

@silvanocerza silvanocerza merged commit 4493483 into main Jan 26, 2023
@silvanocerza silvanocerza deleted the fix-setup-python-mypy branch January 26, 2023 13:17
ZanSara pushed a commit that referenced this pull request Jan 27, 2023
* Remove mypy deps install step in python_cache action

* Remove step caching mypy dependencies

* Add ignore files in changed files retrieval step
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants