diff --git a/.github/workflows/build-topics-test-gha-branch.yml b/.github/workflows/build-topics-test-gha-branch.yml index 100a5e0d..0995229e 100644 --- a/.github/workflows/build-topics-test-gha-branch.yml +++ b/.github/workflows/build-topics-test-gha-branch.yml @@ -37,7 +37,7 @@ jobs: with: python-version: ${{ matrix.python_version }} - name: Install Python packages - run: pip${{ matrix.python_version }} install auditwheel build Chrones pybind11 twine + run: pip${{ matrix.python_version }} install auditwheel build Chrones pybind11 twine wheel - name: Install CUDA run: | sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub @@ -87,7 +87,7 @@ jobs: rm *.tar.gz - name: Build the wheel - run: python${{ matrix.python_version }} -m build --wheel --outdir local-dist lincs-* + run: python${{ matrix.python_version }} -m build --no-isolation --wheel --outdir local-dist lincs-* env: LINCS_DEV_FORCE_NVCC: "true" LINCS_DEV_FORCE_CHRONES: "true" @@ -115,7 +115,7 @@ jobs: with: python-version: ${{ matrix.python_version }} - name: Install Python packages - run: pip install build delvewheel pybind11 twine + run: pip install build delvewheel pybind11 twine wheel - name: Install CUDA uses: Jimver/cuda-toolkit@v0.2.14 id: cuda-toolkit @@ -173,7 +173,7 @@ jobs: rm *.tar.gz - name: Build the wheel - run: python -m build --wheel --outdir local-dist (get-item lincs-*) + run: python -m build --no-isolation --wheel --outdir local-dist (get-item lincs-*) env: LINCS_DEV_FORCE_NVCC: "true" LINCS_DEV_DEPENDENCIES: d:\lincs-deps @@ -204,7 +204,7 @@ jobs: with: python-version: ${{ matrix.python_version }} - name: Install Python packages - run: pip3 install build delocate pybind11 twine + run: pip3 install build delocate pybind11 twine wheel - name: Install OpenMP run: | cd /Users/runner/work @@ -246,7 +246,7 @@ jobs: rm *.tar.gz - name: Build the wheel - run: python3 -m build --wheel --outdir local-dist lincs-* + run: python3 -m build --no-isolation --wheel --outdir local-dist lincs-* - name: Make the wheel machine-independent run: delocate-wheel --wheel-dir dist local-dist/*.whl - name: Check the wheel diff --git a/setup.py b/setup.py index 3f2da521..920e8b3c 100644 --- a/setup.py +++ b/setup.py @@ -225,14 +225,11 @@ def make_liblincs_extension(): print("WARNING: 'chrones' was not found, lincs will be compiled without Chrones", file=sys.stderr) try: - include_dirs += [ - option[2:] - for option in subprocess.run( - [sys.executable, "-m", "pybind11", "--includes"], capture_output=True, universal_newlines=True, check=True, - ).stdout.strip().split(" ") - ] - except subprocess.CalledProcessError: - print("WARNING: 'pybind11' was not found, compilation will fail", file=sys.stderr) + import pybind11 + except ImportError: + print("WARNING: 'pybind11' was not found, compilation will fail. (Source distribution is OK)", file=sys.stderr) + else: + include_dirs += [pybind11.get_include()] if sys.platform == "linux": extra_compile_args["c++"] = ["-std=c++17", "-Werror=switch", "-fopenmp"]