forked from ProjectDrawdown/solutions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
50 lines (44 loc) · 1.53 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
import os
import fnmatch
from setuptools import setup, find_packages
EXTENSIONS = ['*.zip', '*.csv', '*.json', '*.xlsx', '*.xlsm']
def recursive_get_package_data():
'''
Recursively add the absolute filepath of data to package
that has the extensions from the EXTENSIONS array.
'''
matches = []
THIS_FILE_DIR = os.path.dirname(os.path.realpath(__file__))
for ext in EXTENSIONS:
for root, dirnames, filenames in os.walk(THIS_FILE_DIR):
for filename in fnmatch.filter(filenames, ext):
matches.append(os.path.join(os.path.relpath(root, THIS_FILE_DIR),
filename))
for dirname in dirnames:
for root, dirnames, filenames in os.walk(dirname):
for filename in fnmatch.filter(filenames, ext):
matches.append(os.path.join(
os.path.relpath(root, os.path.join(THIS_FILE_DIR, dirname)), filename))
return matches
def list_package_dependencies():
'''
return the list of dependencies as array of string
'''
with open('requirements.txt') as f:
required = f.read().splitlines()
return required
setup(
name='drawdown-solutions',
version='1.0',
description='TODO: add short description',
package_data = {
'': recursive_get_package_data(),
},
packages=find_packages(
exclude = ['limbo', 'test'],
),
install_requires=list_package_dependencies(),
url='https://github.com/ProjectDrawdown/solutions',
license='LICENSE',
long_description=open('README.md').read(),
)