Skip to content

Nix: support usage as library  #1078

Open
@vlaci

Description

@vlaci

Unblob is currently built using pkgs.python3.buildPythonApplication which provides CLI scripts to execute unblob. It however does not expose unblob as a python package, so it cannot be imported from an interpreter. For library usage, it should use pkgs.python3.builtPythonPackage. This part of the refactor is easy to make, but how would unblob has access to extractors when used as a library?

Currently, we wrap the unblob CLI using makeWrapper, where we add dependencies to PATH, so Python will pick them up when executed. We cannot really do this for the library use-case.

My idea is to add a "config file", where path to extractors could be easily set, and generate it from the Nix derivation. Alternatively, we could also just replace each Command("bin") invocation using string replacement, but it sounds waay too brittle for my taste.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions