Here I attached the setup.py and setup.cfg file.This is for your reference.
I have changed the exception line.
Even though I got the following error while running the python setup.py
build
running build
running build_py
running build_ext
error: No such file or directory
===
On Fri, Aug 7, 2009 at 7:38 PM, Scott David Daniels
wrote:
> Dennis Lee Bieber wrote:
>
>> On Thu, 6 Aug 2009 16:00:15 +0530, "Thangappan.M"
>> declaimed the following in
>> gmane.comp.python.general:
>>
>>> File "./setup.py", line 219, in finalize_options
>>>except (Warning, w):
>>> NameError: global name 'w' is not defined
>>>
>>> What would be the solution?
>>> Otherwise can you tell how to install DB-API in debian machine.
>>>
>>Sorry... 1) I run on WinXP; 2) I don't build packages, relying on
>> pre-built binaries; 3) I run MySQL.
>>
>>However, based upon the examples in the Tutorial, that line should
>> not have the (, ). A parenthesised (tuple) is suppose to contain a list
>> of exceptions, and the parameter to catch the exception specifics has to
>> be outside the list.
>>
>>Best I can suggest is editing that particular line and removing the
>> (, ) -- then try rebuilding.
>>
>>I'll also re-ask: All you are installing is the Python adapter to
>> the database. DO YOU HAVE A RUNNING PostgreSQL server that you can
>> connect to?
>>
>
> Just to be a bit more explict:
> Change file setup.py's line 219 from:
> >> except (Warning, w):
> to either (OK in Python 2.6 and greater):
> except Warning as w:
> or (works for Python 2.X):
> except Warning, w:
>
>
> --Scott David Daniels
> [email protected]
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
Regards,
Thangappan.M
setup.cfg
Description: Binary data
# setup.py - distutils packaging
#
# Copyright (C) 2003-2004 Federico Di Gregorio
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
"""Python-PostgreSQL Database Adapter
psycopg is a PostgreSQL database adapter for the Python programming
language. This is version 2, a complete rewrite of the original code to
provide new-style classes for connection and cursor objects and other sweet
candies. Like the original, psycopg 2 was written with the aim of being
very small and fast, and stable as a rock.
psycopg is different from the other database adapter because it was
designed for heavily multi-threaded applications that create and destroy
lots of cursors and make a conspicuous number of concurrent INSERTs or
UPDATEs. psycopg 2 also provide full asycronous operations for the really
brave programmer.
"""
classifiers = """\
Development Status :: 4 - Beta
Intended Audience :: Developers
License :: OSI Approved :: GNU General Public License (GPL)
License :: OSI Approved :: Zope Public License
Programming Language :: Python
Programming Language :: C
Programming Language :: SQL
Topic :: Database
Topic :: Database :: Front-Ends
Topic :: Software Development
Topic :: Software Development :: Libraries :: Python Modules
Operating System :: Microsoft :: Windows
Operating System :: Unix
"""
import os
import os.path
import sys
import subprocess
import ConfigParser
from distutils.core import setup, Extension
from distutils.errors import DistutilsFileError
from distutils.command.build_ext import build_ext
from distutils.sysconfig import get_python_inc
from distutils.ccompiler import get_default_compiler
PSYCOPG_VERSION = '2.0.10'
version_flags = ['dt', 'dec']
PLATFORM_IS_WINDOWS = sys.platform.lower().startswith('win')
def get_pg_config(kind, pg_config="pg_config"):
p = subprocess.Popen([pg_config, "--" + kind],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
p.stdin.close()
r = p.stdout.readline().strip()
if not r:
raise Warning(p.stderr.readline())
return r
class psycopg_build_ext(build_ext):
"""Conditionally complement the setup.cfg options file.
This class configures the include_dirs, libray_dirs, libraries
options as required by the system. Most of