3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/python-modules/mocket/default.nix

45 lines
1.1 KiB
Nix
Raw Normal View History

2020-08-17 13:39:58 +01:00
{ lib, buildPythonPackage, fetchPypi, pythonOlder, isPy27
, decorator
2020-09-22 01:39:57 +01:00
, http-parser
2020-08-17 13:39:58 +01:00
, importlib-metadata
, python
, python_magic
, six
, urllib3 }:
buildPythonPackage rec {
pname = "mocket";
version = "3.9.4";
2020-08-17 13:39:58 +01:00
src = fetchPypi {
inherit pname version;
sha256 = "0b3nx8qa66isfl7rm3ljgxflr087qwabnf0a2xa1l5s28rikfj04";
2020-08-17 13:39:58 +01:00
};
patchPhase = ''
2020-11-18 02:41:12 +00:00
sed -iE "s,python-magic==.*,python-magic," requirements.txt
sed -iE "s,urllib3==.*,urllib3," requirements.txt
2020-08-17 13:39:58 +01:00
substituteInPlace setup.py --replace 'setup_requires=["pipenv"]' "setup_requires=[]"
'';
propagatedBuildInputs = [
decorator
2020-09-22 01:39:57 +01:00
http-parser
2020-08-17 13:39:58 +01:00
python_magic
urllib3
six
] ++ lib.optionals (isPy27) [ six ];
# Pypi has no runtests.py, github has no requirements.txt. No way to test, no way to install.
doCheck = false;
pythonImportsCheck = [ "mocket" ];
meta = with lib; {
description = "A socket mock framework - for all kinds of socket animals, web-clients included";
homepage = "https://github.com/mindflayer/python-mocket";
license = licenses.bsd3;
maintainers = with maintainers; [ hexa ];
};
}