~ubuntu-branches/debian/jessie/sqlalchemy/jessie

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: Package Import Robot
  • Author(s): Piotr Ożarowski, Jakub Wilk, Piotr Ożarowski
  • Date: 2013-07-06 20:53:52 UTC
  • mfrom: (1.4.23) (16.1.17 experimental)
  • Revision ID: package-import@ubuntu.com-20130706205352-ryppl1eto3illd79
Tags: 0.8.2-1
[ Jakub Wilk ]
* Use canonical URIs for Vcs-* fields.

[ Piotr Ożarowski ]
* New upstream release
* Upload to unstable
* Build depend on python3-all instead of -dev, extensions are not built for
  Python 3.X 

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
    Extension('sqlalchemy.cprocessors',
43
43
           sources=['lib/sqlalchemy/cextension/processors.c']),
44
44
    Extension('sqlalchemy.cresultproxy',
45
 
           sources=['lib/sqlalchemy/cextension/resultproxy.c'])
 
45
           sources=['lib/sqlalchemy/cextension/resultproxy.c']),
 
46
    Extension('sqlalchemy.cutils',
 
47
           sources=['lib/sqlalchemy/cextension/utils.c'])
46
48
    ]
47
49
 
48
50
ext_errors = (CCompilerError, DistutilsExecError, DistutilsPlatformError)
49
51
if sys.platform == 'win32' and sys.version_info > (2, 6):
50
 
   # 2.6's distutils.msvc9compiler can raise an IOError when failing to
51
 
   # find the compiler
52
 
   ext_errors += (IOError,)
 
52
    # 2.6's distutils.msvc9compiler can raise an IOError when failing to
 
53
    # find the compiler
 
54
    ext_errors += (IOError,)
53
55
 
54
56
class BuildFailed(Exception):
55
57
 
56
58
    def __init__(self):
57
 
        self.cause = sys.exc_info()[1] # work around py 2/3 different syntax
 
59
        self.cause = sys.exc_info()[1]  # work around py 2/3 different syntax
58
60
 
59
61
class ve_build_ext(build_ext):
60
62
    # This class allows C extension building to fail.
72
74
            raise BuildFailed()
73
75
        except ValueError:
74
76
            # this can happen on Windows 64 bit, see Python issue 7511
75
 
            if "'path'" in str(sys.exc_info()[1]): # works with both py 2/3
 
77
            if "'path'" in str(sys.exc_info()[1]):  # works with both py 2/3
76
78
                raise BuildFailed()
77
79
            raise
78
80
 
84
86
        print(msg)
85
87
    print('*' * 75)
86
88
 
87
 
def find_packages(dir_):
 
89
def find_packages(location):
88
90
    packages = []
89
91
    for pkg in ['sqlalchemy']:
90
92
        for _dir, subdirectories, files in (
91
 
                os.walk(os.path.join(dir_, pkg))
 
93
                os.walk(os.path.join(location, pkg))
92
94
            ):
93
95
            if '__init__.py' in files:
94
 
                lib, fragment = _dir.split(os.sep, 1)
95
 
                packages.append(fragment.replace(os.sep, '.'))
 
96
                tokens = _dir.split(os.sep)[len(location.split(os.sep)):]
 
97
                packages.append(".".join(tokens))
96
98
    return packages
97
99
 
98
100
v_file = open(os.path.join(os.path.dirname(__file__),
129
131
          license="MIT License",
130
132
          cmdclass=cmdclass,
131
133
 
132
 
          tests_require=['nose >= 0.11'],
 
134
          tests_require=['nose >= 0.11', 'mock'],
133
135
          test_suite="sqla_nose",
134
136
          long_description=readme,
135
137
          classifiers=[
178
180
    try:
179
181
        run_setup(True)
180
182
    except BuildFailed:
181
 
        exc = sys.exc_info()[1] # work around py 2/3 different syntax
 
183
        exc = sys.exc_info()[1]  # work around py 2/3 different syntax
182
184
        status_msgs(
183
185
            exc.cause,
184
186
            "WARNING: The C extension could not be compiled, " +