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
55
|
#!/usr/bin/env python
# Ubuntu CI Engine
# Copyright 2013, 2014 Canonical Ltd.
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License version 3, as
# published by the Free Software Foundation.
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranties of
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU Affero General Public License for more details.
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
import subprocess
import sys
# get ci_utils.setuptools on the path
ci_utils = os.path.join(os.path.dirname(__file__), '../ci-utils')
sys.path.append(ci_utils)
from ci_utils.setup_helper import setup
if sys.argv[1] == 'create_db':
import ppa_assigner.settings
import ci_utils.create_db
dbconfig = ppa_assigner.settings.DATABASES['default']
exit(ci_utils.create_db.create_db(dbconfig))
elif sys.argv[1] == 'test':
# setuptools doesn't work with django's test harness very well, so
# we'll just run everything by hand from here
args = ['./manage.py', 'test']
if len(sys.argv) > 2:
args += sys.argv[2:]
else:
from ppa_assigner import settings
# Default to local apps
args.extend(settings.LOCAL_APPS)
basedir = os.path.abspath(os.path.dirname(__file__))
exit(subprocess.call(args, cwd=basedir))
requires = [
'Django==1.5.5',
'PyYAML==3.10',
'South==0.7.5',
'django-tastypie==0.9.15',
'launchpadlib==1.10.2',
'mock==1.0.1',
'oauth==1.0.1'
]
setup('ppa-assigner', 'ppa_assigner.tests', requires)
|