forked from paulocheque/django-dynamic-fixture
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
69 lines (59 loc) · 1.35 KB
/
Rakefile
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
VERSION = "1.8.1"
def colorize(text, color)
color_codes = {
:black => 30,
:red => 31,
:green => 32,
:yellow => 33,
:blue => 34,
:magenta => 35,
:cyan => 36,
:white => 37
}
code = color_codes[color]
if code == nil
text
else
"\033[#{code}m#{text}\033[0m"
end
end
def virtual_env(command, env)
sh "source #{env}/bin/activate ; #{command}"
end
def create_virtual_env(dir, python)
sh "virtualenv #{dir} -p #{python}"
end
task :clean => [] do
sh "rm -rf ~*"
sh "rm -rf *.pyc *.pyo"
sh "rm -rf data/"
sh "rm -rf *.egg-info"
sh "rm -rf dist/"
end
task :install => [] do
sh "python --version"
sh "ruby --version"
sh "easy_install pip"
end
task :tag => [] do
sh "git tag #{VERSION}"
sh "git push origin #{VERSION}"
end
task :reset_tag => [] do
sh "git tag -d #{VERSION}"
sh "git push origin :refs/tags/#{VERSION}"
end
task :publish => [:tag] do
# http://guide.python-distribute.org/quickstart.html
# python setup.py sdist
# python setup.py register
# Create a .pypirc file in ~ dir (cp .pypirc ~)
# python setup.py sdist upload
# Manual upload to PypI
# http://pypi.python.org/pypi/THE-PROJECT
# Go to 'edit' link
# Update version and save
# Go to 'files' link and upload the file
virtual_env("python setup.py sdist upload", "env2.7")
end
task :default => []