From f82f6677d7352644d198e256b636bf621a1a9c39 Mon Sep 17 00:00:00 2001 From: schnellerhase <56360279+schnellerhase@users.noreply.github.com> Date: Fri, 20 Mar 2026 15:39:01 +0100 Subject: [PATCH 01/19] Add reproducible mypy make recipe --- .github/workflows/ccpp.yml | 10 ++-------- python/Makefile | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 python/Makefile diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index c009dfd4f08..21fe82f6f9b 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -132,15 +132,9 @@ jobs: pip install --check-build-dependencies --no-build-isolation --config-settings=cmake.build-type="Developer" 'python/[test]' python -c "from mpi4py import MPI; import dolfinx; assert not dolfinx.has_petsc; assert not dolfinx.has_petsc4py; assert dolfinx.has_superlu_dist" - - name: Run mypy # Use a venv to avoid NumPy upgrades that are incompatible with numba + - name: Run mypy working-directory: python - run: | - python -m venv mypy-env - . ./mypy-env/bin/activate - pip install mypy types-cffi scipy-stubs - mypy -p dolfinx - # mypy test - # mypy demo + run: make lint-mypy - name: Install gmsh and pyvista (and dependencies) run: | diff --git a/python/Makefile b/python/Makefile new file mode 100644 index 00000000000..4f59ecff411 --- /dev/null +++ b/python/Makefile @@ -0,0 +1,14 @@ +# Note: mypy is currenlty on CI tested without petsc4py! +lint-mypy: + python -m venv dolfinx-venv-mypy + . dolfinx-venv-mypy/bin/activate && pip install mypy types-cffi scipy-stubs + . dolfinx-venv-mypy/bin/activate && mypy -p dolfinx +# . dolfinx-venv-mypy/bin/activate && mypy test +# . dolfinx-venv-mypy/bin/activate && mypy demo + +lint-mypy-clean: + rm -rf dolfinx-venv-mypy + +lint: lint-mypy + +clean: lint-mypy-clean From 452f4ae05d43a74122da83870d06341c8f5c891f Mon Sep 17 00:00:00 2001 From: schnellerhase <56360279+schnellerhase@users.noreply.github.com> Date: Fri, 20 Mar 2026 15:46:31 +0100 Subject: [PATCH 02/19] Mypy check test/ --- python/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/Makefile b/python/Makefile index 4f59ecff411..a8a0c8213ff 100644 --- a/python/Makefile +++ b/python/Makefile @@ -3,7 +3,7 @@ lint-mypy: python -m venv dolfinx-venv-mypy . dolfinx-venv-mypy/bin/activate && pip install mypy types-cffi scipy-stubs . dolfinx-venv-mypy/bin/activate && mypy -p dolfinx -# . dolfinx-venv-mypy/bin/activate && mypy test + . dolfinx-venv-mypy/bin/activate && mypy test # . dolfinx-venv-mypy/bin/activate && mypy demo lint-mypy-clean: From 4cb783a790f19a2aa17729d7b531a900ac585564 Mon Sep 17 00:00:00 2001 From: schnellerhase <56360279+schnellerhase@users.noreply.github.com> Date: Fri, 20 Mar 2026 16:10:27 +0100 Subject: [PATCH 03/19] Fix: dbc value type --- python/dolfinx/fem/bcs.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/python/dolfinx/fem/bcs.py b/python/dolfinx/fem/bcs.py index 10dce42ba39..d4abcaa8a78 100644 --- a/python/dolfinx/fem/bcs.py +++ b/python/dolfinx/fem/bcs.py @@ -12,7 +12,6 @@ from __future__ import annotations -import numbers from collections.abc import Callable, Iterable import numpy as np @@ -172,7 +171,7 @@ def dof_indices(self) -> tuple[npt.NDArray[np.int32], int]: def dirichletbc( - value: Function | Constant | np.ndarray, + value: Function | Constant | np.ndarray | float | complex, dofs: npt.NDArray[np.int32], V: dolfinx.fem.FunctionSpace | None = None, ) -> DirichletBC: @@ -193,7 +192,7 @@ def dirichletbc( A representation of the boundary condition for modifying linear systems. """ - if isinstance(value, numbers.Number): + if isinstance(value, float | complex): value = np.asarray(value) try: From a75f18d34bee6f37da15f1c10e4ee6bd44d7d15b Mon Sep 17 00:00:00 2001 From: schnellerhase <56360279+schnellerhase@users.noreply.github.com> Date: Fri, 20 Mar 2026 15:51:55 +0100 Subject: [PATCH 04/19] Mypy check (and fix) demo/ --- python/Makefile | 2 +- python/demo/demo_pml.py | 4 ++-- python/demo/demo_pyamg.py | 10 +++++----- python/demo/demo_scattering_boundary_conditions.py | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/python/Makefile b/python/Makefile index a8a0c8213ff..88332551f5d 100644 --- a/python/Makefile +++ b/python/Makefile @@ -4,7 +4,7 @@ lint-mypy: . dolfinx-venv-mypy/bin/activate && pip install mypy types-cffi scipy-stubs . dolfinx-venv-mypy/bin/activate && mypy -p dolfinx . dolfinx-venv-mypy/bin/activate && mypy test -# . dolfinx-venv-mypy/bin/activate && mypy demo + . dolfinx-venv-mypy/bin/activate && mypy demo lint-mypy-clean: rm -rf dolfinx-venv-mypy diff --git a/python/demo/demo_pml.py b/python/demo/demo_pml.py index 27d4fb94643..c5634bf72d9 100644 --- a/python/demo/demo_pml.py +++ b/python/demo/demo_pml.py @@ -214,8 +214,8 @@ def generate_mesh_wire( def compute_a(nu: int, m: complex, alpha: float) -> float: """Compute the Mie coefficient a_nu for a cylinder.""" - J_nu_alpha = jv(nu, alpha) - J_nu_malpha = jv(nu, m * alpha) + J_nu_alpha = jv(nu, alpha) # type: ignore + J_nu_malpha = jv(nu, m * alpha) # type: ignore J_nu_alpha_p = jvp(nu, alpha, 1) J_nu_malpha_p = jvp(nu, m * alpha, 1) diff --git a/python/demo/demo_pyamg.py b/python/demo/demo_pyamg.py index bf6e4e68c85..6027e028ce7 100644 --- a/python/demo/demo_pyamg.py +++ b/python/demo/demo_pyamg.py @@ -63,7 +63,7 @@ def poisson_problem(dtype: npt.DTypeLike, solver_type: str) -> None: solver_type: pyamg solver type, either "ruge_stuben" or "smoothed_aggregation" """ - real_type = np.real(dtype(0)).dtype + real_type = np.real(dtype(0)).dtype # type: ignore mesh = create_box( comm=MPI.COMM_WORLD, points=[(0.0, 0.0, 0.0), (3.0, 2.0, 1.0)], @@ -84,7 +84,7 @@ def poisson_problem(dtype: npt.DTypeLike, solver_type: str) -> None: dofs = locate_dofs_topological(V=V, entity_dim=fdim, entities=facets) - bc = dirichletbc(value=dtype(0), dofs=dofs, V=V) + bc = dirichletbc(value=0.0, dofs=dofs, V=V) u, v = ufl.TrialFunction(V), ufl.TestFunction(V) x = ufl.SpatialCoordinate(mesh) @@ -110,14 +110,14 @@ def poisson_problem(dtype: npt.DTypeLike, solver_type: str) -> None: print(ml) # Solve linear systems - print(f"\nSolve Poisson equation: {dtype.__name__}") + print(f"\nSolve Poisson equation: {dtype!s}") res: list[float] = [] tol = 1e-10 if real_type == np.float64 else 1e-6 uh.x.array[:] = ml.solve(b.array, tol=tol, residuals=res, accel="cg") for i, q in enumerate(res): print(f"Convergence history: iteration {i}, residual= {q}") - with io.XDMFFile(mesh.comm, f"out_pyamg/poisson_{dtype.__name__}.xdmf", "w") as file: + with io.XDMFFile(mesh.comm, f"out_pyamg/poisson_{dtype!s}.xdmf", "w") as file: file.write_mesh(mesh) file.write_function(uh) @@ -126,7 +126,7 @@ def poisson_problem(dtype: npt.DTypeLike, solver_type: str) -> None: # + -def nullspace_elasticty(Q: fem.FunctionSpace) -> list[np.ndarray]: +def nullspace_elasticty(Q: fem.FunctionSpace) -> npt.NDArray: """Create the elasticity (near)nulspace. Args: diff --git a/python/demo/demo_scattering_boundary_conditions.py b/python/demo/demo_scattering_boundary_conditions.py index f3bd735f6dc..3c40b835742 100644 --- a/python/demo/demo_scattering_boundary_conditions.py +++ b/python/demo/demo_scattering_boundary_conditions.py @@ -220,8 +220,8 @@ def generate_mesh_wire( # + def compute_a(nu: int, m: complex, alpha: float) -> float: """Compute the a_nu coefficient.""" - J_nu_alpha = jv(nu, alpha) - J_nu_malpha = jv(nu, m * alpha) + J_nu_alpha = jv(nu, alpha) # type: ignore + J_nu_malpha = jv(nu, m * alpha) # type: ignore J_nu_alpha_p = jvp(nu, alpha, 1) J_nu_malpha_p = jvp(nu, m * alpha, 1) From ce1b91135aa93b5115dc653cfbd65250b072adbb Mon Sep 17 00:00:00 2001 From: schnellerhase <56360279+schnellerhase@users.noreply.github.com> Date: Mon, 23 Mar 2026 13:26:28 +0100 Subject: [PATCH 05/19] Fix --- python/demo/demo_pyamg.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/demo/demo_pyamg.py b/python/demo/demo_pyamg.py index 6027e028ce7..0da47e25ed4 100644 --- a/python/demo/demo_pyamg.py +++ b/python/demo/demo_pyamg.py @@ -63,7 +63,7 @@ def poisson_problem(dtype: npt.DTypeLike, solver_type: str) -> None: solver_type: pyamg solver type, either "ruge_stuben" or "smoothed_aggregation" """ - real_type = np.real(dtype(0)).dtype # type: ignore + real_type = np.real(np.zeros(0, dtype=dtype)).dtype mesh = create_box( comm=MPI.COMM_WORLD, points=[(0.0, 0.0, 0.0), (3.0, 2.0, 1.0)], @@ -84,7 +84,7 @@ def poisson_problem(dtype: npt.DTypeLike, solver_type: str) -> None: dofs = locate_dofs_topological(V=V, entity_dim=fdim, entities=facets) - bc = dirichletbc(value=0.0, dofs=dofs, V=V) + bc = dirichletbc(value=dtype(0.0), dofs=dofs, V=V) # type: ignore u, v = ufl.TrialFunction(V), ufl.TestFunction(V) x = ufl.SpatialCoordinate(mesh) From 7cf770bd5a39bebcbbbd9057fac171f4de5eb0a7 Mon Sep 17 00:00:00 2001 From: schnellerhase <56360279+schnellerhase@users.noreply.github.com> Date: Thu, 2 Apr 2026 12:39:34 +0200 Subject: [PATCH 06/19] Allow for 2/3 Python suffix --- python/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/Makefile b/python/Makefile index 88332551f5d..b4ec8cb73e0 100644 --- a/python/Makefile +++ b/python/Makefile @@ -1,6 +1,9 @@ # Note: mypy is currenlty on CI tested without petsc4py! + +PYTHON = python$(py) + lint-mypy: - python -m venv dolfinx-venv-mypy + $(PYTHON) -m venv dolfinx-venv-mypy . dolfinx-venv-mypy/bin/activate && pip install mypy types-cffi scipy-stubs . dolfinx-venv-mypy/bin/activate && mypy -p dolfinx . dolfinx-venv-mypy/bin/activate && mypy test From 9229018eef46400a557665dcef8128bb6ae00ef9 Mon Sep 17 00:00:00 2001 From: "Jack S. Hale" Date: Tue, 26 May 2026 13:21:07 +0200 Subject: [PATCH 07/19] Remove Makefile --- python/Makefile | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 python/Makefile diff --git a/python/Makefile b/python/Makefile deleted file mode 100644 index b4ec8cb73e0..00000000000 --- a/python/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -# Note: mypy is currenlty on CI tested without petsc4py! - -PYTHON = python$(py) - -lint-mypy: - $(PYTHON) -m venv dolfinx-venv-mypy - . dolfinx-venv-mypy/bin/activate && pip install mypy types-cffi scipy-stubs - . dolfinx-venv-mypy/bin/activate && mypy -p dolfinx - . dolfinx-venv-mypy/bin/activate && mypy test - . dolfinx-venv-mypy/bin/activate && mypy demo - -lint-mypy-clean: - rm -rf dolfinx-venv-mypy - -lint: lint-mypy - -clean: lint-mypy-clean From 368f892a8212abc32ad233b51f178871c60555b8 Mon Sep 17 00:00:00 2001 From: "Jack S. Hale" Date: Tue, 26 May 2026 13:26:09 +0200 Subject: [PATCH 08/19] Add mypy optional dependency set --- python/README.md | 11 +++++++++++ python/pyproject.toml | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/python/README.md b/python/README.md index fd2bcd88749..f0bb63720b8 100644 --- a/python/README.md +++ b/python/README.md @@ -18,3 +18,14 @@ To build in Developer and editable mode for development: pip -v install --check-build-dependencies --config-settings=build-dir="build" --config-settings=cmake.build-type="Developer" --config-settings=install.strip=false --no-build-isolation -e . Note that our Developer mode is significantly stricter than CMake's default Debug mode. + +# Type checking with mypy + +1. Install DOLFINx Python with the `[mypy]` optional dependencies set. + +2. Check with mypy, e.g.: + + `mypy -p dolfinx` + + Note that this should be executed in a location where `dolfinx/` is not an + importable module. diff --git a/python/pyproject.toml b/python/pyproject.toml index c48aab819b5..d39087ee704 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -50,6 +50,7 @@ docs = [ "fenics-dolfinx[demo]", ] lint = ["ruff>=0.2.0"] +mypy = ["mypy", "types-cffi", "types-setuptools", "scipy-stubs"] optional = ["numba"] petsc4py = ["petsc4py"] test = [ @@ -61,12 +62,11 @@ test = [ "fenics-dolfinx[optional]", ] ci = [ - "mypy", "pytest-xdist", - "types-setuptools", "fenics-dolfinx[build]", "fenics-dolfinx[docs]", "fenics-dolfinx[lint]", + "fenics-dolfinx[mypy]", "fenics-dolfinx[optional]", "fenics-dolfinx[test]", ] From 337de7a26cd20e3e9f17b6fb1cd65f4bd754177c Mon Sep 17 00:00:00 2001 From: "Jack S. Hale" Date: Tue, 26 May 2026 13:29:30 +0200 Subject: [PATCH 09/19] Remove Makefile use from test --- .github/workflows/ccpp.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 21fe82f6f9b..ee983e219fe 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -129,12 +129,15 @@ jobs: - name: Build Python interface run: | - pip install --check-build-dependencies --no-build-isolation --config-settings=cmake.build-type="Developer" 'python/[test]' + pip install --check-build-dependencies --no-build-isolation --config-settings=cmake.build-type="Developer" 'python/[test,mypy]' python -c "from mpi4py import MPI; import dolfinx; assert not dolfinx.has_petsc; assert not dolfinx.has_petsc4py; assert dolfinx.has_superlu_dist" - name: Run mypy - working-directory: python - run: make lint-mypy + run: | + mypy -p dolfinx # package mode, must be done without dolfinx/__init__.py visible + cd python/ + mypy test + mypy demo - name: Install gmsh and pyvista (and dependencies) run: | From ff42e489f79a8938da87f52a786e2b04b83860e7 Mon Sep 17 00:00:00 2001 From: "Jack S. Hale" Date: Tue, 26 May 2026 13:31:16 +0200 Subject: [PATCH 10/19] Fix --- python/README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/python/README.md b/python/README.md index f0bb63720b8..2c3e70e2711 100644 --- a/python/README.md +++ b/python/README.md @@ -21,11 +21,13 @@ Note that our Developer mode is significantly stricter than CMake's default Debu # Type checking with mypy -1. Install DOLFINx Python with the `[mypy]` optional dependencies set. +1. Install DOLFINx Python with the `[mypy]` optional dependencies set, e.g.: + + pip install .[mypy] 2. Check with mypy, e.g.: `mypy -p dolfinx` - Note that this should be executed in a location where `dolfinx/` is not an - importable module. + Note that this should be executed at a path where `dolfinx/` is not an + importable package. From cb9c0dd34ae80dd9021b6a3d249a54f39b0a8c3e Mon Sep 17 00:00:00 2001 From: "Jack S. Hale" Date: Tue, 26 May 2026 15:39:59 +0200 Subject: [PATCH 11/19] Retrigger CI From 33c5f7e155dbd1bfdea962977cc91153f76304b4 Mon Sep 17 00:00:00 2001 From: "Jack S. Hale" Date: Tue, 26 May 2026 21:39:18 +0200 Subject: [PATCH 12/19] Use mypy config from pyproject.toml --- .github/workflows/ccpp.yml | 2 +- python/pyproject.toml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index ee983e219fe..73fafe71660 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -134,7 +134,7 @@ jobs: - name: Run mypy run: | - mypy -p dolfinx # package mode, must be done without dolfinx/__init__.py visible + mypy --config-file python/pyproject.toml -p dolfinx # package mode, must be done without dolfinx/__init__.py visible cd python/ mypy test mypy demo diff --git a/python/pyproject.toml b/python/pyproject.toml index c20fd9bb6a3..3d051fa13cf 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -98,7 +98,6 @@ warn_unused_ignores = false show_error_codes = true ignore_missing_imports = true - [tool.ruff] line-length = 100 indent-width = 4 From 8d63606e0143fd3eebcf6c0df357f3d3bf73ea27 Mon Sep 17 00:00:00 2001 From: "Jack S. Hale" Date: Tue, 26 May 2026 22:02:18 +0200 Subject: [PATCH 13/19] Forget demos, do in follow up PR. --- .github/workflows/ccpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 73fafe71660..77165287fe5 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -137,7 +137,7 @@ jobs: mypy --config-file python/pyproject.toml -p dolfinx # package mode, must be done without dolfinx/__init__.py visible cd python/ mypy test - mypy demo + #mypy demo # TODO: Enable this in future - name: Install gmsh and pyvista (and dependencies) run: | From 66789dfbea708a105198b4073f90aa835d7caa37 Mon Sep 17 00:00:00 2001 From: "Jack S. Hale" Date: Tue, 26 May 2026 22:16:15 +0200 Subject: [PATCH 14/19] Adjust README --- python/README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/python/README.md b/python/README.md index 2c3e70e2711..74d2452c0bb 100644 --- a/python/README.md +++ b/python/README.md @@ -6,18 +6,18 @@ Below is guidance for building the DOLFINx Python interface. 2. Ensure the Python interface build requirements are installed: - pip install scikit-build-core - python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install + pip install scikit-build-core + python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install 3. Build DOLFINx Python interface: - pip install --check-build-dependencies --no-build-isolation . + pip install --check-build-dependencies --no-build-isolation . To build in Developer and editable mode for development: pip -v install --check-build-dependencies --config-settings=build-dir="build" --config-settings=cmake.build-type="Developer" --config-settings=install.strip=false --no-build-isolation -e . -Note that our Developer mode is significantly stricter than CMake's default Debug mode. +Note that Developer mode is significantly stricter than CMake's default Debug mode. # Type checking with mypy @@ -27,7 +27,7 @@ Note that our Developer mode is significantly stricter than CMake's default Debu 2. Check with mypy, e.g.: - `mypy -p dolfinx` + mypy --config-file pyproject.toml -p dolfinx - Note that this should be executed at a path where `dolfinx/` is not an - importable package. + The `--config-file pyproject.toml` is mandatory to run mypy with the correct options. + options. From df7801eaf8e503753363433c551d80afa90afb93 Mon Sep 17 00:00:00 2001 From: "Jack S. Hale" Date: Tue, 26 May 2026 22:18:18 +0200 Subject: [PATCH 15/19] Improve comment --- .github/workflows/ccpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 77165287fe5..799cd464cec 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -134,7 +134,7 @@ jobs: - name: Run mypy run: | - mypy --config-file python/pyproject.toml -p dolfinx # package mode, must be done without dolfinx/__init__.py visible + mypy --config-file python/pyproject.toml -p dolfinx # package mode, type checks installed dolfinx cd python/ mypy test #mypy demo # TODO: Enable this in future From bf0559603c1fbd61f1e0cb20095e54332a5a6a9a Mon Sep 17 00:00:00 2001 From: "Jack S. Hale" Date: Tue, 26 May 2026 22:44:55 +0200 Subject: [PATCH 16/19] Update README.md --- python/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/python/README.md b/python/README.md index 74d2452c0bb..4f6699c6221 100644 --- a/python/README.md +++ b/python/README.md @@ -6,12 +6,12 @@ Below is guidance for building the DOLFINx Python interface. 2. Ensure the Python interface build requirements are installed: - pip install scikit-build-core - python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install + pip install scikit-build-core + python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install 3. Build DOLFINx Python interface: - pip install --check-build-dependencies --no-build-isolation . + pip install --check-build-dependencies --no-build-isolation . To build in Developer and editable mode for development: @@ -23,11 +23,11 @@ Note that Developer mode is significantly stricter than CMake's default Debug mo 1. Install DOLFINx Python with the `[mypy]` optional dependencies set, e.g.: - pip install .[mypy] + pip install .[mypy] 2. Check with mypy, e.g.: - mypy --config-file pyproject.toml -p dolfinx + mypy --config-file pyproject.toml -p dolfinx The `--config-file pyproject.toml` is mandatory to run mypy with the correct options. options. From 6705575e5d6a7cca9ec3d24afca0181772c3d969 Mon Sep 17 00:00:00 2001 From: "Jack S. Hale" Date: Tue, 26 May 2026 22:45:44 +0200 Subject: [PATCH 17/19] Update README.md --- python/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/python/README.md b/python/README.md index 4f6699c6221..956dff6349e 100644 --- a/python/README.md +++ b/python/README.md @@ -30,4 +30,3 @@ Note that Developer mode is significantly stricter than CMake's default Debug mo mypy --config-file pyproject.toml -p dolfinx The `--config-file pyproject.toml` is mandatory to run mypy with the correct options. - options. From 4717c1b771949b5702c9cb7f54f10fa65768e7ba Mon Sep 17 00:00:00 2001 From: "Jack S. Hale" Date: Wed, 27 May 2026 08:14:52 +0200 Subject: [PATCH 18/19] Update README.md --- python/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/README.md b/python/README.md index 956dff6349e..1d4830453c2 100644 --- a/python/README.md +++ b/python/README.md @@ -30,3 +30,5 @@ Note that Developer mode is significantly stricter than CMake's default Debug mo mypy --config-file pyproject.toml -p dolfinx The `--config-file pyproject.toml` is mandatory to run mypy with the correct options. + The `-p` flag checks the built/installed package `dolfinx`, containing the C++ + bindings and Python interface. From c23916d34d7a2cdba4aeb35067c66a040043d688 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20T=2E=20K=C3=BChner?= <56360279+schnellerhase@users.noreply.github.com> Date: Wed, 27 May 2026 09:39:55 +0200 Subject: [PATCH 19/19] Apply suggestion from @schnellerhase --- .github/workflows/ccpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 799cd464cec..80e0782c470 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -134,7 +134,7 @@ jobs: - name: Run mypy run: | - mypy --config-file python/pyproject.toml -p dolfinx # package mode, type checks installed dolfinx + mypy --config-file python/pyproject.toml -p dolfinx # package mode, type checks installed dolfinx (working around name collision in python/ directory) cd python/ mypy test #mypy demo # TODO: Enable this in future