You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create lintrunner-mypy so main lintrunner job doesn't have to build
lintrunner is required to land, but it takes 10-15 minutes. Can we cut that down if we split out MYPY?
ghstack-source-id: 00a3261
ghstack-comment-id: 3282934023
Pull-Request: #14240
# This has already been cached in the docker image
49
-
lintrunner init
48
+
RC=0
49
+
# Run lintrunner on all files
50
+
if ! lintrunner --force-color --all-files --take MYPY --tee-json=lint.json 2> /dev/null; then
51
+
echo ""
52
+
echo -e "\e[1m\e[36mYou can reproduce these results locally by using \`lintrunner --take MYPY\`. (If you don't get the same results, run \'lintrunner init\' to update your local linter)\e[0m"
53
+
echo -e "\e[1m\e[36mSee https://github.com/pytorch/pytorch/wiki/lintrunner for setup instructions.\e[0m"
54
+
RC=1
55
+
fi
56
+
57
+
# Use jq to massage the JSON lint output into GitHub Actions workflow commands.
# The generic Linux job chooses to use base env, not the one setup by the image
78
+
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
79
+
conda activate "${CONDA_ENV}"
80
+
81
+
# Not sure why this isn't set up in the docker
82
+
# image. lintrunner-mypy seems to work becaus setup-linux.sh
83
+
# does this as part of install_executorch.
84
+
pip install -r requirements-dev.txt
85
+
86
+
CACHE_DIRECTORY="/tmp/.lintbin"
87
+
# Try to recover the cached binaries
88
+
if [[ -d "${CACHE_DIRECTORY}" ]]; then
89
+
# It's ok to fail this as lintrunner init would download these binaries
90
+
# again if they do not exist
91
+
cp -r "${CACHE_DIRECTORY}" . || true
92
+
fi
50
93
51
94
RC=0
52
95
# Run lintrunner on all files
53
-
if ! lintrunner --force-color --all-files --tee-json=lint.json 2> /dev/null; then
96
+
if ! lintrunner --force-color --all-files --skip MYPY --tee-json=lint.json 2> /dev/null; then
54
97
echo ""
55
-
echo -e "\e[1m\e[36mYou can reproduce these results locally by using \`lintrunner\`. (If you don't get the same results, run \'lintrunner init\' to update your local linter)\e[0m"
98
+
echo -e "\e[1m\e[36mYou can reproduce these results locally by using \`lintrunner --skip MYPY\`. (If you don't get the same results, run \'lintrunner init\' to update your local linter)\e[0m"
56
99
echo -e "\e[1m\e[36mSee https://github.com/pytorch/pytorch/wiki/lintrunner for setup instructions.\e[0m"
0 commit comments