about summary refs log tree commit diff
path: root/pkgs/development/python-modules/xpath-expressions
diff options
context:
space:
mode:
authorFabian Affolter <mail@fabian-affolter.ch>2021-03-31 20:12:48 +0200
committerFabian Affolter <mail@fabian-affolter.ch>2021-03-31 20:12:48 +0200
commit1f1981a74364c54f89bf07bcc294a49de6353660 (patch)
treec0546a434732216fa7a8ab8f2b4023e00e176761 /pkgs/development/python-modules/xpath-expressions
parent63be3d6498de5106aa88dc4bdb54dd806070d8d9 (diff)
python3Packages.xpath-expressions: init at 1.1.0
Diffstat (limited to 'pkgs/development/python-modules/xpath-expressions')
-rw-r--r--pkgs/development/python-modules/xpath-expressions/default.nix46
1 files changed, 46 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/xpath-expressions/default.nix b/pkgs/development/python-modules/xpath-expressions/default.nix
new file mode 100644
index 0000000000000..a7c08ddc0bec8
--- /dev/null
+++ b/pkgs/development/python-modules/xpath-expressions/default.nix
@@ -0,0 +1,46 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, lxml
+, poetry-core
+, pythonOlder
+, pytestCheckHook
+}:
+
+buildPythonPackage rec {
+  pname = "xpath-expressions";
+  version = "1.1.0";
+  disabled = pythonOlder "3.5";
+  format = "pyproject";
+
+  src = fetchFromGitHub {
+    owner = "orf";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0l289iw2zmzxyfi3g2z7b917vmsaz47h5jp871zvykpmpigc632h";
+  };
+
+  nativeBuildInputs = [
+    poetry-core
+  ];
+
+  checkInputs = [
+    lxml
+    pytestCheckHook
+  ];
+
+  postPatch = ''
+    # Was fixed upstream but not released
+    substituteInPlace pyproject.toml \
+      --replace "poetry.masonry.api" "poetry.core.masonry.api"
+  '';
+
+  pythonImportsCheck = [ "xpath" ];
+
+  meta = with lib; {
+    description = "Python module to handle XPath expressions";
+    homepage = "https://github.com/orf/xpath-expressions";
+    license = with licenses; [ mit ];
+    maintainers = with maintainers; [ fab ];
+  };
+}