diff --git a/pkgs/development/python-modules/supervise-api/default.nix b/pkgs/development/python-modules/supervise-api/default.nix new file mode 100644 index 000000000000..3bd223127a7d --- /dev/null +++ b/pkgs/development/python-modules/supervise-api/default.nix @@ -0,0 +1,45 @@ +{ lib +, buildPythonPackage +, fetchPypi +, substituteAll +, supervise +, setuptools +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "supervise-api"; + version = "0.6.0"; + pyproject = true; + + src = fetchPypi { + pname = "supervise_api"; + inherit version; + hash = "sha256-EjD0IpSRDoNCG307CKlo0n1RCkpwnpZlB+1w212hud4="; + }; + + postPatch = '' + substituteInPlace supervise_api/supervise.py \ + --replace 'which("supervise")' '"${supervise}/bin/supervise"' + ''; + + nativeBuildInputs = [ + setuptools + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "supervise_api" + ]; + + meta = { + description = "An API for running processes safely and securely"; + homepage = "https://github.com/catern/supervise"; + license = lib.licenses.mit; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ catern ]; + }; +} diff --git a/pkgs/development/python-modules/supervise_api/default.nix b/pkgs/development/python-modules/supervise_api/default.nix deleted file mode 100644 index 7d4c7f4e3f8b..000000000000 --- a/pkgs/development/python-modules/supervise_api/default.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ lib -, buildPythonPackage -, fetchPypi -, substituteAll -, supervise -, isPy3k -, whichcraft -, util-linux -}: - -buildPythonPackage rec { - pname = "supervise_api"; - version = "0.6.0"; - - src = fetchPypi { - inherit pname version; - sha256 = "1230f42294910e83421b7d3b08a968d27d510a4a709e966507ed70db5da1b9de"; - }; - - patches = [ - (substituteAll { - src = ./supervise-path.patch; - inherit supervise; - }) - ]; - - # In the git repo, supervise_api lives inside a python subdir - patchFlags = [ "-p2" ]; - - propagatedBuildInputs = lib.optional (!isPy3k) whichcraft; - - nativeCheckInputs = [ util-linux ]; - - meta = { - description = "An API for running processes safely and securely"; - homepage = "https://github.com/catern/supervise"; - license = lib.licenses.lgpl3; - maintainers = with lib.maintainers; [ catern ]; - }; -} diff --git a/pkgs/development/python-modules/supervise_api/supervise-path.patch b/pkgs/development/python-modules/supervise_api/supervise-path.patch deleted file mode 100644 index c5538ddc26e2..000000000000 --- a/pkgs/development/python-modules/supervise_api/supervise-path.patch +++ /dev/null @@ -1,15 +0,0 @@ -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(): diff --git a/pkgs/top-level/python-aliases.nix b/pkgs/top-level/python-aliases.nix index 7ef7f6ffbc8e..3672a9439be6 100644 --- a/pkgs/top-level/python-aliases.nix +++ b/pkgs/top-level/python-aliases.nix @@ -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 diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index a19ab106cbf6..b69f5ec2fd41 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -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 { };