1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 pythonOlder,
6 fetchFromGitHub,
7 setuptools-scm,
8 beautifulsoup4,
9 boto3,
10 freezegun,
11 lxml,
12 openpyxl,
13 parameterized,
14 pdoc,
15 pytestCheckHook,
16 requests-mock,
17 typeguard,
18}:
19
20buildPythonPackage rec {
21 pname = "bx-py-utils";
22 version = "108";
23
24 disabled = pythonOlder "3.10";
25
26 pyproject = true;
27
28 src = fetchFromGitHub {
29 owner = "boxine";
30 repo = "bx_py_utils";
31 tag = "v${version}";
32 hash = "sha256-VMGP5yl+7kiZ3Ww4ESJPHABDCMZG1VsVDgVoLnGU5r4=";
33 };
34
35 postPatch = ''
36 rm bx_py_utils_tests/publish.py
37 '';
38
39 build-system = [ setuptools-scm ];
40
41 pythonImportsCheck = [
42 "bx_py_utils.anonymize"
43 "bx_py_utils.auto_doc"
44 "bx_py_utils.compat"
45 "bx_py_utils.dict_utils"
46 "bx_py_utils.environ"
47 "bx_py_utils.error_handling"
48 "bx_py_utils.file_utils"
49 "bx_py_utils.graphql_introspection"
50 "bx_py_utils.hash_utils"
51 "bx_py_utils.html_utils"
52 "bx_py_utils.iteration"
53 "bx_py_utils.path"
54 "bx_py_utils.processify"
55 "bx_py_utils.rison"
56 "bx_py_utils.stack_info"
57 "bx_py_utils.string_utils"
58 "bx_py_utils.test_utils"
59 "bx_py_utils.text_tools"
60 ];
61
62 nativeCheckInputs = [
63 beautifulsoup4
64 boto3
65 freezegun
66 lxml
67 openpyxl
68 parameterized
69 pdoc
70 pytestCheckHook
71 requests-mock
72 typeguard
73 ];
74
75 disabledTests = [
76 # too closely affected by bs4 updates
77 "test_pretty_format_html"
78 "test_assert_html_snapshot_by_css_selector"
79 ];
80
81 disabledTestPaths =
82 [ "bx_py_utils_tests/tests/test_project_setup.py" ]
83 ++ lib.optionals stdenv.hostPlatform.isDarwin [
84 # processify() doesn't work under darwin
85 # https://github.com/boxine/bx_py_utils/issues/80
86 "bx_py_utils_tests/tests/test_processify.py"
87 ];
88
89 meta = {
90 description = "Various Python utility functions";
91 mainProgram = "bx_py_utils";
92 homepage = "https://github.com/boxine/bx_py_utils";
93 changelog = "https://github.com/boxine/bx_py_utils/releases/tag/${src.tag}";
94 license = lib.licenses.mit;
95 maintainers = with lib.maintainers; [ dotlambda ];
96 };
97}