nixpkgs/pkgs/development/python-modules/pyaxmlparser/default.nix
Maximilian Bosch 30c6234e15
python3Packages.pyaxmlparser: fix build
The build is currently broken on master[1] due to a major bump of
`click` in fe0af1ce77.

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
2018-12-23 23:15:36 +01:00

35 lines
857 B
Nix

{ buildPythonPackage, stdenv, lxml, click, fetchFromGitHub, pytest, isPy3k }:
buildPythonPackage rec {
version = "0.3.13";
pname = "pyaxmlparser";
# 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;
license = licenses.mit;
maintainers = with maintainers; [ ma27 ];
};
}