17 lines
506 B
Python
17 lines
506 B
Python
import py_compile, glob, sys
|
|
ok = True
|
|
for f in sorted(glob.glob("scraper/*.py")):
|
|
try:
|
|
py_compile.compile(f, doraise=True)
|
|
print("OK ", f)
|
|
except py_compile.PyCompileError as e:
|
|
ok = False
|
|
print("FAIL", f)
|
|
print(e)
|
|
print("---IMPORT---")
|
|
import scraper
|
|
print("import scraper OK, version", scraper.__version__)
|
|
from scraper.parsers import parse, parse_html
|
|
print("parse/parse_html callable:", callable(parse), callable(parse_html))
|
|
sys.exit(0 if ok else 1)
|