Re: [NOVICE] Python verison for build in config.pl (Win32)

Поиск
Список
Период
Сортировка
От James William Pye
Тема Re: [NOVICE] Python verison for build in config.pl (Win32)
Дата
Msg-id 3A488490-7496-42E6-8BAE-FB4B42637B1A@jwp.name
обсуждение исходный текст
Ответ на Re: [NOVICE] Python verison for build in config.pl (Win32)  (Magnus Hagander <magnus@hagander.net>)
Ответы Re: [NOVICE] Python verison for build in config.pl (Win32)  (Magnus Hagander <magnus@hagander.net>)
Список pgsql-hackers
On Jan 20, 2010, at 12:27 PM, Magnus Hagander wrote:
> Well, it needs the version to match it to the DLL name. For python
> 2.6, it needs python26.dll. But yes, there should probably be some way
> to ask python itself about that - that would be the non-naive method.
> But as long as python is installed per default, we got it for free,
> which is why it has "worked so far".


[on tom's question]
IIRC, the reason you can't query Python in the same way that configure/python.m4 does is because the generated Makefile
thatsupports distutils.sysconfig does not exist in standard win32 builds. That is, AFAIK, there is no way to request
theexact path of the dll/lib file in win32. However, I'm not particularly familiar with Python on win32, so that may
notbe the case. 


Given the absence of a more precise method, I'd recommend considering something along the lines of:

Allow the user specify (config.pl?) the Python executable to build against and default to the python.exe in %PATH%.
(thismay already be the case, idk) 

Query Python for the version information and installation prefix.
python -c 'import sys; print(str(sys.version_info[0]) + str(sys.version_info[1]))'python -c 'import sys;
print(sys.prefix)'

Assume that the prefix has a normal layout, and construct the lib path from the extracted version and prefix.

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Mark Kirkwood
Дата:
Сообщение: Re: Streaming Replication and archiving
Следующее
От: Greg Smith
Дата:
Сообщение: Re: MonetDB test says that PostgreSQL often has errors or missing results