This repository has been archived by the owner on Feb 9, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathsetup.py
52 lines (45 loc) · 1.69 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
import os
from setuptools import setup, find_packages
from version import get_git_version
def files(folder, exclude=[]):
found_files = []
for root, dirs, files in os.walk(folder):
for f in files:
if not any(("%s/%s" % (root, f)).startswith(e) for e in exclude):
found_files.append((root, f))
return found_files
def flatten_all_files(*dirs, **kwargs):
exclude = kwargs.get('exclude', [])
root = kwargs.get('root', '')
all_files = []
for d in dirs:
for f in files(d, exclude):
froot, fnm = f
prefix_start = froot.find(root)
assert prefix_start > -1, 'Impossible base root provided. Found files do not match: %s' % root
all_files.append(("%s" % (froot[prefix_start + len(root):]), ["%s/%s" % (froot, fnm)]))
return all_files
#
data_files = flatten_all_files('build/Onc/production/',
exclude=('build/Onc/production/lib/ext-4.2', 'build/Onc/production/.sass-cache'),
root='build/Onc/production/'
)
data_files.append(('', ['favicon.png', 'beep.wav', 'portal.html']))
setup(
name="opennode.oms.onc",
version=get_git_version(),
description="""OpenNode Console application""",
author="OpenNode Developers",
author_email="[email protected]",
packages=find_packages(),
data_files=data_files,
namespace_packages=['opennode'],
zip_safe=False, # we need to serve real files
entry_points={'oms.plugins': ['onc = opennode.onc.main:OncPlugin']},
install_requires=[
"setuptools", # Redundant but removes a warning
"opennode.oms.core",
"opennode.oms.knot",
],
license='GPLv2',
)