-
-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[nanobind] merge pyproject change from main (#2840)
* Improve comment (#2839) * Use `pyproject.toml` for install of Python part (#2707) * Try using pyproject * fixup pip command * Find python * debug * Try by adding path explicitly * Try no build isolation on mac. * Try this on macos. * Update CI * Typo * Fix. * Should be dependency of scikit-build-core. * Attempt fix for ubuntu. * Fix? * Add pyproject variant * Typo. * Explicit python intepreter. * Try forcing x86-64 arch. * Try this ordering. * Upgrade pip etc. * And on mac. * This works locally on my macOS system. pip install --no-build-isolation is required. * Works locally, not totally happy with the RPATH stuff. * Tidy. * Fix circleci * Tidy. * Update minimum pybind11. * Don't think these belong here. * Change email. * Tweaks to Dockerfiles and workflows. * Update macos workflow * Typo * Fix. * Get cmake to set rpath automatically. * Don't understand why but doesn't run on circleci, try this. * Typo * Tweak. * Update macos.yml * Try removing. * Exclude .cpp files as suggested. * Add --check-build-dependencies * Not necessary, think this is well known now. * Fix typo no install. * Update build-requirements.txt * Update pyproject.toml --------- Co-authored-by: Jack S. Hale <mail@jackhale.co.uk> Co-authored-by: Garth N. Wells <gnw20@cam.ac.uk> * Update config * Small updates --------- Co-authored-by: Chris Richardson <chris@bpi.cam.ac.uk> Co-authored-by: Jack S. Hale <mail@jackhale.co.uk>
- Loading branch information
1 parent
48e352f
commit 98596e1
Showing
18 changed files
with
122 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[flake8] | ||
max-line-length = 120 | ||
ignore = W503 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,21 @@ | ||
DOLFINx Python interface | ||
======================== | ||
|
||
Building the DOLFINx Python interface uses nanobind. | ||
This document explains how to install the DOLFINx Python interface. Note that | ||
this interface must be built without PEP517 build isolation by passing | ||
`--no-build-isolation` flag to `pip install`. This is because the Python | ||
interface explicitly depends on the system built petsc4py and mpi4py. | ||
|
||
1. Install nanobind from source, e.g.:: | ||
1. Build and install the DOLFINx C++ library in the usual way. | ||
|
||
python3 -m pip install git+https://github.com/wjakob/nanobind.git | ||
2. Ensure the build time requirements are installed:: | ||
|
||
The FEniCS Docker images are configured with nanobind. | ||
|
||
2. Build and install the DOLFINx C++ library in the usual way. | ||
pip install -v -r build-requirements.txt | ||
|
||
3. Build DOLFINx Python interface:: | ||
|
||
pip3 -v install . --user | ||
|
||
To install in a local build directory:: | ||
|
||
python3 setup.py build | ||
pip -v install --check-build-dependencies --no-build-isolation . | ||
|
||
and set the ``PYTHONPATH``. To build in debug mode:: | ||
To build in debug and editable mode for development:: | ||
|
||
python3 setup.py build --debug | ||
pip -v install --check-build-dependencies --config-settings=build-dir="build" --config-settings=cmake.build-type="Debug" --no-build-isolation -e . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
nanobind>=1.7.0 | ||
scikit-build-core[pyproject] | ||
petsc4py | ||
mpi4py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# The DOLFINx Python interface must be built without build isolation (PEP517) | ||
# due to its runtime and build time dependency on system built petsc4py and | ||
# mpi4py. | ||
# pip install -r build-requirements.txt | ||
[build-system] | ||
requires = ["scikit-build-core[pyproject]", "nanobind>=1.6.0", "petsc4py", "mpi4py"] | ||
build-backend = "scikit_build_core.build" | ||
|
||
[project] | ||
name = "fenics-dolfinx" | ||
version = "0.8.0.dev0" | ||
description = "DOLFINx Python interface" | ||
readme = "../README.md" | ||
requires-python = ">=3.8.0" | ||
license = {file = "../COPYING"} | ||
authors = [{email="fenics-steering-council@googlegroups.com"}, {name="FEniCS Steering Council"}] | ||
packages = ["dolfinx"] | ||
dependencies = ["numpy>=1.21", "cffi", "petsc4py", "mpi4py", | ||
"fenics-ffcx>=0.8.0.dev0,<0.9.0", | ||
"fenics-ufl>=2023.3.0.dev0,<2023.4.0"] | ||
|
||
[project.optional-dependencies] | ||
docs = ["markdown", "pylit3", "pyyaml", "sphinx==5.0.2", "sphinx_rtd_theme"] | ||
lint = ["flake8", "pydocstyle"] | ||
optional = ["numba"] | ||
test = ["pytest", "sympy", "scipy", "matplotlib", "fenics-dolfinx[optional]"] | ||
ci = ["mypy", "pytest-xdist", "types-setuptools", "fenics-dolfinx[build]", | ||
"fenics-dolfinx[docs]", "fenics-dolfinx[lint]", "fenics-dolfinx[optional]", | ||
"fenics-dolfinx[test]"] | ||
|
||
[tool.scikit-build] | ||
wheel.packages = ["dolfinx"] | ||
sdist.exclude = ["*.cpp"] | ||
|
||
[tool.pytest] | ||
junit_family = "xunit2" | ||
|
||
[tool.mypy] | ||
# Suggested at https://blog.wolt.com/engineering/2021/09/30/professional-grade-mypy-configuration/ | ||
# Goal would be to make all of the below True long-term | ||
disallow_untyped_defs = false | ||
disallow_any_unimported = false | ||
no_implicit_optional = false | ||
check_untyped_defs = false | ||
warn_return_any = false | ||
warn_unused_ignores = false | ||
show_error_codes = true | ||
ignore_missing_imports = true |
Oops, something went wrong.