Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 30 additions & 4 deletions pkgs/development/python-modules/mitmproxy/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
certifi,
cryptography,
fetchFromGitHub,
fetchPypi,
flask,
h11,
h2,
Expand All @@ -24,9 +25,11 @@
pyparsing,
pyperclip,
pytest-asyncio,
pytest-cov-stub,
pytest-timeout,
pytest-xdist,
pytestCheckHook,
pythonRelaxDepsHook,
requests,
ruamel-yaml,
setuptools,
Expand All @@ -37,6 +40,18 @@
zstandard,
}:

let
# Workaround for https://github.com/mitmproxy/mitmproxy/pull/7953
# nixpkgs' aioquic was updated to 1.3.0, which contains breaking changes that are unpatched in mitmproxy as of right now
aioquic' = aioquic.overrideAttrs (old: rec {
version = "1.2.0";
src = fetchPypi {
pname = "aioquic";
inherit version;
hash = "sha256-+RJjuz9xlIxciRW01Q7jcABPIKQW9n+rPcyQVWx+cZk=";
};
});
in
buildPythonPackage rec {
pname = "mitmproxy";
version = "12.2.1";
Expand All @@ -50,19 +65,23 @@ buildPythonPackage rec {
};

pythonRelaxDeps = [
"urwid"
"zstandard"

# requested by maintainer
"brotli"
# just keep those
"typing-extensions"

"urwid"
"asgiref"
"pyparsing"
"ruamel.yaml"
"tornado"
"wsproto"
];

build-system = [ setuptools ];

dependencies = [
aioquic
aioquic'
argon2-cffi
asgiref
brotli
Expand Down Expand Up @@ -92,6 +111,7 @@ buildPythonPackage rec {
nativeCheckInputs = [
hypothesis
pytest-asyncio
pytest-cov-stub
pytest-timeout
pytest-xdist
pytestCheckHook
Expand All @@ -100,6 +120,12 @@ buildPythonPackage rec {

__darwinAllowLocalNetworking = true;

postPatch = ''
# Rename to fix pytest exception
substituteInPlace pyproject.toml \
--replace-warn "[tool.pytest.individual_coverage]" "[tool.mitmproxy.individual_coverage]"
'';

preCheck = ''
export HOME=$(mktemp -d)
'';
Expand Down
Loading