Commit f4158862 authored by Pol Dellaiera's avatar Pol Dellaiera
Browse files

swh: init at 4.0.0

Wrap `swh` application with `writeShellApplication` to avoid exposing internal Python modules.

Using `writeShellApplication` ensures that the underlying Python packages and modules remain hidden.  
`toPythonApplication` could not be used due to infinite recursion issues caused by circular dependencies between Python modules.
parent c10fe0a9
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
{
  python3Packages,
  writeShellApplication,
  withSwhPythonPackages ? [
    python3Packages.swh-auth
    python3Packages.swh-model
    python3Packages.swh-scanner
    python3Packages.swh-web-client
  ],
}:

let
  python3' = python3Packages.python.withPackages (ps: with ps; [ swh-core ] ++ withSwhPythonPackages);
in
writeShellApplication {
  name = "swh";
  text = ''
    ${python3'}/bin/swh "$@"
  '';
  meta = {
    inherit (python3Packages.swh-core.meta) license mainProgram platforms;
    description = "Software Heritage command-line client";
  };
}