Skip to content

Commit

Permalink
Update build.py to remove unused functions and update python to 3.8 (#…
Browse files Browse the repository at this point in the history
…19164)

### Description
<!-- Describe your changes. -->



### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
  • Loading branch information
jchen351 authored Jan 16, 2024
1 parent 80f274c commit 8e272b9
Showing 1 changed file with 1 addition and 31 deletions.
32 changes: 1 addition & 31 deletions tools/ci_build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def __init__(self, message):


def _check_python_version():
required_minor_version = 7
required_minor_version = 8
if (sys.version_info.major, sys.version_info.minor) < (3, required_minor_version):
raise UsageError(
f"Invalid Python version. At least Python 3.{required_minor_version} is required. "
Expand Down Expand Up @@ -786,11 +786,6 @@ def get_linux_distro():
return "", ""


def is_ubuntu_1604():
dist, ver = get_linux_distro()
return dist == "Ubuntu" and ver.startswith("16.04")


def get_config_build_dir(build_dir, config):
# build directory per configuration
return os.path.join(build_dir, config)
Expand Down Expand Up @@ -844,15 +839,6 @@ def update_submodules(source_dir):
run_subprocess(["git", "submodule", "update", "--init", "--recursive"], cwd=source_dir)


def is_docker():
path = "/proc/self/cgroup"
return (
os.path.exists("/.dockerenv")
or os.path.isfile(path)
and any("docker" in line for line in open(path)) # noqa: SIM115
)


def install_python_deps(numpy_version=""):
dep_packages = ["setuptools", "wheel", "pytest"]
dep_packages.append(f"numpy=={numpy_version}" if numpy_version else "numpy>=1.16.6")
Expand Down Expand Up @@ -2401,16 +2387,6 @@ def run_csharp_tests(source_dir, build_dir, use_cuda, use_openvino, use_tensorrt
run_subprocess(cmd_args, cwd=csharp_source_dir)


def is_cross_compiling_on_apple(args):
if not is_macOS():
return False
if args.ios:
return True
if args.osx_arch != platform.machine():
return True
return False


def generate_documentation(source_dir, build_dir, configs, validate):
# Randomly choose one build config
config = next(iter(configs))
Expand Down Expand Up @@ -2725,12 +2701,6 @@ def main():
log.info("Activating emsdk...")
run_subprocess([emsdk_file, "activate", emsdk_version], cwd=emsdk_dir)

if is_ubuntu_1604():
if args.arm or args.arm64:
raise BuildError("Only Windows ARM(64) cross-compiled builds supported currently through this script")
if not is_docker() and not args.use_acl and not args.use_armnn:
install_python_deps()

if args.enable_pybind and is_windows():
install_python_deps(args.numpy_version)

Expand Down

0 comments on commit 8e272b9

Please sign in to comment.