-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpavement.py
94 lines (82 loc) · 2.69 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
from paver.easy import *
from paver.release import setup_meta
import paver.doctools
import paver.virtual
import paver.misctasks
from paver.setuputils import setup
options = environment.options
setup(**setup_meta)
options(
minilib=Bunch(
extra_files=['doctools', 'virtual']
),
sphinx=Bunch(
builddir="build",
sourcedir="source"
),
virtualenv=Bunch(
packages_to_install=["nose", "Sphinx>=0.6b1", "docutils", "virtualenv"],
install_paver=False,
script_name='bootstrap.py',
paver_command_line=None
),
cog=Bunch(
includedir="docs/samples",
beginspec="<==",
endspec="==>",
endoutput="<==end==>"
),
)
# not only does paver bootstrap itself, but it should work even with just
# distutils
if paver.setuputils.has_setuptools:
old_sdist = "setuptools.command.sdist"
options.setup.update(dict(
install_requires=[],
test_suite='nose.collector',
zip_safe=False,
entry_points="""
[console_scripts]
paver = paver.tasks:main
"""
))
else:
old_sdist = "distutils.command.sdist"
options.setup.scripts = ['distutils_scripts/paver']
if paver.doctools.has_sphinx:
@task
@needs('cog', 'paver.doctools.html')
def html():
"""Build Paver's documentation and install it into paver/docs"""
builtdocs = path("docs") / options.sphinx.builddir / "html"
destdir = path("paver") / "docs"
destdir.rmtree()
builtdocs.move(destdir)
@task
@needs('html', "minilib", "generate_setup", old_sdist)
def sdist():
"""Builds the documentation and the tarball."""
pass
if paver.virtual.has_virtualenv:
@task
def bootstrap():
"""Build a virtualenv bootstrap for developing paver."""
# we have to pull some private api shenanigans that normal people don't
# because we're bootstrapping paver itself.
paver.virtual._create_bootstrap(options.script_name,
options.packages_to_install,
options.paver_command_line,
options.install_paver,
more_text=""" subprocess.call([join("""
"""bin_dir, 'python'), '-c', """
"""'import sys; sys.path.append("."); """
"""import paver.command; paver.command.main()', """
"""'develop'])""")
@task
def clean():
"""Cleans up this paver directory. Removes the virtualenv traces and
the build directory."""
path("build").rmtree()
path("bin").rmtree()
path("lib").rmtree()
path(".Python").remove()