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: fe28042
ghstack-comment-id: 3282934023
Pull-Request: #14240
if ! lintrunner --force-color --all-files --tee-json=lint.json 2> /dev/null; then
53
+
if ! lintrunner --force-color --all-files --take MYPY --tee-json=lint.json 2> /dev/null; then
54
+
echo ""
55
+
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"
56
+
echo -e "\e[1m\e[36mSee https://github.com/pytorch/pytorch/wiki/lintrunner for setup instructions.\e[0m"
57
+
RC=1
58
+
fi
59
+
60
+
# 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
81
+
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
82
+
conda activate "${CONDA_ENV}"
83
+
84
+
# Not sure why this isn't set up in the docker
85
+
# image. lintrunner-mypy seems to work becaus setup-linux.sh
86
+
# does this as part of install_executorch.
87
+
pip install -r requirements-dev.txt
88
+
89
+
CACHE_DIRECTORY="/tmp/.lintbin"
90
+
# Try to recover the cached binaries
91
+
if [[ -d "${CACHE_DIRECTORY}" ]]; then
92
+
# It's ok to fail this as lintrunner init would download these binaries
93
+
# again if they do not exist
94
+
cp -r "${CACHE_DIRECTORY}" . || true
95
+
fi
96
+
97
+
# This has already been cached in the docker image
98
+
lintrunner init
99
+
100
+
RC=0
101
+
# Run lintrunner on all files
102
+
if ! lintrunner --force-color --all-files --skip MYPY --tee-json=lint.json 2> /dev/null; then
54
103
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"
104
+
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
105
echo -e "\e[1m\e[36mSee https://github.com/pytorch/pytorch/wiki/lintrunner for setup instructions.\e[0m"
0 commit comments