2018-09-12 22:40:11 +00:00
|
|
|
{ stdenv, fetchFromGitHub, python3Packages, glibcLocales, fetchpatch }:
|
2017-12-31 12:50:17 +00:00
|
|
|
|
2018-02-25 01:38:59 +00:00
|
|
|
with python3Packages;
|
2017-12-31 12:50:17 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2018-02-25 01:38:59 +00:00
|
|
|
pname = "mitmproxy";
|
2020-04-17 20:18:59 +00:00
|
|
|
version = "5.1.1";
|
2017-01-04 08:18:04 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2018-02-25 01:38:59 +00:00
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2020-04-17 20:18:59 +00:00
|
|
|
sha256 = "1lirlckpvd3c6s6q3p32w4k4yfna5mlgr1x9g39lhzzq0sdiz3lk";
|
2017-01-04 08:18:04 +00:00
|
|
|
};
|
|
|
|
|
2018-02-25 01:38:59 +00:00
|
|
|
postPatch = ''
|
|
|
|
# remove dependency constraints
|
|
|
|
sed 's/>=\([0-9]\.\?\)\+\( \?, \?<\([0-9]\.\?\)\+\)\?//' -i setup.py
|
|
|
|
'';
|
|
|
|
|
2018-06-11 00:31:06 +00:00
|
|
|
doCheck = (!stdenv.isDarwin);
|
|
|
|
|
2019-11-17 06:13:38 +00:00
|
|
|
# examples.complex.xss_scanner doesn't import correctly with pytest5
|
2017-08-28 06:27:59 +00:00
|
|
|
checkPhase = ''
|
|
|
|
export HOME=$(mktemp -d)
|
2018-02-25 01:38:59 +00:00
|
|
|
export LC_CTYPE=en_US.UTF-8
|
2019-11-17 06:13:38 +00:00
|
|
|
pytest --ignore test/examples \
|
|
|
|
-k 'not test_find_unclaimed_URLs and not test_tcp'
|
2017-08-28 06:27:59 +00:00
|
|
|
'';
|
|
|
|
|
2017-12-31 12:50:17 +00:00
|
|
|
propagatedBuildInputs = [
|
2020-04-17 20:18:59 +00:00
|
|
|
blinker brotli certifi cffi
|
|
|
|
click cryptography flask h11
|
|
|
|
h2 hpack hyperframe itsdangerous
|
|
|
|
jinja2 kaitaistruct ldap3 markupsafe
|
|
|
|
passlib protobuf publicsuffix2 pyasn1
|
|
|
|
pycparser pyopenssl pyparsing pyperclip
|
|
|
|
ruamel_yaml setuptools six sortedcontainers
|
|
|
|
tornado urwid werkzeug wsproto zstandard
|
2017-01-04 08:18:04 +00:00
|
|
|
];
|
|
|
|
|
2018-04-06 12:45:56 +00:00
|
|
|
checkInputs = [
|
2018-02-25 01:38:59 +00:00
|
|
|
beautifulsoup4 flask pytest
|
2018-04-06 12:45:56 +00:00
|
|
|
requests glibcLocales
|
2018-09-12 22:40:11 +00:00
|
|
|
asynctest parver pytest-asyncio
|
2020-04-17 20:18:59 +00:00
|
|
|
hypothesis
|
2017-08-28 06:27:59 +00:00
|
|
|
];
|
2017-01-04 08:18:04 +00:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Man-in-the-middle proxy";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://mitmproxy.org/";
|
2018-02-25 01:38:59 +00:00
|
|
|
license = licenses.mit;
|
2017-10-04 12:03:13 +00:00
|
|
|
maintainers = with maintainers; [ fpletz kamilchm ];
|
2017-01-04 08:18:04 +00:00
|
|
|
};
|
|
|
|
}
|