def nodeLatestVersion(dependency, project_id): r = requests.get('%s%s/latest' % (app.config['NPM_REGISTRY'], dependency)) latestVersion = r.json().get('version') try: dep = ProjectDependency.by_project(project_id, dependency) dep.latest_version = latestVersion if LooseVersion(dep.actual_version) < LooseVersion(latestVersion): dep.status = 'ko' else: dep.status = 'ok' db.session.commit() except Exception, e: app.logger.error(e) db.session.rollback()
def dependencies(project_id): """Page showing status of a project dependencies.""" dependencies = ProjectDependency.by_project(project_id) return render_template('dependencies.html', dependencies=dependencies)