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