-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathpavement.py
70 lines (62 loc) · 1.72 KB
/
pavement.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
59
60
61
62
63
64
65
66
67
68
69
70
import errno
import os
from setuptools import Extension
from paver.easy import *
from paver.path import path
from paver.setuputils import setup
setup(
name="btree",
description="BTree implementation as a C python extension",
version="0.2.1",
author="Travis J Parker",
author_email="[email protected]",
url="http://github.com/teepark/btree",
license="BSD",
ext_modules=[Extension(
'btree',
['src/btreemodule.c', 'src/sorted_btree.c'],
include_dirs=())],
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Natural Language :: English",
"Programming Language :: C",
]
)
MANIFEST = (
"setup.py",
"paver-minilib.zip",
"src/btree_common.c",
"src/btree_common.h",
"src/btreemodule.c",
"src/offsetstring.h",
"src/sorted_btree.c",
"src/sorted_btree.h",
)
@task
def manifest():
path('MANIFEST.in').write_lines('include %s' % x for x in MANIFEST)
@task
@needs('generate_setup', 'minilib', 'manifest', 'setuptools.command.sdist')
def sdist():
pass
@task
def clean():
for p in map(path, ('btree.egg-info', 'dist', 'build', 'MANIFEST.in')):
if p.exists():
if p.isdir():
p.rmtree()
else:
p.remove()
for p in path(__file__).abspath().parent.walkfiles():
if p.endswith(".pyc") or p.endswith(".pyo"):
try:
p.remove()
except OSError as exc:
if exc.args[0] == errno.EACCES:
continue
raise
@task
def docs():
sh("find docs -name *.rst | xargs touch; cd docs; make html")