Skip to content

Commit

Permalink
refactor: Remove unused variable and print statements
Browse files Browse the repository at this point in the history
  • Loading branch information
cauliyang committed Oct 30, 2023
1 parent ea4454d commit 6b11a8d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
- "**.py"
- "**/Dockerfile"
- ".github/workflows/*.yml"
- "!.github/workflows/release.yml"
- poetry.lock
- pyproject.toml

Expand Down
9 changes: 5 additions & 4 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@


DEBUG = False
RAISE_ERROR = False

class PxblatExtensionBuilder(_build_ext):
def build_extension(self, extension: setuptools.extension.Extension) -> None: # type: ignore
Expand Down Expand Up @@ -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:
Expand All @@ -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()

Expand All @@ -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():
Expand Down Expand Up @@ -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())

Expand Down

0 comments on commit 6b11a8d

Please sign in to comment.