Skip to content

Commit 8af617b

Browse files
committed
Move pytype options out of travis_script into setup.cfg.
1 parent 373dbae commit 8af617b

2 files changed

Lines changed: 9 additions & 12 deletions

File tree

build_scripts/travis_script.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,9 @@
99

1010
import build_utils
1111

12-
def _ismod(f):
13-
"""Return True if f is a Python module but not a test module."""
14-
return f.endswith(".py") and not f.endswith("_test.py")
15-
1612

1713
STEP = collections.namedtuple("STEP", ["name", "command"])
1814

19-
PYTYPE_COMMAND = os.path.join("out", "bin", "pytype")
20-
PYC_DIR = os.path.join(build_utils.PYTYPE_SRC_ROOT, "pytype", "pyc")
21-
PYC_FILES = [os.path.join(PYC_DIR, f) for f in os.listdir(PYC_DIR) if _ismod(f)]
22-
TYPECHECK_FILES = [
23-
"pytype/compat.py", "pytype/debug.py", "pytype/utils.py"] + PYC_FILES
24-
2515

2616
def _begin_step(s):
2717
print("")
@@ -48,15 +38,15 @@ def _run_steps(steps):
4838
_report_failure(s)
4939
sys.exit(1)
5040
_end_step(s)
51-
41+
5242

5343
def main():
5444
s1 = STEP(name="Build",
5545
command=["python", build_utils.build_script("build.py")])
5646
s2 = STEP(name="Run Tests",
5747
command=["python", build_utils.build_script("run_tests.py"), "-f"])
5848
s3 = STEP(name="Type Check",
59-
command=[PYTYPE_COMMAND] + TYPECHECK_FILES)
49+
command=[os.path.join("out", "bin", "pytype")])
6050
_run_steps([s1, s2, s3])
6151
print("\n*** All build steps completed successfully! ***\n")
6252

setup.cfg

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
11
[pytype]
22
python_version = 2.7
3+
inputs =
4+
pytype/compat.py
5+
pytype/debug.py
6+
pytype/pyc/
7+
pytype/utils.py
8+
exclude =
9+
**/*_test.py

0 commit comments

Comments
 (0)