Re: Time to drop plpython2?

Andres Freund <andres@anarazel.de>

From: Andres Freund <andres@anarazel.de>
To: Mark Wong <markwkm@postgresql.org>
Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>, Tom Lane <tgl@sss.pgh.pa.us>, pgsql-hackers@postgresql.org, pgbf@twiska.com, heikki.linnakangas@iki.fi
Date: 2022-02-19T16:22:29Z
Lists: pgsql-hackers
Hi,

On 2022-02-19 02:00:28 +0000, Mark Wong wrote:
> On Fri, Feb 18, 2022 at 02:41:04PM -0800, Andres Freund wrote:
> > There's snapper ("pgbf [ a t ] twiska.com"), and there's Mark Wong's large
> > menagerie. Mark said yesterday that he's working on updating.
> 
> I've made one pass.  Hopefully I didn't make any mistakes. :)

Unfortunately it looks like it wasn't quite enough. All, or nearly all, your
animals that ran since still seem to be failing in the same spot...

https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=gadwall&dt=2022-02-19%2011%3A22%3A48

checking Python.h usability... no
checking Python.h presence... no
checking for Python.h... no
configure: error: header file <Python.h> is required for Python


For that machine (and the other debian based ones) the relevant package likely
is python3-dev.

For the Red Hat and Suse ones, it's likely python3-devel.


I've wondered before if it's worth maintaining a list of packages for
dependencies for at least the more popular distros. It's annoying to have to
figure it out everytime one needs to test something.


FWIW, here's the recipe I just used to verify the packages necessary for
Python.h to be found:

$ podman run --rm -it opensuse/leap
# zypper install -y python3
# ls -l $(python3 -c "import sysconfig; print(sysconfig.get_config_var('INCLUDEPY'))")/Python.h
<file not found>
# zypper install -y python3-devel
# ls -l $(python3 -c "import sysconfig; print(sysconfig.get_config_var('INCLUDEPY'))")/Python.h
-rw-r--r-- 1 root root 3221 Jan  4 14:04 /usr/include/python3.6m/Python.h

(Wow, zypper repos are expensive to refresh. And I thought dnf was slow doing
so, compared to apt.)

Greetings,

Andres Freund



Commits

  1. plpython: add missing plpython.h include to plpy_plpymodule.h

  2. plpython: Adjust docs after removal of Python 2 support.

  3. plpython: Code cleanup related to removal of Python 2 support.

  4. plpython: Remove regression test infrastructure for Python 2.

  5. plpython: Remove plpythonu, plpython2u and associated transform extensions.

  6. plpython: Reject Python 2 during build configuration.

  7. Add traceback information to PL/Python errors