1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 pytestCheckHook,
6 pythonAtLeast,
7 pythonOlder,
8}:
9
10buildPythonPackage rec {
11 pname = "w3lib";
12 version = "2.1.2";
13 format = "setuptools";
14
15 disabled = pythonOlder "3.7";
16
17 src = fetchPypi {
18 inherit pname version;
19 hash = "sha256-7Vt06ZfuoqvjwTIfkW40QUTujpBypvM0Y+6OV/hYpLE=";
20 };
21
22 nativeCheckInputs = [ pytestCheckHook ];
23
24 pythonImportsCheck = [ "w3lib" ];
25
26 disabledTests = lib.optionals (pythonAtLeast "3.11") [
27 # regressed on Python 3.11.4
28 # https://github.com/scrapy/w3lib/issues/212
29 "test_safe_url_string_url"
30 ];
31
32 meta = with lib; {
33 description = "Library of web-related functions";
34 homepage = "https://github.com/scrapy/w3lib";
35 changelog = "https://github.com/scrapy/w3lib/blob/v${version}/NEWS";
36 license = licenses.bsd3;
37 maintainers = with maintainers; [ ];
38 };
39}