[PyGreSQL] PyGreSQL 3.0 with Distutils

Mark W. Alexander mwa at gate.net
Mon Apr 24 15:23:17 EDT 2000


Some mention was made regarding using Disutils for packing up
PyGreSQL 3.0. I took a quick look and was surprised to find 
that it works pretty will without much effort.

First, get Distutils from:

  http://www.python.org/sigs/distutils-sig/download.html

It installs using itself: python setup.py install

Next: Cut this:
-------------------------------------------------------
#!/usr/bin/env python

include_dirs=['/usr/include/pgsql']
library_dirs=['usr/lib/pgsql']
optional_libs=['pq']

# Setup script for the PyGreSQL version 3

# created 2000/04 Mark Alexander

__revision__ = "$Id: setup.py,v 1.13 2000/04/21 02:31:55 gward Exp $"

from distutils.core import setup

setup (name = "PyGreSQL",
    version = "3.0",
    description = "Python PostgreSQL DB-API",
    author = "D'Arcy J. M. Cain",
    author_email = "darcy at druid.net",
    url = "http://www.druid.net/pygresql/",
    licence = "Python",

    ext_modules = [ ('_pgmodule', {
        'sources': ['pgmodule.c'],
        'include_dirs': include_dirs,
        'library_dirs': library_dirs,
        'libraries': optional_libs
        }
    )]
)

#--------------------------------
Into setup.py in the PyGreSQL directory.

You may have to change the first 3 variables (include_dirs,
library_dirs, optional_libs) to match your postgres distribution.

Now, you can:

	python setup.py build	# to build the module

	python setup.py install	# to install it

And probably alot more that I haven't figured out yet. The
docs are really sparse, but there's a fair write-up on 
Installing Python Modules at:

  http://www.python.org/sigs/distutils-sig/doc/

This discusses using alternate installation locations which
is perfect for migrating from pg.py to pgdb.py

This has acheived full conformance to the "It Works For Me"
specification. Comments and suggestions are welcome.

Mark Alexander
mwa at gate.net







More information about the PyGreSQL mailing list