diff options
| author | Matti Picus <matti.picus@gmail.com> | 2023-01-22 23:16:04 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-22 13:16:04 -0800 |
| commit | 3d21a27db036f408ea4d21ac011ac082b49b4aeb (patch) | |
| tree | 2c69f5fc1147e4a63f4aab3eccba9fbfc482021a /tools | |
| parent | 6ff22e240dd4087ef187f1bda021f7a7773aba69 (diff) | |
| download | numpy-3d21a27db036f408ea4d21ac011ac082b49b4aeb.tar.gz | |
DOC: fail the CI build and do not deploy if docs are not created (#23065)
Adds protection against deploying empty docs when sphinx build fails
in circleCI.
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/ci/push_docs_to_repo.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/ci/push_docs_to_repo.py b/tools/ci/push_docs_to_repo.py index e34522a29..0471e3824 100755 --- a/tools/ci/push_docs_to_repo.py +++ b/tools/ci/push_docs_to_repo.py @@ -19,6 +19,8 @@ parser.add_argument('--committer', default='numpy-commit-bot', help='Name of the git committer') parser.add_argument('--email', default='numpy-commit-bot@nomail', help='Email of the git committer') +parser.add_argument('--count', default=1, type=int, + help="minimum number of expected files, defaults to 1") parser.add_argument( '--force', action='store_true', @@ -31,6 +33,11 @@ if not os.path.exists(args.dir): print('Content directory does not exist') sys.exit(1) +count = len([name for name in os.listdir(args.dir) if os.path.isfile(os.path.join(args.dir, name))]) + +if count < args.count: + print(f"Expected {args.count} top-directory files to upload, got {count}") + sys.exit(1) def run(cmd, stdout=True): pipe = None if stdout else subprocess.DEVNULL |
