-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathsetup.py
More file actions
42 lines (39 loc) · 1.32 KB
/
setup.py
File metadata and controls
42 lines (39 loc) · 1.32 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
from setuptools import setup, Extension
from Cython.Build import cythonize
import numpy
extensions = [
Extension("bigfile.pyxbigfile",
sources = [
"bigfile/pyxbigfile.pyx",
"src/bigfile.c",
"src/bigfile-record.c",
],
depends = [
"src/bigfile.h",
"src/bigfile-internal.h",
],
include_dirs = ["src/", numpy.get_include()])]
def find_version(path):
import re
# path shall be a plain ascii text file.
s = open(path, 'rt').read()
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
s, re.M)
if version_match:
return version_match.group(1)
raise RuntimeError("Version not found")
setup(
name="bigfile",
version=find_version("bigfile/version.py"),
author="Yu Feng, Simeon Bird",
author_email="rainwoodman@gmail.com",
url="http://github.com/MP-Gadget/bigfile",
description="python binding of BigFile, a peta scale IO format",
zip_safe = False,
package_dir = {'bigfile': 'bigfile'},
install_requires=['cython', 'numpy'],
scripts = ['scripts/bigfile-convert', 'scripts/hdf2bigfile'],
packages= ['bigfile', 'bigfile.tests'],
license='BSD-2-Clause',
ext_modules = cythonize(extensions)
)