1{ lib
2, stdenv
3, buildPythonPackage
4, pythonOlder
5, fetchPypi
6, flit-core
7, watchdog
8, ephemeral-port-reserve
9, pytest-timeout
10, pytest-xprocess
11, pytestCheckHook
12, markupsafe
13# for passthru.tests
14, moto, sentry-sdk
15}:
16
17buildPythonPackage rec {
18 pname = "werkzeug";
19 version = "2.3.7";
20 format = "pyproject";
21
22 disabled = pythonOlder "3.8";
23
24 src = fetchPypi {
25 inherit pname version;
26 hash = "sha256-K4wORHtLnbzIXdl7butNy69si2w74L1lTiVVPgohV9g=";
27 };
28
29 nativeBuildInputs = [
30 flit-core
31 ];
32
33 propagatedBuildInputs = [
34 markupsafe
35 ];
36
37 passthru.optional-dependencies = {
38 watchdog = lib.optionals (!stdenv.isDarwin) [
39 # watchdog requires macos-sdk 10.13[
40 watchdog
41 ];
42 };
43
44 nativeCheckInputs = [
45 ephemeral-port-reserve
46 pytest-timeout
47 pytest-xprocess
48 pytestCheckHook
49 ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);
50
51 disabledTests = lib.optionals stdenv.isDarwin [
52 "test_get_machine_id"
53 ];
54
55 disabledTestPaths = [
56 # ConnectionRefusedError: [Errno 111] Connection refused
57 "tests/test_serving.py"
58 ];
59
60 pytestFlagsArray = [
61 # don't run tests that are marked with filterwarnings, they fail with
62 # warnings._OptionError: unknown warning category: 'pytest.PytestUnraisableExceptionWarning'
63 "-m 'not filterwarnings'"
64 ];
65
66 passthru.tests = {
67 inherit moto sentry-sdk;
68 };
69
70 meta = with lib; {
71 homepage = "https://palletsprojects.com/p/werkzeug/";
72 description = "The comprehensive WSGI web application library";
73 longDescription = ''
74 Werkzeug is a comprehensive WSGI web application library. It
75 began as a simple collection of various utilities for WSGI
76 applications and has become one of the most advanced WSGI
77 utility libraries.
78 '';
79 license = licenses.bsd3;
80 maintainers = with maintainers; [ ];
81 };
82}