Python zipfile.Path() Examples

The following are 7 code examples of zipfile.Path(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module zipfile , or try the search function .
Example #1
Source File: meta.py    From pep517 with MIT License 5 votes vote down vote up
def load(root):
    """
    Given a source directory (root) of a package,
    return an importlib.metadata.Distribution object
    with metadata build from that package.
    """
    root = os.path.expanduser(root)
    system = compat_system(root)
    builder = functools.partial(build, source_dir=root, system=system)
    path = Path(build_as_zip(builder))
    return imp_meta.PathDistribution(path) 
Example #2
Source File: meta.py    From pex with Apache License 2.0 5 votes vote down vote up
def load(root):
    """
    Given a source directory (root) of a package,
    return an importlib.metadata.Distribution object
    with metadata build from that package.
    """
    root = os.path.expanduser(root)
    system = compat_system(root)
    builder = functools.partial(build, source_dir=root, system=system)
    path = Path(build_as_zip(builder))
    return imp_meta.PathDistribution(path) 
Example #3
Source File: meta.py    From pipenv with MIT License 5 votes vote down vote up
def load(root):
    """
    Given a source directory (root) of a package,
    return an importlib.metadata.Distribution object
    with metadata build from that package.
    """
    root = os.path.expanduser(root)
    system = compat_system(root)
    builder = functools.partial(build, source_dir=root, system=system)
    path = Path(build_as_zip(builder))
    return imp_meta.PathDistribution(path) 
Example #4
Source File: meta.py    From pipenv with MIT License 5 votes vote down vote up
def load(root):
    """
    Given a source directory (root) of a package,
    return an importlib.metadata.Distribution object
    with metadata build from that package.
    """
    root = os.path.expanduser(root)
    system = compat_system(root)
    builder = functools.partial(build, source_dir=root, system=system)
    path = Path(build_as_zip(builder))
    return imp_meta.PathDistribution(path) 
Example #5
Source File: ferc714.py    From pudl with MIT License 5 votes vote down vote up
def _get_zpath(pudl_table, pudl_settings):
    """Given a table and pudl_settings, return a Path to the requested file."""
    return zipfile.Path(
        pathlib.Path(pudl_settings["data_dir"],
                     "local/ferc714/ferc714.zip"),
        TABLE_FNAME[pudl_table]
    ) 
Example #6
Source File: meta.py    From rules_pip with MIT License 5 votes vote down vote up
def load(root):
    """
    Given a source directory (root) of a package,
    return an importlib.metadata.Distribution object
    with metadata build from that package.
    """
    root = os.path.expanduser(root)
    system = compat_system(root)
    builder = functools.partial(build, source_dir=root, system=system)
    path = Path(build_as_zip(builder))
    return imp_meta.PathDistribution(path) 
Example #7
Source File: meta.py    From CogAlg with MIT License 5 votes vote down vote up
def load(root):
    """
    Given a source directory (root) of a package,
    return an importlib.metadata.Distribution object
    with metadata build from that package.
    """
    root = os.path.expanduser(root)
    system = compat_system(root)
    builder = functools.partial(build, source_dir=root, system=system)
    path = Path(build_as_zip(builder))
    return imp_meta.PathDistribution(path)