diff options
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/pilkit/default.nix')
-rw-r--r-- | nixpkgs/pkgs/development/python-modules/pilkit/default.nix | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/pilkit/default.nix b/nixpkgs/pkgs/development/python-modules/pilkit/default.nix new file mode 100644 index 000000000000..76f6238349a5 --- /dev/null +++ b/nixpkgs/pkgs/development/python-modules/pilkit/default.nix @@ -0,0 +1,55 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, mock +, pillow +, pytestCheckHook +, pythonOlder +, setuptools +}: + +buildPythonPackage rec { + pname = "pilkit"; + version = "3.0"; + pyproject = true; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "matthewwithanm"; + repo = pname; + rev = "refs/tags/${version}"; + hash = "sha256-NmD9PFCkz3lz4AnGoQUpkt35q0zvDVm+kx7lVDFBcHk="; + }; + + nativeBuildInputs = [ + setuptools + ]; + + propagatedBuildInputs = [ + pillow + ]; + + nativeCheckInputs = [ + mock + pytestCheckHook + ]; + + postPatch = '' + substituteInPlace tox.ini \ + --replace " --cov --cov-report term-missing:skip-covered" "" + substituteInPlace pilkit/processors/resize.py \ + --replace "Image.ANTIALIAS" "Image.Resampling.LANCZOS" + ''; + + pythonImportsCheck = [ + "pilkit" + ]; + + meta = with lib; { + description = "A collection of utilities and processors for the Python Imaging Library"; + homepage = "https://github.com/matthewwithanm/pilkit/"; + license = licenses.bsd3; + maintainers = with maintainers; [ domenkozar ]; + }; +} |