Пример #1
0
# imports - standard imports
from datetime import datetime, timedelta
from functools import partial
import os.path as osp
import re

# imports - module imports
from fluxviz.__attr__ import __name__ as NAME
from fluxviz import _pip, semver, request as req, db, log
from fluxviz.tree import Node as TreeNode
from fluxviz.util.string import kebab_case, strip
from fluxviz._compat import iteritems, string_types
from fluxviz.config import Settings

logger = log.get_logger()
_db = db.get_connection()
settings = Settings()


def _get_pypi_info(name, raise_err=True):
    url = "https://pypi.org/pypi/{}/json".format(name)
    res = req.get(url)

    info = None

    if res.ok:
        data = res.json()
        info = data["info"]
    else:
        if raise_err:
            res.raise_for_status()
Пример #2
0
# imports - standard imports
import re
from functools import partial, cmp_to_key

# imports - module imports
from fluxviz.model.package import Package, _get_pip_info
from fluxviz import _pip, parallel
from fluxviz.util.array import compact, flatten
from fluxviz.util.string import kebab_case
from fluxviz._compat import iteritems, iterkeys, itervalues
from fluxviz.tree import Node as TreeNode
from fluxviz.log import get_logger

logger = get_logger()

# cache package information
_INFO_DICT = dict()
# cache dependency trees
_TREE_DICT = dict()


def _build_packages_info_dict(packages, pip_exec=None):
    details = _get_pip_info(*packages, pip_exec=pip_exec)

    requirements = []

    for name, detail in iteritems(details):
        if not name in _INFO_DICT:
            _INFO_DICT[name] = dict({
                "version":
                detail["version"],
Пример #3
0
from fluxviz.commands.helper import (get_registry_from_requirements,
                                     get_registry_from_pip, update_pip,
                                     update_pipfile, update_registry,
                                     _DEPENDENCY_FORMATS)
from fluxviz.model import Project
from fluxviz.model.project import get_included_requirements
from fluxviz.commands.util import cli_format
from fluxviz.util.array import flatten, sequencify
from fluxviz.util.system import (read, write, touch, popen, which, environment)
from fluxviz.util.environ import getenvvar
from fluxviz.util.datetime import get_timestamp_str
from fluxviz import (_pip, request as req, cli, log, parallel)
from fluxviz._compat import builtins
from fluxviz.__attr__ import __name__

logger = log.get_logger(level=log.DEBUG)


@cli.command
def command(packages=[],
            pip_path=[],
            requirements=[],
            pipfile=[],
            project=None,
            pull_request=False,
            git_username=None,
            git_email=None,
            github_access_token=None,
            github_reponame=None,
            github_username=None,
            target_branch="master",