-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
56 lines (40 loc) · 1.26 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/python2.5
'''
Setup script, setup.py, is used to create installable packet from Python project.
For more information see http://docs.python.org/distutils/setupscript.html
This script with Makefile is used to generate the Debian package.
'''
from distutils.core import setup
import os.path;
from maebird import config
# Source directory.
source_dir = 'src';
# Executables. These files will be installed into bin folder (example /usr/local/bin).
scripts = ['src/main.py']
# Included packages from source directory.
packages = ['']
package_dir = {'' : source_dir}
def path_to_package(base_dir, path):
'''
Convert directory path to package name.
'''
head, tail = os.path.split(path)
if head == '' or head == base_dir:
return tail
else:
return path_to_package(base_dir, head) + "." + tail
'''
Append all packages from source_dir ('src').
'''
for dirpath, dirnames, filenames in os.walk(source_dir):
if "__init__.py" in filenames:
packages.append(path_to_package(source_dir, dirpath))
setup(
name = 'MaeBird',
version = config.__VERSION__,
author = 'Joona Lehtomaki',
packages = packages,
package_dir = package_dir,
scripts = scripts,
data_files=[]
)