• Home
  • Raw
  • Download

Lines Matching +full:python +full:- +full:format

1 #!./python
2 """Run Python tests against multiple installations of OpenSSL and LibreSSL
10 (5) forces a recompilation of Python modules using the
12 (6) runs Python's test suite
14 The script must be run with Python's build directory as current working
21 Please keep this script compatible with Python 2.7, and 3.4 to 3.7.
23 (c) 2013-2017 Christian Heimes <christian@python.org>
75 '--debug',
80 '--disable-ancient',
85 '--openssl',
91 ).format(OPENSSL_RECENT_VERSIONS, OPENSSL_OLD_VERSIONS)
94 '--libressl',
100 ).format(LIBRESSL_RECENT_VERSIONS, LIBRESSL_OLD_VERSIONS)
103 '--tests',
106 help="Python tests to run, defaults to all SSL related tests.",
109 '--base-directory',
114 '--no-network',
120 '--steps',
125 "or LibreSSL. 'module' also compiles Python modules. 'tests' builds "
130 '--system',
135 '--force',
141 '--keep-sources',
173 self.src_dir, self.src_template.format(version))
176 self.src_dir, self.build_template.format(version))
180 return "<{0.__class__.__name__} for {0.version}>".format(self)
214 '-c', 'import ssl; print(ssl.OPENSSL_VERSION)'
235 log.debug("Call '{}'".format(" ".join(cmd)))
239 log.debug("Call '{}'".format(" ".join(cmd)))
244 return out.strip().decode("utf-8")
253 url = url_template.format(v=self.version, s=self.short_version)
254 log.info("Downloading from {}".format(url))
261 "Download from {} has from failed: {}".format(url, e)
264 log.info("Successfully downloaded from {}".format(url))
268 log.info("Storing {}".format(self.src_file))
280 name = self.build_template.format(self.version)
290 log.info("Unpacking files to {}".format(self.build_dir))
295 log.info("Running build in {}".format(self.build_dir))
299 "shared", "--debug",
300 "--prefix={}".format(self.install_dir)
302 # cmd.extend(["no-deprecated", "--api=1.1.0"])
311 ["make", "-j1", self.depend_target], cwd=cwd, env=env
313 self._subprocess_call(["make", f"-j{self.jobs}"], cwd=cwd, env=env)
317 ["make", "-j1", self.install_target],
333 log.debug("Already has src {}".format(self.src_file))
338 log.info("Already has installation {}".format(self.install_dir))
345 log.warning("Using build from {}".format(self.build_dir))
357 env["CPPFLAGS"] = "-I{}".format(self.include_dir)
358 env["LDFLAGS"] = "-L{}".format(self.lib_dir)
362 log.info("Rebuilding Python modules")
368 cmd = [sys.executable, "-c", "import _ssl; import _hashlib"]
381 '-j0'
384 cmd = [sys.executable, '-m', 'test.regrtest']
386 cmd = [sys.executable, '-m', 'test', '-j0']
388 cmd.extend(['-u', 'network', '-u', 'urlfetch'])
389 cmd.extend(['-w', '-r'])
397 "https://www.openssl.org/source/openssl-{v}.tar.gz",
398 "https://www.openssl.org/source/old/{s}/openssl-{v}.tar.gz"
400 src_template = "openssl-{}.tar.gz"
401 build_template = "openssl-{}"
412 config_args += ("enable-fips",)
419 ["make", "-j1", "install_ssldirs", "install_fips"],
423 # 3.0.0-beta2 uses lib64 on 64 bit platforms
435 # OpenSSL 3.0.0 -> /old/3.0/
442 "https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-{v}.tar.gz",
444 src_template = "libressl-{}.tar.gz"
445 build_template = "libressl-{}"
452 './configure', '--config-cache', '--quiet',
453 '--with-pydebug'
457 subprocess.check_call(['make', '--quiet'])
471 format="*** %(levelname)s %(message)s"
482 if not os.path.samefile('python', sys.executable):
484 "Must be executed with ./python from CPython build dir"
520 print("{} failed: {}".format(build, e), file=sys.stderr)
523 log.info("\n{} finished in {}".format(
525 datetime.now() - start
527 print('Python: ', sys.version)
536 print(" * {0.library} {0.version}".format(build))