Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move location of pybind11 import in setup.py #2564

Merged
merged 7 commits into from
Mar 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
schedule:
# '*' is a special character in YAML, so string must be quoted
- cron: "0 4 * * WED"
workflow_dispatch: ~
workflow_dispatch:

jobs:
mac-os-build:
Expand All @@ -29,7 +29,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: "3.10"

- name: Create virtualenv
run: |
Expand All @@ -45,9 +45,7 @@ jobs:
- name: Install minimal PETSc
run: |
source fenicsx/bin/activate
curl -L -O http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.18.3.tar.gz
mkdir petsc
tar -xf petsc-lite-3.18.3.tar.gz -C petsc --strip-components=1
git clone -b release https://gitlab.com/petsc/petsc.git petsc
cd petsc
python ./configure \
--with-64-bit-indices=no \
Expand All @@ -56,14 +54,13 @@ jobs:
--with-scalar-type=real \
--with-shared-libraries \
--with-scalar-type=real \
--with-make-np=3 \
--download-bison \
--download-metis \
--download-ptscotch
make all
cd src/binding/petsc4py
PETSC_DIR=$GITHUB_WORKSPACE/petsc PETSC_ARCH=arch-darwin-c-opt pip3 install --no-cache-dir .

- name: Install Basix
run: |
source fenicsx/bin/activate
Expand All @@ -79,10 +76,8 @@ jobs:
source fenicsx/bin/activate
python -m pip install git+https://github.com/FEniCS/ffcx.git

- uses: actions/checkout@v3
with:
path: dolfinx
ref: main
- name: Checkout DOLFINx
uses: actions/checkout@v3

- name: Build and install DOLFINx C++ library
run: |
Expand Down
3 changes: 2 additions & 1 deletion python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import sys
import sysconfig

import pybind11
from setuptools import Extension, setup
from setuptools.command.build_ext import build_ext

Expand Down Expand Up @@ -51,6 +50,8 @@ def build_extension(self, ext):
cmake_args += ['-DCMAKE_BUILD_TYPE=' + cfg]

env = os.environ.copy()

import pybind11
env['pybind11_DIR'] = pybind11.get_cmake_dir()

if not os.path.exists(self.build_temp):
Expand Down