source: trunk/misc/build_helpers/check-build.py

Last change on this file was b856238, checked in by Alexandre Detiste <alexandre.detiste@…>, at 2024-02-15T15:53:34Z

remove old Python2 future statements

  • Property mode set to 100644
File size: 1.6 KB
Line 
1#! /usr/bin/env python
2
3# This helper script is used with the 'test-desert-island' Makefile target.
4
5
6import sys
7
8good = True
9build_out = sys.argv[1]
10mode = sys.argv[2]
11
12print()
13
14for line in open(build_out, "r"):
15    if mode == "no-downloads":
16        # when setup_requires= uses
17        # misc/dependencies/setuptools-0.6c8.egg, it causes a
18        # "Downloading: misc/dependencies/.." line to be emitted,
19        # which doesn't count as a network download.  Lines that start
20        # with "Reading" indicate that it is fetching web pages in
21        # order to check for newer versions of packages. As long as it
22        # doesn't actually download any packages then it still passes
23        # this test. That is: it *would* have succeeded if you were on
24        # a Desert Island, an airplane with no network, behind a
25        # corporate firewall that disallows such connections, or if
26        # you had turned off your network prior to running "python
27        # setup.py build". A stronger requirement would be that it
28        # doesn't even try to check for new packages on remote hosts
29        # if it has all the packages that it needs locally, but we
30        # currently don't enforce that stronger requirement.
31        if (line.startswith("Downloading http:") or
32            line.startswith("Downloading https:")):
33            print(line, end=' ')
34            good = False
35if good:
36    if mode == "no-downloads":
37        print("Good: build did not try to download any files")
38    sys.exit(0)
39else:
40    if mode == "no-downloads":
41        print("Failed: build tried to download files")
42    sys.exit(1)
Note: See TracBrowser for help on using the repository browser.