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
12}:
13
14buildPythonPackage rec {
15 pname = "mechanicalsoup";
16 version = "1.2.0";
17 format = "setuptools";
18
19 disabled = pythonOlder "3.7";
20
21 src = fetchFromGitHub {
22 owner = "MechanicalSoup";
23 repo = "MechanicalSoup";
24 rev = "v${version}";
25 hash = "sha256-Q5oDAgAZYYUYqjDByXNXFNVKmRyjzIGVE4LN9j8vk4c=";
26 };
27
28 propagatedBuildInputs = [
29 beautifulsoup4
30 lxml
31 requests
32 ];
33
34 nativeCheckInputs = [
35 pytest-httpbin
36 pytest-mock
37 pytestCheckHook
38 requests-mock
39 ];
40
41 postPatch = ''
42 # Is in setup_requires but not used in setup.py
43 substituteInPlace setup.py \
44 --replace "'pytest-runner'" ""
45 substituteInPlace setup.cfg \
46 --replace " --cov --cov-config .coveragerc --flake8" ""
47 '';
48
49 pythonImportsCheck = [
50 "mechanicalsoup"
51 ];
52
53 meta = with lib; {
54 description = "Python library for automating interaction with websites";
55 homepage = "https://github.com/hickford/MechanicalSoup";
56 license = licenses.mit;
57 maintainers = with maintainers; [ jgillich fab ];
58 };
59}