Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
38af6239
Commit
38af6239
authored
Jun 18, 2013
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update release script to run under Python 3
parent
b0abfb1c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
release.py
release.py
+18
-6
No files found.
release.py
View file @
38af6239
...
...
@@ -11,12 +11,21 @@ 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
:
...
...
@@ -27,7 +36,7 @@ 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 = urllib
2
.Request(url = url, headers = headers,
req = urllib
_request
.Request(url = url, headers = headers,
data='
name
=
'+version)
try:
urllib
2
.urlopen(req)
except urllib
2
.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)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment