|
2 | 2 | Utility functions used in the setup.py files for the Python packages. |
3 | 3 | """ |
4 | 4 |
|
| 5 | +import atexit |
5 | 6 | import datetime |
6 | 7 | import os |
7 | 8 | import re |
8 | 9 | import shutil |
| 10 | +import subprocess |
9 | 11 | import sys |
10 | | -from pathlib import Path |
11 | 12 | import tempfile |
| 13 | +from pathlib import Path |
| 14 | + |
12 | 15 | import setuptools |
13 | | -import subprocess |
14 | | -import atexit |
15 | 16 |
|
16 | 17 | TENSORRT_VERSION = os.getenv("MLIR_TRT_DOWNLOAD_TENSORRT_VERSION", "10.12") |
17 | 18 |
|
@@ -63,10 +64,12 @@ def get_nightly_version() -> str: |
63 | 64 | datestring = datetime.date.today().strftime("%Y%m%d") |
64 | 65 | return append_version_feature_flags(f"{get_base_version()}.dev{datestring}") |
65 | 66 |
|
| 67 | + |
66 | 68 | def get_pypi_version() -> str: |
67 | 69 | # wheel upload to pypi need to follow the version specification in https://packaging.python.org/en/latest/specifications/core-metadata/ |
68 | 70 | return f"{get_base_version()}" |
69 | 71 |
|
| 72 | + |
70 | 73 | def cleanup_dir(dir: Path, should_cleanup: bool, comment: str = ""): |
71 | 74 | prefix = "Cleaning up" if should_cleanup else "Not cleaning up" |
72 | 75 | log(f"{prefix} {comment} at {dir}") |
@@ -157,7 +160,7 @@ def run_cmake_build(python_package_name: str, python_wheel_staging_dir: Path): |
157 | 160 | log(f"Building MLIR-TensorRT in {build_dir}") |
158 | 161 | log(f"Installing to {install_dir}") |
159 | 162 |
|
160 | | - # Retrieve the path to the isolated Python site where the wheel build is occuring. |
| 163 | + # Retrieve the path to the isolated Python site where the wheel build is occurring. |
161 | 164 | # That is where the Python build dependencies (the packages listed in |
162 | 165 | # 'build-requires' in the pyproject.toml) are available. The actual CMake build |
163 | 166 | # may invoke the Python interpreter (in order to e.g. generate custom MLIR files |
@@ -210,7 +213,7 @@ def run_cmake_build(python_package_name: str, python_wheel_staging_dir: Path): |
210 | 213 | subprocess.check_call(build_cmd, cwd=project_root) |
211 | 214 |
|
212 | 215 | # Install |
213 | | - install_cmd = ["cmake", "--install", str(build_dir), "--strip"] |
| 216 | + install_cmd = ["cmake", "--install", str(build_dir)] |
214 | 217 |
|
215 | 218 | log(f"Install command: {' '.join(install_cmd)}") |
216 | 219 | subprocess.check_call(install_cmd, cwd=project_root) |
|
0 commit comments