-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathsetup.py
More file actions
70 lines (59 loc) · 1.93 KB
/
setup.py
File metadata and controls
70 lines (59 loc) · 1.93 KB
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
"""Setup for Pypi"""
import os
from setuptools import setup, find_packages
version = '1.4.0'
packages = find_packages(exclude=['test'])
def get_pkg_data(pkg_name, data_dirs, extensions):
"""Recusrively get package data.
This should be called from within setup.py's setuptools.setup() function,
e.g. package_data={'my_package': get_pkg_data(pkg_name='my_pckage', ...)}
Args:
pkg_name (str): Name of package containing package data.
data_dirs (list):
extensions (list):
Returns:
list: List of glob strings where each string represents a terminal
branch node (i.e. folder) and a glob of all files ending in designated
extension(s).
Examples:
Args: get_pkg_data(pkg_name='my_package',
src_dirs=['templates'], extensions=['html'])
Returns: [
'templates/*.html',
'templates/content/*.html',
'templates/content/prompt/*.html',
'templates/content/prompt/inputs/*.html']
"""
pkg_root = \
os.path.dirname(os.path.realpath(__file__)) + '/{}/'.format(pkg_name)
pkg_data = []
for _dir in data_dirs:
for ext in extensions:
for i, j, y in os.walk(pkg_root + _dir):
pkg_data.append(i + '/*.' + ext)
return pkg_data
setup(
name='odk_ppp', # The name 'ppp' was already taken.
version=version,
author='Joe Flack',
author_email='jflack@jhu.edu',
url='http://www.pma2020.org',
packages=packages,
package_dir={
'ppp': 'ppp'
},
package_data={
'ppp': get_pkg_data(
pkg_name='ppp',
data_dirs=['templates'],
extensions=['html', 'css'])
},
license='LICENSE.txt',
description='Converts XlsForms into readable formats.',
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
install_requires=[
'Jinja2>=2.9.6',
'pmix>=0.7.0'
]
)