2020-07-18 17:35:13 +08:00
|
|
|
"""Generate an executable with pytest runner embedded using PyInstaller."""
|
2024-01-31 03:34:23 +08:00
|
|
|
|
2018-05-23 22:48:46 +08:00
|
|
|
if __name__ == "__main__":
|
2016-07-27 08:29:07 +08:00
|
|
|
import subprocess
|
|
|
|
|
2024-01-31 03:34:23 +08:00
|
|
|
import pytest
|
|
|
|
|
2016-07-27 08:29:07 +08:00
|
|
|
hidden = []
|
|
|
|
for x in pytest.freeze_includes():
|
2018-05-23 22:48:46 +08:00
|
|
|
hidden.extend(["--hidden-import", x])
|
2019-02-14 04:59:36 +08:00
|
|
|
hidden.extend(["--hidden-import", "distutils"])
|
2024-02-02 22:12:50 +08:00
|
|
|
args = ["pyinstaller", "--noconfirm", *hidden, "runtests_script.py"]
|
2018-05-23 22:48:46 +08:00
|
|
|
subprocess.check_call(" ".join(args), shell=True)
|