Well someone tried importing epydoc for python3 and it did not generate an error, did they try generating the petsc4py docs with it. That would tell you if it works?

   Yes, we do want to be able to build all the PETSc docs together in a portable way.

On Mar 15, 2021, at 10:56 AM, Patrick Sanan <patrick.sanan@gmail.com> wrote:



Am 15.03.2021 um 16:26 schrieb Satish Balay <balay@mcs.anl.gov>:

On Mon, 15 Mar 2021, Lisandro Dalcin wrote:

On Mon, 15 Mar 2021 at 07:06, Satish Balay <balay@mcs.anl.gov> wrote:

Lisandro,

For the upcoming release its best to update lib/petsc/bin/maint/builddist
to also build petsc4py tarball in sync with petsc tarball.

What is the current process to generate petsc4py tarball?



BTW: I stumbled into a couple of issues with building petsc4py docs

1. the docs build process requires petsc library to be built?






python setup.py build_src
running build_src
cythonizing 'petsc4py.PETSc.pyx' -> 'petsc4py.PETSc.c'
cythonizing 'libpetsc4py/libpetsc4py.pyx' -> 'libpetsc4py/libpetsc4py.c'
mkdir -p docs/apiref
env CFLAGS=-O0 python2 setup.py -q build --build-lib build/lib.py2
/usr/bin/ld: cannot find -lpetsc
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
make[2]: *** [makefile:110: epydoc-html] Error 1
gmake[1]: [makefile:422: sphinx-docs-all] Error 2 (ignored)
<<<

2. Any particular reason it needs python2? I see it requires
docutils,epydoc - but I see python3 is able to install them.


It requires petsc4py to be installed in Python 2, such that epydoc can
build the API reference.

But epydoc can be installed with python3. So this is more of petsc4py code that uses epydoc - than epydoc code?

I have not found a nice replacement for epydoc-generated documentation.
If Python 2 is an annoyance, then just remove, comment-out anything related
to epydoc in "makefile"

Well I can work around it. [by installing both python2 and python3 versions of epydoc via pip]

However its not clear to me where the python2 requirement is coming
from - and if things can be unified using python3

A related issue: I think Patrick is working on migrating some of the
petsc4py docs to sphynx. And curently sphynx is installed in python3
virt-env [so now we need it for both python3 for petsc side, and
python2 for petsc4py side]

I haven't dug into the petsc4py docs yet, but I was very much hoping that we could at least make all the docs build at once and be deployed to the same URL, even if for now they are building with an assortment of tools. (We could include the petsc4py docs, for now, as we're doing with the HTML man pages and sources from c2html, specifying them as "extra html" with Sphinx) . As Satish says, it'd be nice to do this with the same Python environment we use to build the Sphinx docs - I would naively hope/assume that since epydoc exists for python3 and petsc4py works with python3, it would be possible.


and run "make sdist".

Ah - ok. Will check this to see if I can generate the tarball in sync
with petsc tarball. What source files need updating for
release/version info?

But this way the tarball will miss the API reference.

PS: All this could be converted to a script that installs petsc4py and
epydoc in a Python 2 virtual environment, and next users another venv for
the Python 3 Sphinx stuff.

One issue: Fedora-33 does not have 'python2-pip' anymore. I was able
to manually install it.  However this might become an issue for others
who want to build docs [even if we automate the docs build to
install/use pyton2-venv]

Satish