This repository has been archived by the owner on Sep 17, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
setup.py
executable file
·54 lines (42 loc) · 1.49 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#! /usr/bin/env python
# Public Domain (-) 2010-2011 The Ampify Authors.
# See the Ampify UNLICENSE file for details.
import sys
from distutils.core import Extension, setup
from os.path import dirname, join as join_path, realpath
try:
from pyutil.env import run_command
except ImportError:
from subprocess import call
def run_command(args, cwd, **kwargs):
retcode = call(args, cwd=cwd)
if retcode and kwargs.pop('exit_on_error', None):
sys.exit(1)
# ------------------------------------------------------------------------------
# the extensions
# ------------------------------------------------------------------------------
extensions = [
Extension("simplejson._speedups", ["simplejson/_speedups.c"]),
]
# ------------------------------------------------------------------------------
# run setup
# ------------------------------------------------------------------------------
if not sys.argv[1:]:
sys.argv.extend(['build_ext', '-i'])
setup(
name="pylibs",
version="git",
description="A collection of Python libraries",
ext_modules=extensions,
)
pylibs_path = dirname(realpath(__file__))
packages_path = ['pycrypto']
if sys.version_info < (2, 6):
packages_path.append('pyssl')
for path in packages_path:
path = join_path(pylibs_path, path)
run_command(
[sys.executable, join_path(path, 'setup.py')] + sys.argv[1:],
exit_on_error=True, cwd=path, redirect_stdout=False,
redirect_stderr=False
)