1{
2 lib,
3 attrs,
4 botocore,
5 buildPythonPackage,
6 click,
7 fetchFromGitHub,
8 hypothesis,
9 inquirer,
10 jmespath,
11 mock,
12 mypy-extensions,
13 pip,
14 pytest7CheckHook,
15 pythonOlder,
16 pyyaml,
17 requests,
18 setuptools,
19 six,
20 typing-extensions,
21 watchdog,
22 websocket-client,
23 wheel,
24}:
25
26buildPythonPackage rec {
27 pname = "chalice";
28 version = "1.28.0";
29 format = "setuptools";
30
31 disabled = pythonOlder "3.7";
32
33 src = fetchFromGitHub {
34 owner = "aws";
35 repo = pname;
36 rev = "refs/tags/${version}";
37 hash = "sha256-m3pSD4fahBW6Yt/w07Co4fTZD7k6as5cPwoK5QSry6M=";
38 };
39
40 postPatch = ''
41 substituteInPlace setup.py \
42 --replace "inquirer>=2.7.0,<3.0.0" "inquirer" \
43 --replace "pip>=9,<23.1" "pip" \
44 '';
45
46 propagatedBuildInputs = [
47 attrs
48 botocore
49 click
50 inquirer
51 jmespath
52 mypy-extensions
53 pip
54 pyyaml
55 setuptools
56 six
57 typing-extensions
58 wheel
59 watchdog
60 ];
61
62 nativeCheckInputs = [
63 hypothesis
64 mock
65 pytest7CheckHook
66 requests
67 websocket-client
68 ];
69
70 disabledTestPaths = [
71 # Don't check the templates and the sample app
72 "chalice/templates"
73 "docs/source/samples/todo-app/code/tests/test_db.py"
74 # Requires credentials
75 "tests/aws/test_features.py"
76 # Requires network access
77 "tests/aws/test_websockets.py"
78 "tests/integration/test_package.py"
79 ];
80
81 disabledTests = [
82 # Requires network access
83 "test_update_domain_name_failed"
84 "test_can_reload_server"
85 # Content for the tests is missing
86 "test_can_import_env_vars"
87 "test_stack_trace_printed_on_error"
88 # Don't build
89 "test_can_generate_pipeline_for_all"
90 "test_build_wheel"
91 # https://github.com/aws/chalice/issues/1850
92 "test_resolve_endpoint"
93 "test_endpoint_from_arn"
94 # Tests require dist
95 "test_setup_tar_gz_hyphens_in_name"
96 "test_both_tar_gz"
97 "test_both_tar_bz2"
98 ];
99
100 pythonImportsCheck = [ "chalice" ];
101
102 meta = with lib; {
103 description = "Python Serverless Microframework for AWS";
104 mainProgram = "chalice";
105 homepage = "https://github.com/aws/chalice";
106 changelog = "https://github.com/aws/chalice/blob/${version}/CHANGELOG.rst";
107 license = licenses.asl20;
108 maintainers = with maintainers; [ ];
109 };
110}