-
Notifications
You must be signed in to change notification settings - Fork 1
/
pavement.py
78 lines (61 loc) · 1.91 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import optparse
try:
import requests
except ImportError:
requests = None
from paver.easy import task, needs, cmdopts, path, call_task, no_help
try:
from setup import build_info
except ImportError:
sys.path.append(os.path.dirname(__file__))
from setup import build_info
import sett
@task
@no_help
@cmdopts([
optparse.make_option('-n', '--naked',
action='store_true',
default=False,
help='Create a package with minimal dependencies'),
])
def setup_options(options):
nodeps = getattr(getattr(options, 'setup_options', None), 'naked', False)
sys.stderr.write('Creating {0} version\n'.format(
'nodeps' if nodeps else 'standard'
))
if nodeps:
build_info['name'] += '-nodeps'
call_task('sett.build.setup_options')
@task
@no_help
@needs(['setup_options'])
@cmdopts([
optparse.make_option('-n', '--naked',
action='store_true',
default=False,
help='Create a package with minimal dependencies'),
])
def set_requirements(options):
path('requirements.txt').unlink_p()
if options.set_requirements.naked:
path('naked_requirements.txt').copy('requirements.txt')
else:
path('default_requirements.txt').copy('requirements.txt')
@task
@needs(['web', 'set_requirements'])
@cmdopts([], share_with=['set_requirements', 'setup_options'])
def make(options):
"""Overrides sdist to make sure that our setup.py is generated."""
call_task('sett.build.make')
remote_archive = 'http://builds.napix.io/web/napix-latest.tar.gz'
@task
@cmdopts([
('web_archive=', 'w', 'Web site package'),
])
def web(options):
web_archive = getattr(options.web, 'web_archive', remote_archive)
call_task('install_remote_tar', args=[web_archive, 'napixd/web'])