Module refinery.lib.shared

Shared dependencies. Each shared dependency is stored in a submodule.

Expand source code Browse git
"""
Shared dependencies. Each shared dependency is stored in a submodule.
"""
from __future__ import annotations

from typing import Callable, Collection

from refinery.lib.dependencies import LazyDependency, Mod
from refinery.units import Unit


class GlobalDependenciesDummy(Unit, abstract=True):
    """
    The sole purpose of this unit is to collect shared dependencies.
    """


def dependency(name: str, dist: Collection[str] = (), more: str | None = None):
    """
    This decorator is used to install a shared dependency.
    """
    def decorator(imp: Callable[[], Mod]):
        dep = LazyDependency(imp, name, dist, more)
        dep.register(GlobalDependenciesDummy)
        return dep()
    return decorator

Sub-modules

refinery.lib.shared.capstone
refinery.lib.shared.decompyle3
refinery.lib.shared.icicle
refinery.lib.shared.orjson
refinery.lib.shared.pefile
refinery.lib.shared.pyppmd
refinery.lib.shared.pyzstd
refinery.lib.shared.smda
refinery.lib.shared.speakeasy
refinery.lib.shared.uncompyle6
refinery.lib.shared.unicorn
refinery.lib.shared.xdis

Functions

def dependency(name, dist=(), more=None)

This decorator is used to install a shared dependency.

Expand source code Browse git
def dependency(name: str, dist: Collection[str] = (), more: str | None = None):
    """
    This decorator is used to install a shared dependency.
    """
    def decorator(imp: Callable[[], Mod]):
        dep = LazyDependency(imp, name, dist, more)
        dep.register(GlobalDependenciesDummy)
        return dep()
    return decorator

Classes

class GlobalDependenciesDummy (**keywords)

The sole purpose of this unit is to collect shared dependencies.

Expand source code Browse git
class GlobalDependenciesDummy(Unit, abstract=True):
    """
    The sole purpose of this unit is to collect shared dependencies.
    """

Ancestors

Inherited members