Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / mechanicalsoup / default.nix
blob93b61a40972d164d261ac73197150e8dedf10c91
1 { lib
2 , beautifulsoup4
3 , buildPythonPackage
4 , fetchFromGitHub
5 , lxml
6 , pytest-httpbin
7 , pytest-mock
8 , pytestCheckHook
9 , pythonOlder
10 , requests
11 , requests-mock
14 buildPythonPackage rec {
15   pname = "mechanicalsoup";
16   version = "1.3.0";
17   format = "setuptools";
19   disabled = pythonOlder "3.7";
21   src = fetchFromGitHub {
22     owner = "MechanicalSoup";
23     repo = "MechanicalSoup";
24     rev = "refs/tags/v${version}";
25     hash = "sha256-iZ2nwBxikf0cTTlxzcGvHJim4N6ZEqIhlK7t1WAYdms=";
26   };
28   postPatch = ''
29     # Is in setup_requires but not used in setup.py
30     substituteInPlace setup.py \
31       --replace "'pytest-runner'" ""
32     substituteInPlace setup.cfg \
33       --replace " --cov --cov-config .coveragerc --flake8" ""
34   '';
36   propagatedBuildInputs = [
37     beautifulsoup4
38     lxml
39     requests
40   ];
42   __darwinAllowLocalNetworking = true;
44   nativeCheckInputs = [
45     pytest-httpbin
46     pytest-mock
47     pytestCheckHook
48     requests-mock
49   ];
51   pythonImportsCheck = [
52     "mechanicalsoup"
53   ];
55   meta = with lib; {
56     description = "Python library for automating interaction with websites";
57     homepage = "https://github.com/hickford/MechanicalSoup";
58     changelog = "https://github.com/MechanicalSoup/MechanicalSoup/releases/tag/v${version}";
59     license = licenses.mit;
60     maintainers = with maintainers; [ jgillich fab ];
61   };