File: create_executable.py

package info (click to toggle)
pytest 9.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,308 kB
  • sloc: python: 65,808; makefile: 45
file content (16 lines) | stat: -rw-r--r-- 463 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
"""Generate an executable with pytest runner embedded using PyInstaller."""

from __future__ import annotations


if __name__ == "__main__":
    import subprocess

    import pytest

    hidden = []
    for x in pytest.freeze_includes():
        hidden.extend(["--hidden-import", x])
    hidden.extend(["--hidden-import", "distutils"])
    args = ["pyinstaller", "--noconfirm", *hidden, "runtests_script.py"]
    subprocess.check_call(" ".join(args), shell=True)