提交 4a72330a authored 作者: Ilan Schnell's avatar Ilan Schnell

ENH: remove setuptools dependency

上级 b672a3a0
差异被折叠。
...@@ -4,17 +4,15 @@ ...@@ -4,17 +4,15 @@
# * Figure out how to compile and install documentation automatically # * Figure out how to compile and install documentation automatically
# * Add download_url # * Add download_url
# Detect whether or not the user has setuptools and use the bundled import os
# distribute_setup.py bootstrap module if they don't. import subprocess
from fnmatch import fnmatchcase
from distutils.util import convert_path
try: try:
from setuptools import setup, find_packages from setuptools import setup
except ImportError: except ImportError:
import distribute_setup from distutils.core import setup
distribute_setup.use_setuptools()
from setuptools import setup, find_packages
import os
import subprocess
CLASSIFIERS = """\ CLASSIFIERS = """\
Development Status :: 4 - Beta Development Status :: 4 - Beta
...@@ -54,6 +52,23 @@ ISRELEASED = False ...@@ -54,6 +52,23 @@ ISRELEASED = False
VERSION = '%d.%d.%d%s' % (MAJOR, MINOR, MICRO, SUFFIX) VERSION = '%d.%d.%d%s' % (MAJOR, MINOR, MICRO, SUFFIX)
def find_packages(where='.', exclude=()):
out = []
stack=[(convert_path(where), '')]
while stack:
where, prefix = stack.pop(0)
for name in os.listdir(where):
fn = os.path.join(where,name)
if ('.' not in name and os.path.isdir(fn) and
os.path.isfile(os.path.join(fn, '__init__.py'))
):
out.append(prefix+name)
stack.append((fn, prefix+name+'.'))
for pat in list(exclude) + ['ez_setup', 'distribute_setup']:
out = [item for item in out if not fnmatchcase(item, pat)]
return out
def git_version(): def git_version():
""" """
Return the sha1 of local git HEAD as a string. Return the sha1 of local git HEAD as a string.
......
from pkg_resources import parse_version as V
import numpy import numpy
import numpy.linalg import numpy.linalg
......
from pkg_resources import parse_version as V
import sys import sys
try: try:
import scipy import scipy
enable_sparse = V(scipy.__version__) >= V('0.7') scipy_ver = [int(n) for n in scipy.__version__.split('.')[:2]]
enable_sparse = bool(scipy_ver >= [0, 7])
if not enable_sparse: if not enable_sparse:
sys.stderr.write("WARNING: scipy version = %s." sys.stderr.write("WARNING: scipy version = %s."
" We request version >=0.7.0 for the sparse code as it has" " We request version >=0.7.0 for the sparse code as it has"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论