Small build/packaging fixes. 1.2.2c1.

This commit is contained in:
adustman
2007-02-25 04:06:01 +00:00
parent 48b09d439e
commit c748fa7d9c
6 changed files with 30 additions and 36 deletions

View File

@ -1,4 +1,3 @@
prune CVS
recursive-include doc *.txt recursive-include doc *.txt
include MANIFEST.in include MANIFEST.in
include MANIFEST include MANIFEST
@ -12,6 +11,7 @@ include test_capabilities.py
include test_MySQLdb_capabilities.py include test_MySQLdb_capabilities.py
include metadata.cfg include metadata.cfg
include site.cfg include site.cfg
include ez_setup.py
include setup_common.py include setup_common.py
include setup_posix.py include setup_posix.py
include setup_windows.py include setup_windows.py

View File

@ -1,26 +1,26 @@
[metadata] [metadata]
version: 1.2.2b3 version: 1.2.2c1
version_info: (1,2,2,'beta',3) version_info: (1,2,2,'gamma',1)
description: Python interface to MySQL description: Python interface to MySQL
long_description: long_description:
========================= =========================
Python interface to MySQL Python interface to MySQL
========================= =========================
\n
MySQLdb is an interface to the popular MySQL_ database server for MySQLdb is an interface to the popular MySQL_ database server for
Python. The design goals are: Python. The design goals are:
\n
- Compliance with Python database API version 2.0 [PEP-0249]_ - Compliance with Python database API version 2.0 [PEP-0249]_
\n
- Thread-safety - Thread-safety
\n
- Thread-friendliness (threads will not block each other) - Thread-friendliness (threads will not block each other)
\n
MySQL-3.23 through 5.0 and Python-2.3 through 2.5 are currently MySQL-3.23 through 5.0 and Python-2.3 through 2.5 are currently
supported. supported.
\n
MySQLdb is `Free Software`_. MySQLdb is `Free Software`_.
\n
.. _MySQL: http://www.mysql.com/ .. _MySQL: http://www.mysql.com/
.. _`Free Software`: http://www.gnu.org/ .. _`Free Software`: http://www.gnu.org/
.. [PEP-0249] http://www.python.org/peps/pep-0249.html .. [PEP-0249] http://www.python.org/peps/pep-0249.html

View File

@ -15,4 +15,5 @@ else: # assume windows
metadata, options = get_config() metadata, options = get_config()
metadata['ext_modules'] = [Extension(sources=['_mysql.c'], **options)] metadata['ext_modules'] = [Extension(sources=['_mysql.c'], **options)]
metadata['long_description'] = metadata['long_description'].replace(r'\n', '')
setup(**metadata) setup(**metadata)

View File

@ -14,15 +14,16 @@ def compiler_flag(f):
def mysql_config(what): def mysql_config(what):
from os import popen from os import popen
f = popen("mysql_config --%s" % what) f = popen("%s --%s" % (mysql_config.path, what))
data = f.read().strip().split() data = f.read().strip().split()
ret = f.close() ret = f.close()
if ret: if ret:
if ret/256: if ret/256:
data = [] data = []
if ret/256 > 1: if ret/256 > 1:
raise EnvironmentError, "mysql_config is not on your PATH" raise EnvironmentError, "%s not found" % mysql_config.path
return data return data
mysql_config.path = "mysql_config"
def get_config(): def get_config():
import os, sys import os, sys
@ -30,6 +31,9 @@ def get_config():
metadata, options = get_metadata_and_options() metadata, options = get_metadata_and_options()
if 'mysql_config' in options:
mysql_config.path = options['mysql_config']
extra_objects = [] extra_objects = []
static = enabled(options, 'static') static = enabled(options, 'static')
if enabled(options, 'embedded'): if enabled(options, 'embedded'):

View File

@ -2,13 +2,14 @@ def get_config():
import os, sys, _winreg import os, sys, _winreg
from setup_common import get_metadata_and_options, enabled, create_release_file from setup_common import get_metadata_and_options, enabled, create_release_file
serverKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE,
r'SOFTWARE\MySQL AB\MySQL Server 5.0')
mysql_root, dummy = _winreg.QueryValueEx(serverKey,'Location')
metadata, options = get_metadata_and_options() metadata, options = get_metadata_and_options()
serverKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, options['registry_key'])
mysql_root, dummy = _winreg.QueryValueEx(serverKey,'Location')
extra_objects = [] extra_objects = []
static = enabled(options, 'static') static = enabled(options, 'static')
# XXX static doesn't actually do anything on Windows
if enabled(options, 'embedded'): if enabled(options, 'embedded'):
client = "mysqld" client = "mysqld"
else: else:

View File

@ -1,30 +1,18 @@
# Options: [options]
#
# embedded: link against the embedded server library # embedded: link against the embedded server library
# threadsafe: use the threadsafe client # threadsafe: use the threadsafe client
# static: link against a static library (probably required for embedded) # static: link against a static library (probably required for embedded)
[options]
embedded = False embedded = False
threadsafe = True threadsafe = True
static = False static = False
# Use the compiler section to add additional options for the extension build. # The path to mysql_config.
# In particular, if your platform does not support mysql_config (like # Only use this if mysql_config is not on your PATH, or you have some weird
# Windows), you will have to set most of these. Note that each entry is split # setup that requires it.
# into a list so that each line is one item. #mysql_config = /usr/local/bin/mysql_config
[compiler] # The Windows registry key for MySQL.
# This section is now obsolete. Most of these items should just be set in # This has to be set for Windows buildsto work.
# setup.cfg, and the ONLY if the default configuration doesn't work. # Only change this if you have a different version.
#mysql_root: /usr/local/mysql registry_key = SOFTWARE\MySQL AB\MySQL Server 5.0
#library_dirs: %(mysql_root)s/lib
#include_dirs: %(mysql_root)s/include
#libraries: mysqlclient
# zlib
# msvcrt
# libcmt
# wsock32
# advapi32
#extra_compile_args:
#extra_objects: