(pyplot_path)
| 377 | |
| 378 | |
| 379 | def build_pyplot(pyplot_path): |
| 380 | pyplot_orig = pyplot_path.read_text().splitlines(keepends=True) |
| 381 | try: |
| 382 | pyplot_orig = pyplot_orig[:pyplot_orig.index(PYPLOT_MAGIC_HEADER) + 1] |
| 383 | except IndexError as err: |
| 384 | raise ValueError('The pyplot.py file *must* have the exact line: %s' |
| 385 | % PYPLOT_MAGIC_HEADER) from err |
| 386 | |
| 387 | with pyplot_path.open('w') as pyplot: |
| 388 | pyplot.writelines(pyplot_orig) |
| 389 | pyplot.writelines(boilerplate_gen()) |
| 390 | |
| 391 | # Run black to autoformat pyplot |
| 392 | subprocess.run( |
| 393 | [sys.executable, "-m", "black", "--line-length=88", pyplot_path], |
| 394 | check=True |
| 395 | ) |
| 396 | |
| 397 | |
| 398 | ### Methods for retrieving signatures from pyi stub files |
no test coverage detected
searching dependent graphs…