Unverified Commit 325960f8 authored by Fabian Affolter's avatar Fabian Affolter Committed by GitHub
Browse files

Merge pull request #260353 from natsukium/supervise-api

python311Packages.supervise-api: rename from supervise_api
parents 9cff5cc8 3f232237
Loading
Loading
Loading
Loading
+45 −0
Original line number Diff line number Diff line
@@ -3,38 +3,43 @@
, fetchPypi
, substituteAll
, supervise
, isPy3k
, whichcraft
, util-linux
, setuptools
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "supervise_api";
  pname = "supervise-api";
  version = "0.6.0";
  pyproject = true;

  src = fetchPypi {
    inherit pname version;
    sha256 = "1230f42294910e83421b7d3b08a968d27d510a4a709e966507ed70db5da1b9de";
    pname = "supervise_api";
    inherit version;
    hash = "sha256-EjD0IpSRDoNCG307CKlo0n1RCkpwnpZlB+1w212hud4=";
  };

  patches = [
    (substituteAll {
      src = ./supervise-path.patch;
      inherit supervise;
    })
  ];
  postPatch = ''
    substituteInPlace supervise_api/supervise.py \
      --replace 'which("supervise")' '"${supervise}/bin/supervise"'
  '';

  # In the git repo, supervise_api lives inside a python subdir
  patchFlags = [ "-p2" ];
  nativeBuildInputs = [
    setuptools
  ];

  propagatedBuildInputs = lib.optional (!isPy3k) whichcraft;
  nativeCheckInputs = [
    pytestCheckHook
  ];

  nativeCheckInputs = [ util-linux ];
  pythonImportsCheck = [
    "supervise_api"
  ];

  meta = {
    description = "An API for running processes safely and securely";
    homepage = "https://github.com/catern/supervise";
    license = lib.licenses.lgpl3;
    license = lib.licenses.mit;
    platforms = lib.platforms.linux;
    maintainers = with lib.maintainers; [ catern ];
  };
}
+0 −15
Original line number Diff line number Diff line
diff --git a/python/supervise_api/supervise.py b/python/supervise_api/supervise.py
index 497d3ea..be57e35 100644
--- a/python/supervise_api/supervise.py
+++ b/python/supervise_api/supervise.py
@@ -41,9 +41,7 @@ try:
 except:
     from whichcraft import which
 
-supervise_utility_location = which("supervise")
-if not supervise_utility_location:
-    raise FileNotFoundError(errno.ENOENT, "Executable not found in PATH", "supervise")
+supervise_utility_location = '@supervise@/bin/supervise'
 
 
 def ignore_sigchld():
+1 −0
Original line number Diff line number Diff line
@@ -383,6 +383,7 @@ mapAliases ({
  SQLAlchemy-ImageAttach = throw "sqlalchemy-imageattach has been removed as it is incompatible with sqlalchemy 1.4 and unmaintained"; # added 2022-04-23
  subdownloader = throw "subdownloader has been removed, because it depended on pyqt4"; # added 2022-06-09
  suds-jurko = throw "suds-jurko has been removed, it was using setuptools 2to3 translation feature, which has been removed in setuptools 58"; # added 2023-02-27
  supervise_api = supervise-api; # added 2023-10-11
  suseapi = throw "suseapi has been removed because it is no longer maintained"; # added 2023-02-27
  tensorflow-bin_2 = tensorflow-bin; # added 2021-11-25
  tensorflow-build_2 = tensorflow-build; # added 2021-11-25
+1 −1
Original line number Diff line number Diff line
@@ -13439,7 +13439,7 @@ self: super: with self; {
  sunweg = callPackage ../development/python-modules/sunweg { };
  supervise_api = callPackage ../development/python-modules/supervise_api { };
  supervise-api = callPackage ../development/python-modules/supervise-api { };
  supervisor = callPackage ../development/python-modules/supervisor { };