Re: Replace uses of deprecated Python module distutils.sysconfig

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Replace uses of deprecated Python module distutils.sysconfig
Date: 2022-01-24 20:48:21
Message-ID: e64fe321-8199-751f-5517-446cc30520d3@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 24.01.22 03:53, Andres Freund wrote:
> On 2022-01-23 21:31:52 -0500, Tom Lane wrote:
>> Andres Freund<andres(at)anarazel(dot)de> writes:
>>> No, not really. There generally seems to be very little documentation about
>>> what one is supposed to use when embedding python (rather than building a
>>> python module). The only thing I really see is:
>>> https://docs.python.org/3/extending/embedding.html#compiling-and-linking-under-unix-like-systems
>>> which says to use python-config.
>> Yeah :-(. I don't really want to go there, because it will break
>> existing setups.
> Yea, it seems to introduce a whole set of new complexities (finding python
> from python-config, mismatching python-config and explicitly specified python,
> ...). And it doesn't exist on windows either :(.

Also note that python-config is itself a Python script that uses
sysconfig and includes code like this:

elif opt in ('--includes', '--cflags'):
flags = ['-I' + sysconfig.get_path('include'),
'-I' + sysconfig.get_path('platinclude')]

So this would just do the same thing we are already doing anyway.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2022-01-24 20:54:52 Re: Replace uses of deprecated Python module distutils.sysconfig
Previous Message Tom Lane 2022-01-24 20:43:25 Re: TAP tests, directories and parameters