From 07b3154972fe2d1870e658022a83cdb27efe0b93 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 23 Sep 2022 09:21:41 +0200 Subject: [PATCH] python39Packages.arabic-reshaper: disable on older Python releases - add license - run tests - update pname --- .../arabic-reshaper/default.nix | 46 ++++++++++++++----- 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/pkgs/development/python-modules/arabic-reshaper/default.nix b/pkgs/development/python-modules/arabic-reshaper/default.nix index 34f1dbc17643..de1ea1c190d7 100644 --- a/pkgs/development/python-modules/arabic-reshaper/default.nix +++ b/pkgs/development/python-modules/arabic-reshaper/default.nix @@ -1,26 +1,48 @@ -{ lib, buildPythonPackage, fetchPypi, future, configparser, isPy27 }: +{ lib +, buildPythonPackage +, fetchFromGitHub +, fonttools +, future +, pytestCheckHook +, pythonOlder +}: buildPythonPackage rec { - pname = "arabic_reshaper"; + pname = "arabic-reshaper"; version = "2.1.4"; + format = "setuptools"; - src = fetchPypi { - inherit pname version; - sha256 = "sha256-6Es7Ctjq45VkHJTTAQtTv+0sKxq4DyXrjNwBAZ3fZCY="; + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "mpcabd"; + repo = "python-arabic-reshaper"; + rev = "v${version}"; + hash = "sha256-qQGIC/KequOQZoxwm7AEkdPV0QpS7YoBV9v8ZA7AYQM="; }; - propagatedBuildInputs = [ future ] - ++ lib.optionals isPy27 [ configparser ]; + propagatedBuildInputs = [ + future + ]; - # Tests are not published on pypi - doCheck = false; + passthru.optional-dependencies = { + with-fonttools = [ + fonttools + ]; + }; - pythonImportsCheck = [ "arabic_reshaper" ]; + checkInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "arabic_reshaper" + ]; meta = with lib; { - homepage = "https://github.com/mpcabd/python-arabic-reshaper"; description = "Reconstruct Arabic sentences to be used in applications that don't support Arabic"; - platforms = platforms.unix; + homepage = "https://github.com/mpcabd/python-arabic-reshaper"; + license = with licenses; [ mit ]; maintainers = with maintainers; [ freezeboy ]; }; }