Files
cibuildwheel/bin/sample_build.py
T

32 lines
805 B
Python
Raw Normal View History

#!/usr/bin/env python3
2021-04-25 03:45:27 -04:00
from __future__ import annotations
2021-01-06 13:50:58 -05:00
import argparse
import os
import subprocess
import sys
import tempfile
from pathlib import Path
2021-05-03 11:45:43 -04:00
if __name__ == "__main__":
# move cwd to the project root
os.chdir(Path(__file__).resolve().parents[1])
2021-05-03 11:45:43 -04:00
parser = argparse.ArgumentParser(description="Runs a sample build")
parser.add_argument("project_python_path", nargs="?", default="test.test_0_basic.basic_project")
options = parser.parse_args()
project_dir = tempfile.mkdtemp()
2021-04-30 17:56:34 -04:00
subprocess.run(
2021-05-03 11:45:43 -04:00
[sys.executable, "-m", "test.test_projects", options.project_python_path, project_dir],
2021-04-30 17:56:34 -04:00
check=True,
)
sys.exit(
subprocess.run(
[sys.executable, "-m", "cibuildwheel"], cwd=project_dir, check=False
).returncode
)