This repository was archived by the owner on Aug 9, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
58 lines (46 loc) · 1.6 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
# This is your "setup.py" file.
# See the following sites for general guide to Python packaging:
# * `The Hitchhiker's Guide to Packaging <http://guide.python-distribute.org/>`_
# * `Python Project Howto <http://infinitemonkeycorps.net/docs/pph/>`_
from setuptools import setup, find_packages
import os
import sys
here = os.path.abspath(os.path.dirname(__file__))
install_requires = ['selenium', 'pudb']
def gen_data_files(src_dir):
"""
generates a list of files contained in the given directory (and its
subdirectories) in the format required by the ``package_data`` parameter
of the ``setuptools.setup`` function.
Parameters
----------
src_dir : str
(relative) path to the directory structure containing the files to
be included in the package distribution
Returns
-------
fpaths : list(str)
a list of file paths
"""
fpaths = []
base = os.path.dirname(src_dir)
for root, dir, files in os.walk(src_dir):
if len(files) != 0:
for f in files:
fpaths.append(os.path.relpath(os.path.join(root, f), base))
return fpaths
distribution_files = [('.', ['./Makefile', './LICENSE', './README.rst', ])]
setup(name='rstviewer',
version='0.1.0',
packages=find_packages("src"),
package_dir = {'': "src"},
package_data = {'rstviewer': gen_data_files('src/rstviewer/data')},
include_package_data=True,
data_files = distribution_files,
zip_safe=False,
install_requires=install_requires,
entry_points={
'console_scripts':
['rstviewer=rstviewer.main:cli']
}
)