Skip to content

Commit 417a10b

Browse files
Only apply isort to known source files/dirs
For example, if you would create a virtual environment in the subfolder venv, isort will check all of the installed packages in that venv. This also fixes a small bug where the ">=5" at the end of the pip install command for isort would be interpreted as a redirect, creating a file "=5" with the output from pip.
1 parent 65ab938 commit 417a10b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

ci.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
set -ex
44

5+
CHECK_FILES="setup.py src tests"
56
YAPF_VERSION=0.20.1
67

78
pip install -U pip setuptools wheel
@@ -10,16 +11,16 @@ python setup.py sdist --formats=zip
1011
pip install dist/*.zip
1112

1213
if [ "$CHECK_FORMATTING" = "1" ]; then
13-
pip install yapf==${YAPF_VERSION} isort>=5
14-
if ! yapf -rpd setup.py src tests; then
14+
pip install yapf==${YAPF_VERSION} "isort>=5"
15+
if ! yapf -rpd $CHECK_FILES; then
1516
cat <<EOF
1617
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1718
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1819
1920
Formatting problems were found (listed above). To fix them, run
2021
2122
pip install yapf==${YAPF_VERSION}
22-
yapf -rpi setup.py src tests
23+
yapf -rpi $CHECK_FILES
2324
2425
in your local checkout.
2526
@@ -32,15 +33,15 @@ EOF
3233
# required for isort to order test imports correctly
3334
pip install -Ur test-requirements.txt
3435

35-
if ! isort --check-only --diff . ; then
36+
if ! isort --check-only --diff $CHECK_FILES ; then
3637
cat <<EOF
3738
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3839
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3940
4041
Formatting problems were found (listed above). To fix them, run
4142
4243
pip install isort
43-
isort .
44+
isort $CHECK_FILES
4445
4546
in your local checkout.
4647

0 commit comments

Comments
 (0)