How to use the shiv.builder.create_archive function in shiv

To help you get started, we’ve selected a few shiv 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 linkedin / shiv / test / test_builder.py View on Github external
def test_archive_permissions(self, sp, env):
        with tempfile.TemporaryDirectory() as tmpdir:
            target = Path(tmpdir, "test.zip")
            create_archive(sp, target, sys.executable, "code:interact", env)

            assert target.stat().st_mode & UGOX == UGOX
github linkedin / shiv / test / test_builder.py View on Github external
def test_create_archive(self, sp, env):
        with tempfile.TemporaryDirectory() as tmpdir:
            target = Path(tmpdir, "test.zip")

            # create an archive
            create_archive(sp, target, sys.executable, "code:interact", env)

            # create one again (to ensure we overwrite)
            create_archive(sp, target, sys.executable, "code:interact", env)

            assert zipfile.is_zipfile(str(target))

            with pytest.raises(ZipAppError):
                create_archive(sp, target, sys.executable, "alsjdbas,,,", env)
github linkedin / shiv / test / test_builder.py View on Github external
def test_create_archive(self, sp, env):
        with tempfile.TemporaryDirectory() as tmpdir:
            target = Path(tmpdir, "test.zip")

            # create an archive
            create_archive(sp, target, sys.executable, "code:interact", env)

            # create one again (to ensure we overwrite)
            create_archive(sp, target, sys.executable, "code:interact", env)

            assert zipfile.is_zipfile(str(target))

            with pytest.raises(ZipAppError):
                create_archive(sp, target, sys.executable, "alsjdbas,,,", env)