2020-08-20 17:08:02 +00:00
|
|
|
{ lib, buildPythonPackage, fetchPypi, pythonOlder, isPy27
|
|
|
|
, decorator
|
2020-09-25 04:45:31 +00:00
|
|
|
, http-parser
|
2020-08-20 17:08:02 +00:00
|
|
|
, importlib-metadata
|
|
|
|
, python
|
|
|
|
, python_magic
|
|
|
|
, six
|
|
|
|
, urllib3 }:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "mocket";
|
2020-11-19 00:13:47 +00:00
|
|
|
version = "3.9.3";
|
2020-08-20 17:08:02 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2020-11-19 00:13:47 +00:00
|
|
|
sha256 = "15npwf0f8g5vmwpmyvmsyi4p9ia1w95z8jips0nkfs978pnjy69g";
|
2020-08-20 17:08:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patchPhase = ''
|
2020-11-19 00:13:47 +00:00
|
|
|
sed -iE "s,python-magic==.*,python-magic," requirements.txt
|
|
|
|
sed -iE "s,urllib3==.*,urllib3," requirements.txt
|
2020-08-20 17:08:02 +00:00
|
|
|
substituteInPlace setup.py --replace 'setup_requires=["pipenv"]' "setup_requires=[]"
|
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
decorator
|
2020-09-25 04:45:31 +00:00
|
|
|
http-parser
|
2020-08-20 17:08:02 +00: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 ];
|
|
|
|
};
|
|
|
|
}
|