-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
executable file
·58 lines (50 loc) · 2.35 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
#!/usr/bin/python
from setuptools import setup
import re
import glob
version = None
with open("numpysane.py", "r") as f:
for l in f:
m = re.match("__version__ *= *'(.*?)' *$", l)
if m:
version = m.group(1)
break
if version is None:
raise Exception("Couldn't find version in 'numpysane.py'")
pywrap_templates = glob.glob('pywrap-templates/*.c')
setup(name = 'numpysane',
version = version,
author = 'Dima Kogan',
author_email = 'dima@secretsauce.net',
url = 'http://github.com/dkogan/numpysane',
description = 'more-reasonable core functionality for numpy',
long_description = """numpysane is a collection of core routines to provide basic numpy
functionality in a more reasonable way""",
license = 'LGPL',
py_modules = ['numpysane', 'numpysane_pywrap'],
install_requires = ('numpy',),
# This is REALLY stupid. The simple act of shipping some non-source data
# with the module is really difficult for Python people. There are
# multiple methods (package_data, data_files, MANIFEST.in, etc) which all
# kinda work, with the details changing over time and what's right and
# wrong over time. Lots of exasperated threads on this topic on the
# internet. It's easy to get this all mostly working but not really. Just
# now I was using "data_files", which built stuff correctly, and uploaded
# stuff to pypi correctly, but the "pip install" wouldn't install the
# data. Or would install it to some un-findable location. There's an
# unknowable difference between what "setup.py dist" does and "setup.py
# bdist" does and what "pip install" does.
#
# I think I'm supposed to have all the sources and data in a subdirectory
# from where setup.py is, but I'm not doing that.
#
# What I'm doing here isn't "right", but I think it works. Here I'm saying
# that there's one "package", in the root, and I have template data. In
# MANIFEST.in I exclude EVERYTHING, and whitelist all the files that I do
# want to end up in the package. I think it works?
#
# Note that I'm not supposed to add '.' as a package, and it yells at me.
# But it's just a warning so I move on
packages = ['.'],
package_data = {'': pywrap_templates}
)