Skip to content

Commit

Permalink
Merge pull request #38 from pybee/phildini-fix-releases
Browse files Browse the repository at this point in the history
Use the pybee-hosted version of the releases list
  • Loading branch information
freakboy3742 committed May 22, 2017
2 parents 29896b6 + 13bb3bd commit 02ac790
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
15 changes: 5 additions & 10 deletions briefcase/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,10 @@
import json
import random
import re
import requests
import shutil
import sys
import uuid
from urllib.error import URLError

try:
from urllib.request import urlopen
except ImportError: # Python 2 compatibility
from urllib2 import urlopen

from datetime import date
from distutils.core import Command
Expand Down Expand Up @@ -113,11 +108,11 @@ def finalize_options(self):
pip.utils.ensure_dir(self.download_dir)

def find_support_pkg(self):
api_url = 'https://api.github.com/repos/%s/releases' % self.support_project
api_url = 'https://pybee.org/static/api/%s/releases.json' % self.support_project

try:
releases = json.loads(urlopen(api_url).read().decode('utf8'))
except URLError:
releases = requests.get(api_url).json()
except requests.exceptions.RequestException:
print()
print("We had trouble connecting to Github to look for appropriate")
print("support packages. This can happen when you have tried too many")
Expand All @@ -127,7 +122,7 @@ def find_support_pkg(self):

candidates = []
for release in releases:
if release['tag_name'].startswith("%s.%s-" % (sys.version_info.major, sys.version_info.minor)):
if release['tag_name'] and release['tag_name'].startswith("%s.%s-" % (sys.version_info.major, sys.version_info.minor)):
for asset in release['assets']:
if asset['name'].endswith('.tar.gz') and self.platform in asset['name']:
candidates.append((release['created_at'], asset['browser_download_url']))
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
'cookiecutter >= 1.0',
'voc >= 0.1.1',
'setuptools >= 27.0',
'requests < 3.0',
],
license='New BSD',
classifiers=[
Expand Down

0 comments on commit 02ac790

Please sign in to comment.