Changeset 711 for trunk/setup.py


Ignore:
Timestamp:
Jan 11, 2016, 3:45:05 AM (4 years ago)
Author:
cito
Message:

Flatten the directory structure of the project

Simplified the directory structure by flattening the "module" subdirectory out
to the root directory. That way, the setup.py script can now also access the
top-level docs subdirectory, so it could also install or build the docs.
There was nothing else in the root directory anyway, except the mkdocs and
mktar scripts which could be made unnecessary through setup.py.

Also made the setup script a bit clearer. Removed the note about MinGW for
Windows since the Microsoft compiler for Python 2.7 and Visual Studio Community
are now freely available including 64bit compilers, and produce less problems.

Note that the usual structure would have been to use a "pygresql" package
directory instead of the "module" directory. But since we install PyGreSQL
as two top-level modules "pg" and "pgdb" instead of a package "pygresql",
the flattened structure reflects that much better. For historical reasons
and people don't want to rewrite import statements, we will keep it that way.

Location:
trunk
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
         1*.egg-info
        12.idea
         3.tox
         4.vagrant
        25BETA
         6build
         7dist
  • trunk/setup.py

    r710 r711  
    1111* PyGreSQL written 1997 by D'Arcy J.M. Cain <darcy@druid.net>
    1212* based on code written 1995 by Pascal Andre <andre@chimay.via.ecp.fr>
    13 * setup script created 2000/04 Mark Alexander <mwa@gate.net>
    14 * tweaked 2000/05 Jeremy Hylton <jeremy@cnri.reston.va.us>
    15 * win32 support 2001/01 by Gerhard Haering <gerhard@bigfoot.de>
    16 * tweaked 2006/02-2010/02 by Christoph Zwerschke <cito@online.de>
     13* setup script created 2000 by Mark Alexander <mwa@gate.net>
     14* improved 2000 by Jeremy Hylton <jeremy@cnri.reston.va.us>
     15* improved 2001 by Gerhard Haering <gerhard@bigfoot.de>
     16* improved 2006 and 2016 by Christoph Zwerschke <cito@online.de>
    1717
    1818Prerequisites to be installed:
     
    2727python setup.py build   # to build the module
    2828python setup.py install # to install it
    29 
    30 You can use MinGW or MinGW-w64 for building on Windows:
    31 python setup.py build -c mingw32 install
    3229
    3330See docs.python.org/doc/install/ for more information on
     
    6057
    6158
     59# For historical reasons, PyGreSQL does not install itself as a single
     60# "pygresql" package, but as two top-level modules "pg", providing the
     61# classic interface, and "pgdb" for the modern DB-API 2.0 interface.
     62# These two top-level Python modules share the same C extension "_pg".
     63
     64py_modules = ['pg', 'pgdb']
     65c_sources = ['pgmodule.c']
     66
     67
    6268def pg_config(s):
    6369    """Retrieve information about installed version of PostgreSQL."""
     
    8288
    8389pg_version = pg_version()
    84 py_modules = ['pg', 'pgdb']
    8590libraries = ['pq']
    8691# Make sure that the Python header files are searched before
     
    178183    license="Python",
    179184    py_modules=py_modules,
    180     ext_modules=[Extension('_pg', ['pgmodule.c'],
     185    ext_modules=[Extension('_pg', c_sources,
    181186        include_dirs=include_dirs, library_dirs=library_dirs,
    182187        define_macros=define_macros, undef_macros=undef_macros,
Note: See TracChangeset for help on using the changeset viewer.