1{ lib
2, stdenv
3, buildPythonPackage
4, pythonOlder
5, fetchFromGitHub
6, setuptools
7, setuptools-scm
8, more-itertools
9, beautifulsoup4
10, mechanize
11, keyring
12, requests
13, feedparser
14, jaraco-text
15, jaraco-logging
16, jaraco-email
17, jaraco-functools
18, jaraco-collections
19, path
20, python-dateutil
21, pathvalidate
22, jsonpickle
23, ifconfig-parser
24, pytestCheckHook
25, cherrypy
26, importlib-resources
27, pyparsing
28, requests-mock
29, nettools
30}:
31
32buildPythonPackage rec {
33 pname = "jaraco-net";
34 version = "9.3.1";
35
36 disabled = pythonOlder "3.7";
37
38 format = "pyproject";
39
40 src = fetchFromGitHub {
41 owner = "jaraco";
42 repo = "jaraco.net";
43 rev = "refs/tags/v${version}";
44 hash = "sha256-aq5v4QlapmMTrqwNA0GtRi/xZCcyoR1giZECBsYwymw=";
45 };
46
47 nativeBuildInputs = [
48 setuptools
49 setuptools-scm
50 ];
51
52 SETUPTOOLS_SCM_PRETEND_VERSION = version;
53
54 propagatedBuildInputs = [
55 more-itertools
56 beautifulsoup4
57 mechanize
58 keyring
59 requests
60 feedparser
61 jaraco-text
62 jaraco-logging
63 jaraco-email
64 jaraco-functools
65 jaraco-collections
66 path
67 python-dateutil
68 pathvalidate
69 jsonpickle
70 ] ++ lib.optionals stdenv.isDarwin [
71 ifconfig-parser
72 ];
73
74 pythonImportsCheck = [ "jaraco.net" ];
75
76 nativeCheckInputs = [
77 pytestCheckHook
78 cherrypy
79 importlib-resources
80 pyparsing
81 requests-mock
82 ] ++ lib.optionals stdenv.isDarwin [
83 nettools
84 ];
85
86 disabledTestPaths = [
87 # doesn't actually contain tests
88 "fabfile.py"
89 # require networking
90 "jaraco/net/ntp.py"
91 "jaraco/net/scanner.py"
92 "tests/test_cookies.py"
93 ];
94
95 # cherrypy does not support Python 3.11
96 doCheck = pythonOlder "3.11";
97
98 meta = {
99 changelog = "https://github.com/jaraco/jaraco.net/blob/${src.rev}/CHANGES.rst";
100 description = "Networking tools by jaraco";
101 homepage = "https://github.com/jaraco/jaraco.net";
102 license = lib.licenses.mit;
103 maintainers = with lib.maintainers; [ dotlambda ];
104 };
105}