资源简介
SQLAlchemy-1.2.18.tar.gz
代码片段和文件信息
from distutils.command.build_ext import build_ext
from distutils.errors import CCompilerError
from distutils.errors import DistutilsExecError
from distutils.errors import DistutilsPlatformError
import os
import platform
import re
import sys
from setuptools import Distribution as _Distribution
from setuptools import Extension
from setuptools import find_packages
from setuptools import setup
from setuptools.command.test import test as TestCommand
cmdclass = {}
if sys.version_info < (2 7):
raise Exception(“SQLAlchemy requires Python 2.7 or higher.“)
cpython = platform.python_implementation() == “CPython“
ext_modules = [
Extension(
“sqlalchemy.cprocessors“
sources=[“lib/sqlalchemy/cextension/processors.c“]
)
Extension(
“sqlalchemy.cresultproxy“
sources=[“lib/sqlalchemy/cextension/resultproxy.c“]
)
Extension(
“sqlalchemy.cutils“ sources=[“lib/sqlalchemy/cextension/utils.c“]
)
]
ext_errors = (CCompilerError DistutilsExecError DistutilsPlatformError)
if sys.platform == “win32“:
# 2.6‘s distutils.msvc9compiler can raise an IOError when failing to
# find the compiler
ext_errors += (IOError)
class BuildFailed(Exception):
def __init__(self):
self.cause = sys.exc_info()[1] # work around py 2/3 different syntax
class ve_build_ext(build_ext):
# This class allows C extension building to fail.
def run(self):
try:
build_ext.run(self)
except DistutilsPlatformError:
raise BuildFailed()
def build_extension(self ext):
try:
build_ext.build_extension(self ext)
except ext_errors:
raise BuildFailed()
except ValueError:
# this can happen on Windows 64 bit see Python issue 7511
if “‘path‘“ in str(sys.exc_info()[1]): # works with both py 2/3
raise BuildFailed()
raise
cmdclass[“build_ext“] = ve_build_ext
class Distribution(_Distribution):
def has_ext_modules(self):
# We want to always claim that we have ext_modules. This will be fine
# if we don‘t actually have them (such as on PyPy) because nothing
# will get built however we don‘t want to provide an overally broad
# Wheel package when building a wheel without C support. This will
# ensure that Wheel knows to treat us as if the build output is
# platform specific.
return True
class PyTest(TestCommand):
# from http://pytest.org/latest/goodpractices.html\
# #integrating-with-setuptools-python-setup-py-test-pytest-runner
# TODO: prefer pytest-runner package at some point however it was
# not working at the time of this comment.
user_options = [(“pytest-args=“ “a“ “Arguments to pass to py.test“)]
default_options = [“-n“ “4“ “-q“ “--nomemory“]
def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = ““
def fina
- 上一篇:MySQLDBA修炼之道 高清完整PDF版
- 下一篇:新华字典数据库
相关资源
- SQL进阶教程.[日]MICK(带书签高清文字
- MySQL必知必会文字版_推荐.7z
- PLSQL汉化包.zip
- 51CTO-深入浅出MySQL全文.pdf
- 10000_access.log
- Ecology8安装部署手册_Windows_SQLServer_2
- derby数据库转sql、db2等其他数据库的简
- 用友NC63脚本导出工具V3.0.rar
- MySQL与MariaDB学习指南.pdf
- 新闻发布系统MySQL.rar
- sqlserver2012.docx
- DBImport破解版sqlitetomysqltoOracle.rar
- 掘金小册MySQL是怎样运行的:从根儿上
- .netCore3.0MVC_EF_Oracle项目搭建步骤.doc
- MS官方卸载工具Sql2008和SQL2005,控制面
- SQLServer2012ReportingService高级教程_资料
- Safe3SQL注入安全检测工具V9.0.zip
- yyySQLv2.0(测试版).rar
- 题库.sql
- LearningSparkSQL.pdf.zip
- Navicat8.2MySQL.zip
- SQLPrompt.zip
- T-SQL性能调优秘笈基于SQLServer2012窗口
- 基于SSM的在线学习在线课堂系统MySQ
- vs2010+sqlserver2017.rar
- zw_OraclePL_SQL从入门到精通pdf版本(普
- NavicateforMySQL破解版.zip
- SQL基础教程第2版-文字版.rar
- NavicatforMySQL中文破解版.zip
- SQLyogUltimate12.5.0.zip
评论
共有 条评论