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
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

View File

@ -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

View File

@ -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)

View File

@ -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'):

View File

@ -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:

View File

@ -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