Skip to content

Commit

Permalink
Fix mypy cache dir not being created (Cherry-pick of #20139) (#20142)
Browse files Browse the repository at this point in the history
This PR fixes an issue/bug mentioned in #19888. 

**Problem**
Internal mypy cache directory/folder used by Pants is not being created.
Therefore, the mypy cache cannot moved copied from temporary cache
location
[here](https://github.com/pantsbuild/pants/blob/d5ffed441396d89a2a7bc52fc994c52a00808f8a/src/python/pants/backend/python/typecheck/mypy/rules.py#L306)

**Solution**
Make sure the mypy cache directory/folder is created.

Co-authored-by: csqzhang <[email protected]>
Co-authored-by: Josh Cannon <[email protected]>
  • Loading branch information
3 people authored Nov 2, 2023
1 parent cdfb17a commit 96d5a2c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/python/pants/backend/python/typecheck/mypy/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ async def mypy_typecheck_partition(
SANDBOX_CACHE_DIR="{run_cache_dir}/{py_version}"
SANDBOX_CACHE_DB="$SANDBOX_CACHE_DIR/cache.db"
{mkdir.path} -p "$NAMED_CACHE_DIR" > /dev/null 2>&1
{mkdir.path} -p "$SANDBOX_CACHE_DIR" > /dev/null 2>&1
{cp.path} "$NAMED_CACHE_DB" "$SANDBOX_CACHE_DB" > /dev/null 2>&1
Expand Down

0 comments on commit 96d5a2c

Please sign in to comment.