mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-06 07:18:28 +01:00
dvc: use our own api instead of github's for version retrieval
Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
@@ -1,19 +1,18 @@
|
||||
from github import Github
|
||||
import json
|
||||
import requests
|
||||
|
||||
from dvc import VERSION_BASE
|
||||
from dvc.logger import Logger
|
||||
|
||||
GITHUB_USER = 'dataversioncontrol'
|
||||
GITHUB_REPO = 'dvc'
|
||||
DVCAPI_URL = 'https://4ki8820rsf.execute-api.us-east-2.amazonaws.com/prod/latest-version'
|
||||
|
||||
def check_updates():
|
||||
current = VERSION_BASE
|
||||
|
||||
try:
|
||||
gh = Github()
|
||||
user = gh.get_user(GITHUB_USER)
|
||||
repo = user.get_repo(GITHUB_REPO)
|
||||
latest = repo.get_latest_release().title
|
||||
r = requests.get(DVCAPI_URL)
|
||||
j = json.loads(r.content)
|
||||
latest = j['version']
|
||||
except Exception as exc:
|
||||
Logger.debug('Failed to obtain latest version: {}'.format(str(exc)))
|
||||
return
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
"Hello from Lambda"
|
||||
+1
-1
@@ -20,4 +20,4 @@ paramiko>=2.4.1
|
||||
binaryornot==0.4.4
|
||||
jsonpath-rw==1.4.0
|
||||
reflink==0.2.0
|
||||
PyGithub>=1.39
|
||||
requests>=2.18.4
|
||||
|
||||
Reference in New Issue
Block a user