Re: Replace uses of deprecated Python module distutils.sysconfig

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, 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-23 23:11:41
Message-ID: 1769679.1642979501@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)anarazel(dot)de> writes:
> On 2022-01-23 16:06:21 -0500, Tom Lane wrote:
>> + 'posix_local': {
>> + 'stdlib': '{base}/lib/python{py_version_short}',
>> + 'platstdlib': '{platbase}/lib/python{py_version_short}',
>> + 'purelib': '{base}/local/lib/python{py_version_short}/dist-packages',
>> + 'platlib': '{platbase}/local/lib/python{py_version_short}/dist-packages',
>> + 'include': '{base}/local/include/python{py_version_short}',
>> + 'platinclude': '{platbase}/local/include/python{py_version_short}',
>> + 'scripts': '{base}/local/bin',
>> + 'data': '{base}/local',
>> + },
>> + 'deb_system': {
>> + 'stdlib': '{base}/lib/python{py_version_short}',
>> + 'platstdlib': '{platbase}/lib/python{py_version_short}',
>> + 'purelib': '{base}/lib/python{py_version_short}/dist-packages',
>> + 'platlib': '{platbase}/lib/python{py_version_short}/dist-packages',
>> + 'include': '{base}/include/python{py_version_short}',
>> + 'platinclude': '{platbase}/include/python{py_version_short}',
>> + 'scripts': '{base}/bin',
>> + 'data': '{base}',
>> + },
>> 'posix_home': {

> Hm. It seems the intent of the different paths you show is that we can specify
> which type of path we want. The one to locally installed extensions, or the
> distribution ones. So we'd have to specify the scheme to get the other include
> path?

It may be that one of the other "scheme" values accurately describes
Debian's actual layout of this package. I didn't check, because the
scheme is defined to be platform-specific. Specifying a particular
value for it would therefore break other platforms. Anyway, trying
to figure out whether we're on a Debian package with this mistake
doesn't seem any cleaner than what I proposed. (In particular,
blindly changing to a different scheme without a check to see
what's really in the filesystem seems doomed to failure.)

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Corey Huinker 2022-01-23 23:16:53 Re: WIP: System Versioned Temporal Table
Previous Message Andres Freund 2022-01-23 23:07:47 Re: Replace uses of deprecated Python module distutils.sysconfig