示例#1
0
#!/usr/bin/env python

import os
import sys
import subprocess
import string

from distutils.core import setup, Extension

if os.name == "posix":
    from mariadb_posix import get_config

cfg = get_config()

setup(
    name='mariadb',
    version='0.9.1',
    description='Python MariaDB extension',
    author='Georg Richter',
    license='LGPL 2.1',
    url='http://www.mariadb.com',
    ext_modules=[
        Extension('mariadb', [
            'src/mariadb.c', 'src/mariadb_connection.c',
            'src/mariadb_exception.c', 'src/mariadb_cursor.c',
            'src/mariadb_codecs.c', 'src/mariadb_field.c',
            'src/mariadb_dbapitype.c', 'src/mariadb_indicator.c'
        ],
                  include_dirs=cfg.includes,
                  library_dirs=cfg.lib_dirs,
                  libraries=cfg.libs)
示例#2
0
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
    long_description = f.read()

define_macros= []

# read settings from site.cfg
c= ConfigParser()
c.read(['site.cfg'])
options= dict(c.items('cc_options'))

if os.name == "posix":
    from mariadb_posix import get_config
if os.name == "nt":
    from mariadb_windows import get_config

cfg = get_config(options)

PY_MARIADB_AUTHORS= "Georg Richter"

PY_MARIADB_MAJOR_VERSION=1
PY_MARIADB_MINOR_VERSION=0
PY_MARIADB_PATCH_VERSION=7
# PY_MARIADB_PRE_RELEASE_SEGMENT=""

PY_MARIADB_VERSION= "%s.%s.%s" % (PY_MARIADB_MAJOR_VERSION, PY_MARIADB_MINOR_VERSION, PY_MARIADB_PATCH_VERSION)

# Since we increase patch version even for alpha/beta/rc, pre release nr will be always zero.
PY_MARIADB_PRE_RELEASE_NR=0

define_macros.append(("PY_MARIADB_MAJOR_VERSION", PY_MARIADB_MAJOR_VERSION))
define_macros.append(("PY_MARIADB_MINOR_VERSION", PY_MARIADB_MINOR_VERSION))