From c748fa7d9cc18e8cb4a106b31a3f7ba5e6af1e09 Mon Sep 17 00:00:00 2001 From: adustman Date: Sun, 25 Feb 2007 04:06:01 +0000 Subject: [PATCH] Small build/packaging fixes. 1.2.2c1. --- MySQLdb/MANIFEST.in | 2 +- MySQLdb/metadata.cfg | 18 +++++++++--------- MySQLdb/setup.py | 1 + MySQLdb/setup_posix.py | 8 ++++++-- MySQLdb/setup_windows.py | 7 ++++--- MySQLdb/site.cfg | 30 +++++++++--------------------- 6 files changed, 30 insertions(+), 36 deletions(-) diff --git a/MySQLdb/MANIFEST.in b/MySQLdb/MANIFEST.in index f26a5e7..7da2427 100644 --- a/MySQLdb/MANIFEST.in +++ b/MySQLdb/MANIFEST.in @@ -1,4 +1,3 @@ -prune CVS recursive-include doc *.txt include MANIFEST.in include MANIFEST @@ -12,6 +11,7 @@ include test_capabilities.py include test_MySQLdb_capabilities.py include metadata.cfg include site.cfg +include ez_setup.py include setup_common.py include setup_posix.py include setup_windows.py diff --git a/MySQLdb/metadata.cfg b/MySQLdb/metadata.cfg index afba743..51387e8 100644 --- a/MySQLdb/metadata.cfg +++ b/MySQLdb/metadata.cfg @@ -1,26 +1,26 @@ [metadata] -version: 1.2.2b3 -version_info: (1,2,2,'beta',3) +version: 1.2.2c1 +version_info: (1,2,2,'gamma',1) description: Python interface to MySQL long_description: ========================= Python interface to MySQL ========================= - + \n MySQLdb is an interface to the popular MySQL_ database server for Python. The design goals are: - + \n - Compliance with Python database API version 2.0 [PEP-0249]_ - + \n - Thread-safety - + \n - Thread-friendliness (threads will not block each other) - + \n MySQL-3.23 through 5.0 and Python-2.3 through 2.5 are currently supported. - + \n MySQLdb is `Free Software`_. - + \n .. _MySQL: http://www.mysql.com/ .. _`Free Software`: http://www.gnu.org/ .. [PEP-0249] http://www.python.org/peps/pep-0249.html diff --git a/MySQLdb/setup.py b/MySQLdb/setup.py index 0957b9c..0f0da67 100644 --- a/MySQLdb/setup.py +++ b/MySQLdb/setup.py @@ -15,4 +15,5 @@ else: # assume windows metadata, options = get_config() metadata['ext_modules'] = [Extension(sources=['_mysql.c'], **options)] +metadata['long_description'] = metadata['long_description'].replace(r'\n', '') setup(**metadata) diff --git a/MySQLdb/setup_posix.py b/MySQLdb/setup_posix.py index 24c8a63..43ac7c0 100644 --- a/MySQLdb/setup_posix.py +++ b/MySQLdb/setup_posix.py @@ -14,15 +14,16 @@ def compiler_flag(f): def mysql_config(what): from os import popen - f = popen("mysql_config --%s" % what) + f = popen("%s --%s" % (mysql_config.path, what)) data = f.read().strip().split() ret = f.close() if ret: if ret/256: data = [] if ret/256 > 1: - raise EnvironmentError, "mysql_config is not on your PATH" + raise EnvironmentError, "%s not found" % mysql_config.path return data +mysql_config.path = "mysql_config" def get_config(): import os, sys @@ -30,6 +31,9 @@ def get_config(): metadata, options = get_metadata_and_options() + if 'mysql_config' in options: + mysql_config.path = options['mysql_config'] + extra_objects = [] static = enabled(options, 'static') if enabled(options, 'embedded'): diff --git a/MySQLdb/setup_windows.py b/MySQLdb/setup_windows.py index d2a4c15..df3ea79 100644 --- a/MySQLdb/setup_windows.py +++ b/MySQLdb/setup_windows.py @@ -2,13 +2,14 @@ def get_config(): import os, sys, _winreg 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() + serverKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, options['registry_key']) + mysql_root, dummy = _winreg.QueryValueEx(serverKey,'Location') + extra_objects = [] static = enabled(options, 'static') + # XXX static doesn't actually do anything on Windows if enabled(options, 'embedded'): client = "mysqld" else: diff --git a/MySQLdb/site.cfg b/MySQLdb/site.cfg index b120173..5a1ab0e 100644 --- a/MySQLdb/site.cfg +++ b/MySQLdb/site.cfg @@ -1,30 +1,18 @@ -# Options: -# +[options] # embedded: link against the embedded server library # threadsafe: use the threadsafe client # static: link against a static library (probably required for embedded) -[options] embedded = False threadsafe = True static = False -# Use the compiler section to add additional options for the extension build. -# In particular, if your platform does not support mysql_config (like -# Windows), you will have to set most of these. Note that each entry is split -# into a list so that each line is one item. +# The path to mysql_config. +# Only use this if mysql_config is not on your PATH, or you have some weird +# setup that requires it. +#mysql_config = /usr/local/bin/mysql_config -[compiler] -# This section is now obsolete. Most of these items should just be set in -# setup.cfg, and the ONLY if the default configuration doesn't work. -#mysql_root: /usr/local/mysql -#library_dirs: %(mysql_root)s/lib -#include_dirs: %(mysql_root)s/include -#libraries: mysqlclient -# zlib -# msvcrt -# libcmt -# wsock32 -# advapi32 -#extra_compile_args: -#extra_objects: +# The Windows registry key for MySQL. +# This has to be set for Windows buildsto work. +# Only change this if you have a different version. +registry_key = SOFTWARE\MySQL AB\MySQL Server 5.0