2021-06-04 09:07:49 +00:00
|
|
|
{ lib
|
|
|
|
, beautifulsoup4
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, lxml
|
|
|
|
, pytest-httpbin
|
|
|
|
, pytest-mock
|
|
|
|
, pytestCheckHook
|
2022-09-22 12:36:57 +00:00
|
|
|
, pythonOlder
|
2021-06-04 09:07:49 +00:00
|
|
|
, requests
|
|
|
|
, requests-mock
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "mechanicalsoup";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "1.3.0";
|
2022-09-22 12:36:57 +00:00
|
|
|
format = "setuptools";
|
2021-06-04 09:07:49 +00:00
|
|
|
|
2022-09-22 12:36:57 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2021-06-04 09:07:49 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "MechanicalSoup";
|
|
|
|
repo = "MechanicalSoup";
|
2023-07-15 17:15:38 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-iZ2nwBxikf0cTTlxzcGvHJim4N6ZEqIhlK7t1WAYdms=";
|
2021-06-04 09:07:49 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
postPatch = ''
|
|
|
|
# Is in setup_requires but not used in setup.py
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "'pytest-runner'" ""
|
|
|
|
substituteInPlace setup.cfg \
|
|
|
|
--replace " --cov --cov-config .coveragerc --flake8" ""
|
|
|
|
'';
|
|
|
|
|
2021-06-04 09:07:49 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
beautifulsoup4
|
|
|
|
lxml
|
|
|
|
requests
|
|
|
|
];
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-06-04 09:07:49 +00:00
|
|
|
pytest-httpbin
|
|
|
|
pytest-mock
|
|
|
|
pytestCheckHook
|
|
|
|
requests-mock
|
|
|
|
];
|
|
|
|
|
2022-09-22 12:36:57 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"mechanicalsoup"
|
|
|
|
];
|
2021-06-04 09:07:49 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python library for automating interaction with websites";
|
|
|
|
homepage = "https://github.com/hickford/MechanicalSoup";
|
2023-07-15 17:15:38 +00:00
|
|
|
changelog = "https://github.com/MechanicalSoup/MechanicalSoup/releases/tag/v${version}";
|
2021-06-04 09:07:49 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ jgillich fab ];
|
|
|
|
};
|
|
|
|
}
|