forked from reddit/snudown
-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
38 lines (33 loc) · 877 Bytes
/
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
from setuptools import setup, Extension
import re
import os
import fnmatch
def c_files_in(directory):
paths = []
names = os.listdir(directory)
for f in fnmatch.filter(names, '*.c'):
paths.append(os.path.join(directory, f))
return paths
version = None
version_re = re.compile(r'^#define\s+SNUDOWN_VERSION\s+"([^"]+)"$')
with open('snudown.c', 'r') as f:
for line in f:
m = version_re.match(line)
if m:
version = m.group(1)
assert version
setup(
name='snudown',
version=version,
author='Vicent Marti',
author_email='vicent@github.com',
license='MIT',
test_suite="test_snudown.test_snudown",
ext_modules=[
Extension(
name='snudown',
sources=['snudown.c'] + c_files_in('src/') + c_files_in('html/'),
include_dirs=['src', 'html']
)
],
)