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
e8aebd11
Commit
e8aebd11
authored
Jul 05, 2013
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use requests for updating milestone and version
parent
70dc35dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
15 deletions
+5
-15
release.py
release.py
+5
-15
No files found.
release.py
View file @
e8aebd11
...
...
@@ -16,10 +16,7 @@ import collections
import
itertools
import
re
try
:
import
urllib.request
as
urllib_request
except
ImportError
:
import
urllib2
as
urllib_request
import
requests
try
:
input
=
raw_input
...
...
@@ -79,7 +76,7 @@ def get_repo_name():
"""
Get the repo name from the hgrc default path.
"""
default = subprocess.check_output('
hg
paths
default
').strip()
default = subprocess.check_output('
hg
paths
default
').strip()
.decode('
utf
-
8
')
parts = default.split('
/
')
if parts[-1] == '':
parts.pop()
...
...
@@ -105,20 +102,13 @@ def get_mercurial_creds(system='https://bitbucket.org', username=None):
return Credential(username, password)
def add_milestone_and_version(version):
auth = '
Basic
' + '
:
'.join(get_mercurial_creds()).encode('
base64
').strip()
headers = {
'
Authorization
': auth,
}
base = '
https
:
//
api
.
bitbucket
.
org
'
for type in '
milestones
', '
versions
':
url = (base + '
/
1.0
/
repositories
/
{
repo
}
/
issues
/
{
type
}
'
.format(repo = get_repo_name(), type=type))
req = urllib_request.Request(url = url, headers = headers,
data='
name
=
'+version)
try:
urllib_request.urlopen(req)
except urllib_request.HTTPError as e:
print(e.fp.read())
resp = requests.post(url=url,
data='
name
=
'+version, auth=get_mercurial_creds())
resp.raise_for_status()
def bump_versions(target_ver):
for filename in files_with_versions:
...
...
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