-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
55 lines (47 loc) · 1.95 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
55
#!/usr/bin/env python
import sys, os
from distutils.core import setup
from distutils.command.install_data import install_data
from disttest import test
# Pulled from Django setup.py circa django 1.2
class osx_install_data(install_data):
# On MacOS, the platform-specific lib dir is /System/Library/Framework/Python/.../
# which is wrong. Python 2.5 supplied with MacOS 10.5 has an Apple-specific fix
# for this in distutils.command.install_data#306. It fixes install_lib but not
# install_data, which is why we roll our own install_data class.
def finalize_options(self):
# By the time finalize_options is called, install.install_lib is set to the
# fixed directory, so we set the installdir to install_lib. The
# install_data class uses ('install_data', 'install_dir') instead.
self.set_undefined_options('install', ('install_lib', 'install_dir'))
install_data.finalize_options(self)
if sys.platform == "darwin":
cmdclasses = {'install_data': osx_install_data}
else:
cmdclasses = {'install_data': install_data}
# Add disttest.test command
cmdclasses['test'] = test
data_files = []
for dirpath, dirnames, filenames in os.walk('gig'):
# Ignore dirnames that start with '.'
for i, dirname in enumerate(dirnames):
if dirname.startswith('.'):
del dirnames[i]
if filenames:
data_files.append([dirpath, [os.path.join(dirpath, f) for f in filenames]])
setup(name='Gig',
version='0.1',
description='A tool for bootstrapping python projects',
author='Tom von Schwerdtner',
author_email='[email protected]',
url='http://www.github.com/tvon/gig/',
packages=['gig', 'gig.commands'],
scripts=['script/gig',],
cmdclass=cmdclasses,
data_files=data_files,
options = {
'test': {
'test_dir':['gig/tests'], # will run all .py files in the tests/ directory
}
}
)