mirror of
https://github.com/PyMySQL/mysqlclient.git
synced 2026-03-13 08:00:02 +08:00
Derive all version information from metadata.cfg
This commit is contained in:
@@ -13,31 +13,20 @@ MySQLdb.converters module.
|
||||
|
||||
"""
|
||||
|
||||
__author__ = "Andy Dustman <andy@dustman.net>"
|
||||
__revision__ = """$Revision$"""[11:-2]
|
||||
version_info = (
|
||||
1,
|
||||
2,
|
||||
1,
|
||||
"gamma",
|
||||
3)
|
||||
if version_info[3] == "final": __version__ = "%d.%d.%d" % version_info[:3]
|
||||
else: __version__ = "%d.%d.%d%1.1s%d" % version_info[:5]
|
||||
from release import __version__, version_info, __author__
|
||||
|
||||
import _mysql
|
||||
|
||||
v = getattr(_mysql, 'version_info', None)
|
||||
if version_info != v:
|
||||
raise ImportError, "this is MySQLdb version %s, but _mysql is version %s" %\
|
||||
(version_info, v)
|
||||
del v
|
||||
if version_info != _mysql.version_info:
|
||||
raise ImportError, "this is MySQLdb version %s, but _mysql is version %r" %\
|
||||
(version_info, _mysql.version_info)
|
||||
|
||||
threadsafety = 1
|
||||
apilevel = "2.0"
|
||||
paramstyle = "format"
|
||||
|
||||
from _mysql import *
|
||||
#from MySQLdb.sets import DBAPISet, Set
|
||||
from MySQLdb.constants import FIELD_TYPE
|
||||
from MySQLdb.times import Date, Time, Timestamp, \
|
||||
DateFromTicks, TimeFromTicks, TimestampFromTicks
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#define version_info "(1,2,1,'gamma',3)"
|
||||
#define __version__ "1.2.1c3"
|
||||
/*
|
||||
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
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
[metadata]
|
||||
version: 1.2.1c4
|
||||
version_info: (1,2,1,'gamma',4)
|
||||
description: Python interface to MySQL
|
||||
long_description:
|
||||
=========================
|
||||
@@ -48,6 +49,7 @@ py_modules:
|
||||
MySQLdb.converters
|
||||
MySQLdb.connections
|
||||
MySQLdb.cursors
|
||||
MySQLdb.release
|
||||
MySQLdb.times
|
||||
MySQLdb.constants.CR
|
||||
MySQLdb.constants.FIELD_TYPE
|
||||
|
||||
@@ -70,6 +70,17 @@ if static:
|
||||
extra_objects.append(os.path.join(
|
||||
library_dirs[0],'lib%s.a' % client))
|
||||
|
||||
extra_compile_args.append("-Dversion_info=\"%s\"" % metadata['version_info'])
|
||||
extra_compile_args.append("-D__version__=\"%s\"" % metadata['version'])
|
||||
|
||||
rel = open("MySQLdb/release.py",'w')
|
||||
rel.write("""
|
||||
__author__ = "%(author)s <%(author_email)s>"
|
||||
version_info = %(version_info)s
|
||||
__version__ = "%(version)s"
|
||||
""" % metadata)
|
||||
rel.close()
|
||||
|
||||
ext_mysql_metadata = dict(
|
||||
name="_mysql",
|
||||
include_dirs=include_dirs,
|
||||
|
||||
Reference in New Issue
Block a user