File: deploy.py

package info (click to toggle)
tilelite 0.1.5-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 648 kB
  • ctags: 95
  • sloc: python: 528; xml: 79; makefile: 10
file content (50 lines) | stat: -rw-r--r-- 979 bytes parent folder | download
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

#!/usr/bin/env python

"""
Release Steps
-------------
 * write 'setup.py' file
 * create ~./pypirc file with pypi user:pass
 * register package with: 'python setup.py register'
 * Edit CHANGELOG.txt
 * Increment '__version__' in main script and 'version' in setup.py
 * Run `deploy.py` to create sdist, upload, and create tag
 * Commit tag
 * Update wiki
"""

import sys
import time
from subprocess import call as subcall

app = 'tilelite'
version = __import__(app).__version__

def call(cmd):
  try:
    response = subcall(cmd,shell=True)
    print
    time.sleep(1)
    if response < 0:
      sys.exit(response)
  except OSError, E:
    sys.exit(E)

def cleanup():
    call('sudo rm -rf *.egg* *.pyc dist/ build/')

def tag():
    call('hg tag -u springmeyer -m "tagging the %s release" %s ' % (version,version))

def upload():
    call('python setup.py sdist upload')

def main():
    cleanup()
    tag()
    upload()
    cleanup()
    
if __name__ == '__main__':
    main()