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

Update cache restore to include python version #479

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

YaraslauZhylko
Copy link
Contributor

@YaraslauZhylko YaraslauZhylko commented Feb 13, 2023

Description

Use separate .venv cache for each Python version because poetry install does put Python executable into the .venv directory thus propagating the the version of the first install into other matrix tests.

Validation

image

Related Issues

@codecov-commenter
Copy link

codecov-commenter commented Feb 13, 2023

Codecov Report

Patch coverage has no change and project coverage change: +0.01 🎉

Comparison is base (eb14537) 78.92% compared to head (2610d3f) 78.94%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #479      +/-   ##
==========================================
+ Coverage   78.92%   78.94%   +0.01%     
==========================================
  Files          14       14              
  Lines        1177     1178       +1     
==========================================
+ Hits          929      930       +1     
  Misses        248      248              
Flag Coverage Δ
unit 78.94% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@YaraslauZhylko YaraslauZhylko marked this pull request as ready for review February 13, 2023 11:33
@@ -145,7 +146,7 @@ jobs:
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/pyproject.toml') }}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. Using ${{ steps.setup-python.outputs.python-version }} because ${{ matrix.pyver }} resolves to nothing. 🤷‍♂️
  2. Using the hash of the pyproject.toml because poetry.lock got removed in Add poetry.lock to .gitignore #457.

Copy link
Contributor

Choose a reason for hiding this comment

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

${{ matrix.pyver }} perhaps

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm... 🤔

Last time I tried 2 weeks ago, ${{ matrix.pyver }} did not work (resolved to nothing). That's why I mentioned it in the comments.

But today it worked. 🤷‍♂️

Maybe GitHub Action got update, or maybe I mistyped something...

So I fixed the code to use matrix.pyver.

@YaraslauZhylko
Copy link
Contributor Author

YaraslauZhylko commented Feb 13, 2023

pypy-3.7 failure seems to be unrelated to the change and may be a good example of errors that were hidden because of the initial bug: https://github.com/redis/redis-om-python/actions/runs/4162876200/jobs/7202607098#step:7:397

@YaraslauZhylko
Copy link
Contributor Author

pypy-3.7 failure seems to be unrelated to the change

nashant/kopf@ab5377b#diff-4d7c51b1efe9043e44439a949dfd92e5827321b34082903477fd04876edb7552R17-R18

@YaraslauZhylko
Copy link
Contributor Author

YaraslauZhylko commented Feb 28, 2023

@chayim @dvora-h This one is ready for review.

But I do not know what's the best way to fix the issue with pypy-3.7.
Deprecate pypy-3.7?
Find some replacement for typed-ast?
Limit mypy dependency to cpython implementation only (like this)?

@chayim
Copy link
Contributor

chayim commented Mar 1, 2023

@YaraslauZhylko The only issue with the flow currently is the reliance on a single cache (definitely a bug!). However, poetry's install addresses that. You'll note that the python versions, are installed appropriately via the action. However, the cache key could include ${{ matrix.pyver }} as mentioned in the review.

@chayim chayim changed the title chore(ci): run tests with correct python version Update cache restore to include python version Mar 1, 2023
@YaraslauZhylko
Copy link
Contributor Author

@chayim Fixed the ${{ matrix.pyver }} part (see review comment above).

But what should we do with mypy and types-ast for pypy-3.7?

@YaraslauZhylko YaraslauZhylko force-pushed the chore/run-tests-with-correct-python branch from 850f9fa to 9e4ff1d Compare March 1, 2023 13:47
@YaraslauZhylko
Copy link
Contributor Author

YaraslauZhylko commented Mar 1, 2023

@chayim Now Dependency Audit fails as well. 😅

Will merging #483 fix that? All GitHub actions seem to be green for it.

@YaraslauZhylko
Copy link
Contributor Author

@chayim Limited mypy to cpython implementation only to solve the types-ast issue.
Please let me know if we should handle this differently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants