summary refs log tree commit diff
path: root/pkgs/development/python-modules/pyaxmlparser
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2018-12-23 22:56:58 +0100
committerMaximilian Bosch <maximilian@mbosch.me>2018-12-23 23:15:36 +0100
commit30c6234e1549a67c931c046620b307bd27aa186a (patch)
tree58e99bc09f17c8e6f81a55efb2b8f70f86f39da1 /pkgs/development/python-modules/pyaxmlparser
parent772759173d362a557a78ad58605579b417a9b08c (diff)
downloadnixpkgs-30c6234e1549a67c931c046620b307bd27aa186a.tar
nixpkgs-30c6234e1549a67c931c046620b307bd27aa186a.tar.gz
nixpkgs-30c6234e1549a67c931c046620b307bd27aa186a.tar.bz2
nixpkgs-30c6234e1549a67c931c046620b307bd27aa186a.tar.lz
nixpkgs-30c6234e1549a67c931c046620b307bd27aa186a.tar.xz
nixpkgs-30c6234e1549a67c931c046620b307bd27aa186a.tar.zst
nixpkgs-30c6234e1549a67c931c046620b307bd27aa186a.zip
python3Packages.pyaxmlparser: fix build
The build is currently broken on master[1] due to a major bump of
`click` in fe0af1ce777abf99a3fd851a86f2000326153207.

Manually patching `setup.py` temporarily fixes the issue. To ensure that
succeeding builds don't deliver packages breaking at runtime due to
dependency issues I switched to the GitHub archive as source since it
contains tests as well.

Additionally, Python 2.7 support has been dropped. It seems as it
was never intended to support Python3 here, I simply forgot to disable
the Python2 build.

```
TypeError: AXMLParser object is not an iterator
```

[1] https://hydra.nixos.org/build/86108813
Diffstat (limited to 'pkgs/development/python-modules/pyaxmlparser')
-rw-r--r--pkgs/development/python-modules/pyaxmlparser/default.nix22
1 files changed, 18 insertions, 4 deletions
diff --git a/pkgs/development/python-modules/pyaxmlparser/default.nix b/pkgs/development/python-modules/pyaxmlparser/default.nix
index 9ea3a3eda07..0721c0d449c 100644
--- a/pkgs/development/python-modules/pyaxmlparser/default.nix
+++ b/pkgs/development/python-modules/pyaxmlparser/default.nix
@@ -1,16 +1,30 @@
-{ buildPythonPackage, stdenv, lxml, click, fetchPypi }:
+{ buildPythonPackage, stdenv, lxml, click, fetchFromGitHub, pytest, isPy3k }:
 
 buildPythonPackage rec {
   version = "0.3.13";
   pname = "pyaxmlparser";
 
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "1mzdrifnaky57vkmdvg0rgjss55xkxaramci3wpv4h65lmk95988";
+  # the PyPI tarball doesn't ship tests.
+  src = fetchFromGitHub {
+    owner = "appknox";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0jfjhxc6b57npsidknxmhj1x813scg47aaw90ybyr90fpdz5rlwk";
   };
 
+  disabled = !isPy3k;
+
+  postPatch = ''
+    substituteInPlace setup.py --replace "click==6.7" "click"
+  '';
+
   propagatedBuildInputs = [ lxml click ];
 
+  checkInputs = [ pytest ];
+  checkPhase = ''
+    py.test tests/
+  '';
+
   meta = with stdenv.lib; {
     description = "Python3 Parser for Android XML file and get Application Name without using Androguard";
     homepage = https://github.com/appknox/pyaxmlparser;