1{ lib
2, buildPythonPackage
3, dnspython
4, fetchPypi
5, filelock
6, idna
7, platformdirs
8, pytestCheckHook
9, pythonOlder
10, uritools
11}:
12
13buildPythonPackage rec {
14 pname = "urlextract";
15 version = "1.8.0";
16 format = "setuptools";
17
18 disabled = pythonOlder "3.7";
19
20 src = fetchPypi {
21 inherit pname version;
22 hash = "sha256-NXP2uBKBTv4GykbpHoLZhO2qPNB9qqqilqRnrZiBoDc=";
23 };
24
25 propagatedBuildInputs = [
26 filelock
27 idna
28 platformdirs
29 uritools
30 ];
31
32 nativeCheckInputs = [
33 dnspython
34 pytestCheckHook
35 ];
36
37 disabledTests = [
38 # fails with dns.resolver.NoResolverConfiguration due to network sandboxing
39 "test_check_dns_enabled"
40 "test_check_dns_find_urls"
41 "test_dns_cache_init"
42 "test_dns_cache_negative"
43 "test_dns_cache_reuse"
44 ];
45
46 pythonImportsCheck = [
47 "urlextract"
48 ];
49
50 meta = with lib; {
51 description = "Collects and extracts URLs from given text";
52 homepage = "https://github.com/lipoja/URLExtract";
53 changelog = "https://github.com/lipoja/URLExtract/releases/tag/v${version}";
54 license = licenses.mit;
55 maintainers = with maintainers; [ ilkecan ];
56 };
57}