2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2024-04-21 15:54:59 +00:00
|
|
|
, fetchpatch2
|
2020-04-24 23:36:52 +00:00
|
|
|
, html5lib
|
2023-11-16 04:20:00 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
, setuptools
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "mechanize";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "0.4.9";
|
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-aaXtsJYvkh6LEINzaMIkLYrQSfC5H/aZzn9gG/xDFSE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch2 {
|
|
|
|
# python 3.11+ compat
|
|
|
|
url = "https://github.com/python-mechanize/mechanize/commit/1324b09b661aaac7d4cdc7e1e9d49e1c3851db2c.patch";
|
|
|
|
hash = "sha256-d0Zuz6m2Uv8pnR8TC0L+AStS82rPPTpQrrjkCZnJliE=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
html5lib
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"mechanize"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTestPaths = [
|
|
|
|
# Tests require network access
|
|
|
|
"test/test_urllib2_localnet.py"
|
|
|
|
"test/test_functional.py"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# Tests require network access
|
|
|
|
"test_pickling"
|
|
|
|
"test_password_manager"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Stateful programmatic web browsing in Python";
|
|
|
|
homepage = "https://github.com/python-mechanize/mechanize";
|
2023-11-16 04:20:00 +00:00
|
|
|
changelog = "https://github.com/python-mechanize/mechanize/blob/v${version}/ChangeLog";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|