How to use the zipp.Path function in zipp

To help you get started, we’ve selected a few zipp 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 dropbox / dbx_build_tools / pip / pytest / main.py View on Github external
def __init__(self, *args):  # type: ignore[no-untyped-def]
        self.root = self

    def namelist(self):  # type: ignore[no-untyped-def]
        return []


import zipp  # type: ignore[import]

zippPath = zipp.Path
zipp.Path = FakeZipPath

from importlib_metadata import FastPath  # type: ignore[import]

FastPath.zip_children = lambda _: []
zipp.Path = zippPath

import os
import pytest

__file__ = "py.test"
sys.argv[0] = sys.argv[0].replace("main.py", "py.test")

code = pytest.main()
sys.stdout.flush()
sys.stderr.flush()

if stop_profiling:
    stop_profiling()

os._exit(code)
github dropbox / dbx_build_tools / pip / pytest / main.py View on Github external
# Thus we first must no-op `zipp` to make the importlib_metadata import behave,
# then we can properly neuter importlib_metadata and restore `zipp` support.
#
# Once we fully switch to Py3 and use importlib.metadata from stdlib, this can
# be simplifed as the __version__ complications will be moot.
class FakeZipPath(object):
    def __init__(self, *args):  # type: ignore[no-untyped-def]
        self.root = self

    def namelist(self):  # type: ignore[no-untyped-def]
        return []


import zipp  # type: ignore[import]

zippPath = zipp.Path
zipp.Path = FakeZipPath

from importlib_metadata import FastPath  # type: ignore[import]

FastPath.zip_children = lambda _: []
zipp.Path = zippPath

import os
import pytest

__file__ = "py.test"
sys.argv[0] = sys.argv[0].replace("main.py", "py.test")

code = pytest.main()
sys.stdout.flush()
sys.stderr.flush()
github dropbox / dbx_build_tools / pip / pytest / main.py View on Github external
# then we can properly neuter importlib_metadata and restore `zipp` support.
#
# Once we fully switch to Py3 and use importlib.metadata from stdlib, this can
# be simplifed as the __version__ complications will be moot.
class FakeZipPath(object):
    def __init__(self, *args):  # type: ignore[no-untyped-def]
        self.root = self

    def namelist(self):  # type: ignore[no-untyped-def]
        return []


import zipp  # type: ignore[import]

zippPath = zipp.Path
zipp.Path = FakeZipPath

from importlib_metadata import FastPath  # type: ignore[import]

FastPath.zip_children = lambda _: []
zipp.Path = zippPath

import os
import pytest

__file__ = "py.test"
sys.argv[0] = sys.argv[0].replace("main.py", "py.test")

code = pytest.main()
sys.stdout.flush()
sys.stderr.flush()

zipp

Backport of pathlib-compatible object wrapper for zip files

MIT
Latest version published 12 days ago

Package Health Score

85 / 100
Full package analysis

Popular zipp functions