From af0e82c44fee6ac5538c275a6506b29df576e487 Mon Sep 17 00:00:00 2001 From: Christoph Schueler Date: Thu, 29 Aug 2024 17:15:11 +0300 Subject: [PATCH] update build script --- .github/workflows/pythonapp.yml | 2 +- build_ext.py | 18 ++++++++++-------- pyproject.toml | 10 +++++----- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index 3d18223..8bcada9 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -17,7 +17,7 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-latest, ubuntu-latest] # , macos-13, macos-14 + os: [windows-latest] # , ubuntu-latest, macos-13, macos-14 # cibw_archs: ["x86_64", ""] #include: # - os: ubuntu-latest diff --git a/build_ext.py b/build_ext.py index 9777937..c6b3cc1 100644 --- a/build_ext.py +++ b/build_ext.py @@ -10,12 +10,13 @@ from pathlib import Path from tempfile import TemporaryDirectory + print("PY_EXE", sys.executable) -print("PY_INCLUDE", sysconfig.get_path('include')) -print("PY_LIBDIR", sysconfig.get_config_var('LIBDIR')) -print("PY_LDLIBRARY", sysconfig.get_config_var('LDLIBRARY')) - - +print("PY_INCLUDE", sysconfig.get_path("include")) +print("PY_LIBDIR", sysconfig.get_config_var("LIBDIR")) +print("PY_LDLIBRARY", sysconfig.get_config_var("LDLIBRARY")) + + TOP_DIR = Path(__file__).parent print("Platform", platform.system()) @@ -23,6 +24,7 @@ if uname.system == "Darwin": os.environ["MACOSX_DEPLOYMENT_TARGET"] = "10.13" + def banner(msg: str) -> None: print("=" * 80) print(str.center(msg, 80)) @@ -35,16 +37,16 @@ def build_extension(debug: bool = False, use_temp_dir: bool = False) -> None: debug = bool(os.environ.get("DEBUG", 0)) or debug cfg = "Debug" if debug else "Release" print(f" BUILD-TYPE: {cfg!r}") - + cmake_args = [ f"-DPython3_EXECUTABLE={sys.executable}", f"-DCMAKE_BUILD_TYPE={cfg}", # not used on MSVC, but no harm ] - + # if uname.system == 'Linux' and 'CIBUILDWHEEL' in os.environ: # cmake_args += [f"-DPython3_INCLUDE_DIR={sysconfig.get_path('include')}"] # cmake_args += [f"-DPython3_LIBRARY={str(Path(sysconfig.get_config_var('LIBDIR')) / Path(sysconfig.get_config_var('LDLIBRARY')))}"] - + build_args = ["--config Release", "--verbose"] # cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 /path/to/src diff --git a/pyproject.toml b/pyproject.toml index a95e00e..16b4240 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] -requires = ["poetry-core>=1.0.0", "setuptools>=68.0.0", "pybind11>=2.12.0", "pybind11[global]>=2.12.0"] +requires = ["poetry-core>=1.0.0", "pybind11>=2.12.0", "pybind11[global]>=2.12.0"] # "setuptools>=68.0.0", build-backend = "poetry.core.masonry.api" @@ -64,13 +64,13 @@ include = [ { path = "pyxcp/recorder/*.pyd", format = "wheel" }, { path = "pyxcp/*.exe", format = "wheel" }, { path = "CMakeLists.txt", format = "sdist" }, - + { path = "pyxcp/cpp_ext/*hpp", format = "sdist" }, - { path = "pyxcp/cpp_ext/*cpp", format = "sdist" }, + { path = "pyxcp/cpp_ext/*cpp", format = "sdist" }, { path = "pyxcp/daq_stim/*hpp", format = "sdist" }, - { path = "pyxcp/daq_stim/*cpp", format = "sdist" }, + { path = "pyxcp/daq_stim/*cpp", format = "sdist" }, { path = "pyxcp/recorder/*hpp", format = "sdist" }, - { path = "pyxcp/recorder/*cpp", format = "sdist" }, + { path = "pyxcp/recorder/*cpp", format = "sdist" }, ] [tool.poetry.dependencies]