about summary refs log tree commit diff
path: root/pkgs/development/python-modules/textile/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/textile/default.nix')
-rw-r--r--pkgs/development/python-modules/textile/default.nix57
1 files changed, 33 insertions, 24 deletions
diff --git a/pkgs/development/python-modules/textile/default.nix b/pkgs/development/python-modules/textile/default.nix
index 01686e4fc2ac..09e83fa1caeb 100644
--- a/pkgs/development/python-modules/textile/default.nix
+++ b/pkgs/development/python-modules/textile/default.nix
@@ -1,49 +1,58 @@
-{ lib
-, buildPythonPackage
-, fetchFromGitHub
-, html5lib
-, pytestCheckHook
-, pythonOlder
-, regex
+{
+  lib,
+  buildPythonPackage,
+  fetchFromGitHub,
+  nh3,
+  pillow,
+  pytest-cov-stub,
+  pytestCheckHook,
+  pythonOlder,
+  regex,
+  setuptools-scm,
+  setuptools,
 }:
 
 buildPythonPackage rec {
   pname = "textile";
-  version = "4.0.2";
-  format = "setuptools";
+  version = "4.0.3";
+  pyproject = true;
 
-  disabled = pythonOlder "3.7";
+  disabled = pythonOlder "3.8";
 
   src = fetchFromGitHub {
-    owner = pname;
+    owner = "textile";
     repo = "python-textile";
-    rev = version;
-    hash = "sha256-WwX7h07Bq8sNsViHwmfhrrqleXacmrIY4ZBBaP2kKnI=";
+    rev = "refs/tags/${version}";
+    hash = "sha256-KVDppsvX48loV9OJ70yqmQ5ZSypzcxrjH1j31DcyfM8=";
   };
 
-  propagatedBuildInputs = [
-    html5lib
+  build-system = [
+    setuptools
+    setuptools-scm
+  ];
+
+  dependencies = [
+    nh3
     regex
   ];
 
+  optional-dependencies = {
+    imagesize = [ pillow ];
+  };
+
   nativeCheckInputs = [
+    pytest-cov-stub
     pytestCheckHook
   ];
 
-  postPatch = ''
-    substituteInPlace pytest.ini \
-      --replace " --cov=textile --cov-report=html --cov-append --cov-report=term-missing" ""
-  '';
-
-  pythonImportsCheck = [
-    "textile"
-  ];
+  pythonImportsCheck = [ "textile" ];
 
   meta = with lib; {
     description = "MOdule for generating web text";
-    mainProgram = "pytextile";
     homepage = "https://github.com/textile/python-textile";
+    changelog = "https://github.com/textile/python-textile/blob/${version}/CHANGELOG.textile";
     license = licenses.bsd3;
     maintainers = with maintainers; [ fab ];
+    mainProgram = "pytextile";
   };
 }