Skip to content

petsc4py: Reorganize source tree

Lisandro Dalcin requested to merge dalcinl/petsc4py into main

This MR is a large reorganization/modernization of the petsc4py source tree layout. Almost everything done here is correlated to similar changes in mpi4py.

I'm aware such large renames cause pain with open MR, but better to do it now in anticipation to an upcoming petsc4py documentation sprint hosted by David Ham and to happen in UK at the end of this month.

A thing I've not decided on yet is whether we should add a pyproject.toml file. If we do, then pip will start to use the modern way of building packages, which involves creating isolated scratch Python virtual envs to perform the build. I've already enabled all this stuff in mpi4py, but in that project I'm the absolute dictator, I take full responsibility for outcomes, and I don't have to explain and argue about any of my choices. We CANNOT add pyproject.toml. The modern approach of build isolation performed in a scratch virtual environment will not allow for pip install petsc.

Editable installs are currently broken, but I'm planning to look into it tomorrow. This may influence the decision related to the pyproject.toml addition. Editable installs should work fine (with the legacy setup.py develop way).

@joseroman We should eventually replicate all this mess in slepc4py. I'm being careful to allow reuse (via plain old copy & paste) of most of the conf/build code here such that all what we have to do is changing 'PETSc' -> 'SLEPc' strings in a few places in setup.py.

@pefarrell @stefanozampini I'm adding you guys as reviewers just FYI, there aren't (there shouldn't be) any user-facing changes.

Edited by Lisandro Dalcin

Merge request reports