From db24a67c60818d6c2427ba82145ff8513ea4ef16 Mon Sep 17 00:00:00 2001 From: Yuhuang Hu Date: Wed, 6 Dec 2023 17:38:33 +0800 Subject: [PATCH] Fixing the master (#25) * homebrew changed places for library, update * let's stop building 3.6 and 3.7 because they are end of life * github action uses legacy dir for homebrew, fix * change swig ops * removing python versions --- .github/workflows/main.yml | 2 +- setup.py | 20 +++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0df1c73..3fdabdc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest] - python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"] + python-version: ["3.8", "3.9", "3.10"] steps: - uses: actions/checkout@v2 diff --git a/setup.py b/setup.py index 2c7c46d..c7ccea6 100644 --- a/setup.py +++ b/setup.py @@ -20,8 +20,6 @@ Intended Audience :: Science/Research Natural Language :: English Operating System :: OS Independent -Programming Language :: Python :: 3.6 -Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 @@ -55,18 +53,26 @@ if os.uname()[1] == "raspberrypi": libcaer_lib = "/usr/lib/arm-linux-gnueabihf" elif platform == "darwin": - libcaer_include = "/usr/local/include" - libcaer_lib = "/usr/local/lib" + libcaer_include = "/opt/homebrew/include" + libcaer_lib = "/opt/homebrew/lib" elif "win" in platform: libcaer_include = "C:/msys64/mingw64/include" libcaer_lib = "C:/msys64/mingw64/lib" +include_dirs = [libcaer_include, python_paths["include"], numpy_include] +library_dirs = [libcaer_lib, python_paths["stdlib"]] +swig_opts = ["-I" + libcaer_include] +if platform == "darwin": + include_dirs += ["/usr/local/include"] + library_dirs += ["/usr/local/lib"] + swig_opts += ["-I/usr/local/include"] + libcaer_wrap = Extension( name="pyaer._libcaer_wrap", sources=["./pyaer/pyflags.i"], - include_dirs=[libcaer_include, python_paths["include"], numpy_include], - library_dirs=[libcaer_lib, python_paths["stdlib"]], - swig_opts=["-I" + libcaer_include], + include_dirs=include_dirs, + library_dirs=library_dirs, + swig_opts=swig_opts, # extra_compile_args=["-std=c11"], extra_link_args=["-lcaer"], )