From 6b11a8d8602934a255a30264b293d371459393c1 Mon Sep 17 00:00:00 2001 From: Yangyang Li Date: Mon, 30 Oct 2023 15:25:45 -0500 Subject: [PATCH] refactor: Remove unused variable and print statements --- .github/workflows/release.yml | 3 ++- .github/workflows/tests.yml | 1 + build.py | 9 +++++---- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ae42a013..04cb79b8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -163,7 +163,8 @@ jobs: strategy: matrix: os: [macos-latest] - cibw_build: ["cp38-*", "cp39-*", "cp310-*", "cp311-*"] + # cibw_build: ["cp38-*", "cp39-*", "cp310-*", "cp311-*"] + cibw_build: ["cp310-*"] cibw_archs: ["arm64"] steps: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e0d24292..449a3d5a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,6 +8,7 @@ on: - "**.py" - "**/Dockerfile" - ".github/workflows/*.yml" + - "!.github/workflows/release.yml" - poetry.lock - pyproject.toml diff --git a/build.py b/build.py index 68d30f4c..0f608837 100644 --- a/build.py +++ b/build.py @@ -20,7 +20,6 @@ DEBUG = False -RAISE_ERROR = False class PxblatExtensionBuilder(_build_ext): def build_extension(self, extension: setuptools.extension.Extension) -> None: # type: ignore @@ -143,7 +142,7 @@ def find_lib_in_conda(lib_name: str): return None -def find_available_library(lib_name: str): +def find_available_library(lib_name: str, *, ignores=[]): lib_path = find_library(lib_name) if lib_path is None: @@ -152,7 +151,7 @@ def find_available_library(lib_name: str): print(f"{lib_name} lib_path: {lib_path}") if not lib_path: - if RAISE_ERROR: + if lib_name not in ignores: raise RuntimeError(f"Cannot find {lib_name} library.") return Path.cwd(), Path.cwd() @@ -167,6 +166,8 @@ def find_openssl_libs(): lib_paths = [f"{openssl_dir}/lib"] + print(f"find openssl lib_paths: {lib_paths}") + return lib_paths def _extra_compile_args_for_libpxblat(): @@ -215,7 +216,7 @@ def _extra_compile_args_for_pxblat(): ] for lib in external_libraries: - lib_library_dir, lib_include_dir = find_available_library(lib) + lib_library_dir, lib_include_dir = find_available_library(lib, ignores=["m"]) library_dirs.append(lib_library_dir.as_posix()) include_dirs.append(lib_include_dir.as_posix())