How to use the johnnydep.pipper.get function in johnnydep

To help you get started, we’ve selected a few johnnydep examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wimglenn / johnnydep / johnnydep / lib.py View on Github external
def _get_info(dist_name, index_url=None, env=None, extra_index_url=None):
    log = logger.bind(dist_name=dist_name)
    tmpdir = tempfile.mkdtemp()
    log.debug("created scratch", tmpdir=tmpdir)
    try:
        with wimpy.working_directory(tmpdir):
            data = pipper.get(
                dist_name,
                index_url=index_url,
                env=env,
                extra_index_url=extra_index_url,
                tmpdir=".",
            )
        dist_path = data["path"]
        # extract any info we may need from downloaded dist right now, so the
        # downloaded file can be cleaned up immediately
        import_names = _discover_import_names(dist_path)
        metadata = _extract_metadata(dist_path)
    finally:
        log.debug("removing scratch", tmpdir=tmpdir)
        shutil.rmtree(tmpdir)
    return import_names, metadata
github wimglenn / johnnydep / johnnydep / lib.py View on Github external
def _best(self):
        return pipper.get(
            self.pinned,
            index_url=self.index_url,
            env=self.env,
            extra_index_url=self.extra_index_url,
        )