summary refs log tree commit diff
path: root/pkgs/development/python-modules/docx2python/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/docx2python/default.nix')
-rw-r--r--pkgs/development/python-modules/docx2python/default.nix37
1 files changed, 25 insertions, 12 deletions
diff --git a/pkgs/development/python-modules/docx2python/default.nix b/pkgs/development/python-modules/docx2python/default.nix
index 13b41949ebe..f65f4f7c907 100644
--- a/pkgs/development/python-modules/docx2python/default.nix
+++ b/pkgs/development/python-modules/docx2python/default.nix
@@ -1,29 +1,42 @@
-{ lib, buildPythonPackage, fetchFromGitHub, pytestCheckHook }:
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, pythonOlder
+, poetry-core
+, lxml
+, pytestCheckHook
+}:
 
 buildPythonPackage rec {
   pname = "docx2python";
-  version = "unstable-2020-11-15";
+  version = "2.11.0";
+  pyproject = true;
+
+  disabled = pythonOlder "3.8";
 
-  # Pypi does not contain tests
   src = fetchFromGitHub {
     owner = "ShayHill";
-    repo = pname;
-    rev = "21b2edafc0a01a6cfb73aefc61747a65917e2cad";
-    sha256 = "1nwg17ziwm9a2x7yxsscj8zgc1d383ifsk5w7qa2fws6gf627kyi";
+    repo = "docx2python";
+    rev = "refs/tags/${version}";
+    hash = "sha256-SavRYnNbESRQh9Elk8qCt/qdI2x+sYZJFMYy+Gojg2k=";
   };
 
-  preCheck = "cd test"; # Tests require the `test/resources` folder to be accessible
-  nativeCheckInputs = [ pytestCheckHook ];
-  disabledTests = [ # asserts related to file deletions fail
-    "test_docx2python.py"
-    "test_docx_context.py"
-    "test_google_docs.py"
+  nativeBuildInputs = [
+    poetry-core
+  ];
+
+  propagatedBuildInputs = [
+    lxml
   ];
+
+  nativeCheckInputs = [ pytestCheckHook ];
+
   pythonImportsCheck = [ "docx2python" ];
 
   meta = with lib; {
     homepage = "https://github.com/ShayHill/docx2python";
     description = "Extract docx headers, footers, (formatted) text, footnotes, endnotes, properties, and images";
+    changelog = "https://github.com/ShayHill/docx2python/blob/${src.rev}/CHANGELOG.md";
     maintainers = [ maintainers.ivar ];
     license = licenses.mit;
   };