summaryrefslogtreecommitdiff
path: root/release.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2013-06-18 16:17:53 -0500
committerJason R. Coombs <jaraco@jaraco.com>2013-06-18 16:17:53 -0500
commitd1dee0f045c8096904369270899d73ef8b6a96bf (patch)
tree1e5abbc1456077713b0268af0914cfd857b07477 /release.py
parentcae9a18f6df1e8acbab701e853fe076cdbae2467 (diff)
parentcf307155b6c687ea2a9f5369aca5b03007db7b8b (diff)
downloadpython-setuptools-bitbucket-0.8b1.tar.gz
Merge 0.7.3 release0.8b1
Diffstat (limited to 'release.py')
-rw-r--r--release.py26
1 files changed, 19 insertions, 7 deletions
diff --git a/release.py b/release.py
index c3ed3f45..937fadfc 100644
--- a/release.py
+++ b/release.py
@@ -11,23 +11,32 @@ import subprocess
import shutil
import os
import sys
-import urllib2
import getpass
import collections
import itertools
import re
try:
+ import urllib.request as urllib_request
+except ImportError:
+ import urllib2 as urllib_request
+
+try:
+ input = raw_input
+except NameError:
+ pass
+
+try:
import keyring
except Exception:
pass
-VERSION = '0.7.4'
+VERSION = '0.8'
PACKAGE_INDEX = 'https://pypi.python.org/pypi'
def set_versions():
global VERSION
- version = raw_input("Release as version [%s]> " % VERSION) or VERSION
+ version = input("Release as version [%s]> " % VERSION) or VERSION
if version != VERSION:
VERSION = bump_versions(version)
@@ -99,11 +108,11 @@ def add_milestone_and_version(version):
for type in 'milestones', 'versions':
url = (base + '/1.0/repositories/{repo}/issues/{type}'
.format(repo = get_repo_name(), type=type))
- req = urllib2.Request(url = url, headers = headers,
+ req = urllib_request.Request(url = url, headers = headers,
data='name='+version)
try:
- urllib2.urlopen(req)
- except urllib2.HTTPError as e:
+ urllib_request.urlopen(req)
+ except urllib_request.HTTPError as e:
print(e.fp.read())
def bump_versions(target_ver):
@@ -116,7 +125,10 @@ def bump_versions(target_ver):
def bump_version(filename, target_ver):
with open(filename, 'rb') as f:
- lines = [line.replace(VERSION, target_ver) for line in f]
+ lines = [
+ line.replace(VERSION.encode('ascii'), target_ver.encode('ascii'))
+ for line in f
+ ]
with open(filename, 'wb') as f:
f.writelines(lines)