-
Notifications
You must be signed in to change notification settings - Fork 0
/
pavement.py
51 lines (43 loc) · 1.26 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
# -*- coding: utf-8 -*-
"""pavement.py -- pavement for de-vice.
Copyright 2011 Plexical. See LICENCE for permissions.
"""
import os
import sys
# Tox doesn't have the Paver dependency at this point
try:
import paver
except ImportError:
sys.path.insert(0, os.path.join('deps', 'paver-minilib.zip'))
from paver.easy import *
from paver.setuputils import setup
from device import meta
setup(
name=meta.name,
packages=('device',),
version=meta.version,
author='Jacob Oscarson',
author_email='[email protected]',
install_requires=open(os.path.join('deps',
'install.txt')).readlines()
)
@task
def virtualenv():
"Prepares a checked out directory for development"
if not os.path.exists(os.path.join('bin', 'pip')):
sys.path.insert(0, os.path.join('deps', 'virtualenv.zip'))
import virtualenv
virtualenv.create_environment('.')
else:
print('Virtualenv already set up')
@needs('virtualenv')
@task
def env():
"Ensure virtualenv exists and is up to date"
sh('./bin/pip install -r deps/install.txt --upgrade')
sh('./bin/pip install -r deps/developer.txt --upgrade')
@task
def clean():
path('bin').rmtree()
path('lib').rmtree()
path('include').rmtree()