-
Notifications
You must be signed in to change notification settings - Fork 18
/
setup.py
executable file
·117 lines (101 loc) · 4.1 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#!/usr/bin/env python
import os
import fnmatch
from setuptools import setup, find_packages
from pip.req import parse_requirements
from adlibre_tms import __version__ as VERSION
install_reqs = parse_requirements('requirements.txt')
requirements = [str(ir.req) for ir in install_reqs]
def find_files(directory, pattern):
for root, dirs, files in os.walk(directory):
for base_name in files:
if fnmatch.fnmatch(base_name, pattern):
filename = os.path.join(root, base_name)
if os.path.isfile(filename):
yield filename
def find_files_full(dir, pattern='*'):
"""
Returns a dict with full relative path to files
"""
all_files = []
for root, dirs, files in os.walk(dir):
if len(files) > 0:
for file in fnmatch.filter(files, pattern):
file_path = os.path.join(root, file)
all_files.extend((file_path,))
return all_files
def findall(dir, pattern='*'):
"""
A better finder for 'data_files'
"""
all_files = []
for root, dirs, files in os.walk(dir):
if len(files) > 0:
file_list = []
for file in fnmatch.filter(files, pattern):
file_path = os.path.join(root, file)
file_list.extend((file_path,))
all_files.extend(((root, file_list,),))
return all_files
setup(
name='adlibre_tms',
version=VERSION,
author='Adlibre Pty Ltd',
author_email='[email protected]',
license='BSD',
description='Timesheet and Expense tracking system for the web. Build with Python & Django. Interfaces to Saasu.',
long_description=open('README.md').read(),
classifiers=[
'Environment :: Web Environment',
'Framework :: Django',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
],
url='https://github.com/adlibre/Adlibre-TMS',
packages=find_packages('.'),
scripts=[],
package_data={
'adlibre_tms': [
'apps/saasu_client/templates/saasu_client/*.xml',
'apps/tms/contrib/saasu/media/admin/saasu/js/*.js',
'apps/tms/contrib/saasu/templates/saasu/admin/*.html',
'apps/tms/fixtures/initial_data.json',
'apps/tms/templates/tms/*.html',
'apps/tms/static/tms/css/*.css',
'apps/tms/static/tms/images/*',
'apps/tms/static/tms/js/*.js',
'apps/tms/static/tms/js/*.htc',
'apps/tms/static/tms/js/jquery-themes/base/*.css',
'apps/tms/static/tms/js/jquery-themes/base/images/*',
'apps/tms/static/tms/js/jquery-themes/ui-lightness/*.css',
'apps/tms/static/tms/js/jquery-themes/ui-lightness/images/*',
'apps/tms/static/tms/js/jquery-ui/*.js',
'apps/tms/static/tms/js/jquery-ui/i18n/*.js',
'apps/tms/static/tms/js/jquery-ui/minified/*.js',
'static/uni_form/*',
'templates/*.html',
'templates/adlibre/contrib/widgets/*.html',
'templates/admin/*.html',
'templates/admin/tms/*.html',
'templates/admin/tms/customer/*.html',
'templates/admin/tms/job/*.html',
'templates/admin/tms/project/*.html',
'templates/admin/tms/services/*.html',
'templates/pagination/*.html',
'templates/registration/*.html',
'templates/reporting/*.html',
'templates/tms/*.html',
'templates/tms/reports/*.html',
'templates/uni_form/*.html',
], # this should be done automatically
},
data_files=[
('', ['.env.example', 'requirements.txt', 'Deployfile', 'Procfile']),
('', ['local_settings.py.example', 'manage.py']),
('db', ['db/.gitignore']), # create empty dir
('docs', find_files('docs', '*')),
('www', ['www/.gitignore']), # create empty dir
],
install_requires=requirements,
)