From 2644f7e83c3e97ce973b95c2ae1e7ceff5a336bf Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Mon, 12 Sep 2022 21:34:36 +0200 Subject: [PATCH] python3Packages.pyunpack: init at 0.3 --- .../python-modules/pyunpack/default.nix | 58 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 60 insertions(+) create mode 100644 pkgs/development/python-modules/pyunpack/default.nix diff --git a/pkgs/development/python-modules/pyunpack/default.nix b/pkgs/development/python-modules/pyunpack/default.nix new file mode 100644 index 000000000000..b6dff5a97d03 --- /dev/null +++ b/pkgs/development/python-modules/pyunpack/default.nix @@ -0,0 +1,58 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pytestCheckHook +, easyprocess +, entrypoint2 +, patool +}: + +buildPythonPackage rec { + pname = "pyunpack"; + version = "0.3"; + format = "setuptools"; + + src = fetchFromGitHub { + owner = "ponty"; + repo = "pyunpack"; + rev = "refs/tags/${version}"; + hash = "sha256-1MAdiX6+u35f6S8a0ZcIIebZE8bbxTy+0TnMohJ7J6s="; + }; + + postPatch = '' + substituteInPlace pyunpack/__init__.py \ + --replace \ + '_exepath("patool")' \ + '"${patool}/bin/.patool-wrapped"' + ''; + + propagatedBuildInputs = [ + easyprocess + entrypoint2 + ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + pytestFlagsArray = [ "-x" ]; + + pythonImportsCheck = [ "pyunpack" ]; + + disabledTestPaths = [ + # unfree + "tests/test_rar.py" + + # We get "patool: error: unrecognized arguments: --password 123" + # The currently packaged version of patool does not support this flag. + # https://github.com/wummel/patool/issues/114 + # FIXME: Re-enable these once patool is updated + "tests/test_rarpw.py" + "tests/test_zippw.py" + ]; + + meta = with lib; { + description = "Unpack archive files in python"; + homepage = "https://github.com/ponty/pyunpack"; + license = licenses.bsd2; + maintainers = with maintainers; [ pbsds ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 88286da2d169..e052bf5411d1 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8193,6 +8193,8 @@ self: super: with self; { pyuca = callPackage ../development/python-modules/pyuca { }; + pyunpack = callPackage ../development/python-modules/pyunpack { }; + pyutil = callPackage ../development/python-modules/pyutil { }; pyzbar = callPackage ../development/python-modules/pyzbar { };