diff --git a/.github/workflows/compile-binaries.yaml b/.github/workflows/compile-binaries.yaml index 67c826d3..681b8e19 100644 --- a/.github/workflows/compile-binaries.yaml +++ b/.github/workflows/compile-binaries.yaml @@ -23,7 +23,7 @@ on: jobs: compile_binaries: - name: Build wheels on ${{ matrix.os }} + name: Compile binaries on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: diff --git a/build/linux/release/Makefile b/build/linux/release/Makefile index eb23376b..6bbd6def 100644 --- a/build/linux/release/Makefile +++ b/build/linux/release/Makefile @@ -1,4 +1,4 @@ -BASE=/usr/local +BASE=/usr BOOST_VERSION= BOOST_INCLUDE = $(BASE)/include C_PLATFORM=-static -pthread diff --git a/build/mac/release/Makefile b/build/mac/release/Makefile index 6433c332..c55df31e 100644 --- a/build/mac/release/Makefile +++ b/build/mac/release/Makefile @@ -1,4 +1,4 @@ -BASE=/usr/local +BASE=$(shell brew --prefix) BOOST_VERSION= BOOST_INCLUDE = $(BASE)/include C_PLATFORM=-pthread diff --git a/build/python/setup.py b/build/python/setup.py index 6d1c6a7d..d9437009 100644 --- a/build/python/setup.py +++ b/build/python/setup.py @@ -19,6 +19,17 @@ from distutils.util import convert_path from distutils.sysconfig import customize_compiler from distutils.ccompiler import show_compilers +from packaging.version import Version, InvalidVersion + +def is_pep440_compliant(version_str): + try: + # Attempt to parse the version string using packaging's Version class + Version(version_str) + return True + except InvalidVersion: + # If parsing fails, the version is not PEP 440 compliant + print(f"{version_str} is not PEP 440 compliant") + return False # Path to the directory that contains this setup.py file. @@ -59,7 +70,8 @@ def find_version(): version = f.read().strip() print('Version found: %s (from version.py)' % version) - return version + if is_pep440_compliant(version): + return version try: git_output = subprocess.check_output(['git', 'describe', '--abbrev=7', '--dirty=@mod', '--always', '--tags']) @@ -70,7 +82,8 @@ def find_version(): version = git_output.replace('-', '.dev', 1).replace('@', '-', 1).replace('-', '+', 1).replace('-','') print('Version found %s (from git describe)' % version) - return version + if is_pep440_compliant(version): + return version except: pass @@ -131,6 +144,14 @@ def locate_boost(): return include_dirs, '/usr/lib64' elif glob.glob('/usr/lib/libboost*'): return include_dirs, '/usr/lib' + + # Added to support Mac with Apple Silicon + # on which homebrew's prefix is /opt/homebrew + include_dirs = '/opt/homebrew/include' + + if os.path.isdir(include_dirs + os.path.sep + 'boost'): + if glob.glob('/opt/homebrew/lib/libboost*'): + return include_dirs, '/opt/homebrew/lib/' return None, None diff --git a/src/lib/vina.h b/src/lib/vina.h index a44cf9b3..0379601b 100644 --- a/src/lib/vina.h +++ b/src/lib/vina.h @@ -33,9 +33,7 @@ #include #include #include -#include -#include -#include // filesystem::basename +#include #include // hardware_concurrency // FIXME rm ? #include //#include diff --git a/src/split/split.cpp b/src/split/split.cpp index b42e78aa..b6234dbf 100644 --- a/src/split/split.cpp +++ b/src/split/split.cpp @@ -28,9 +28,7 @@ #include // getline? #include // for ceila #include -#include -#include -#include // filesystem::basename +#include #include "file.h" #include "parse_error.h"