nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchPypi,
6
7 # build-system
8 flit-core,
9
10 # dependencies
11 markupsafe,
12
13 # optional-dependencies
14 watchdog,
15
16 # tests
17 cffi,
18 cryptography,
19 ephemeral-port-reserve,
20 pytest-timeout,
21 pytestCheckHook,
22
23 # reverse dependencies
24 moto,
25 sentry-sdk,
26}:
27
28buildPythonPackage rec {
29 pname = "werkzeug";
30 version = "3.1.5";
31 pyproject = true;
32
33 src = fetchPypi {
34 inherit pname version;
35 hash = "sha256-alSLDoiVXdB8yyVTnX0MyXQX7p4XlnfSLHBByPB4zmc=";
36 };
37
38 build-system = [ flit-core ];
39
40 dependencies = [ markupsafe ];
41
42 optional-dependencies = {
43 watchdog = [ watchdog ];
44 };
45
46 nativeCheckInputs = [
47 cffi
48 cryptography
49 ephemeral-port-reserve
50 pytest-timeout
51 pytestCheckHook
52 ]
53 ++ lib.concatAttrValues optional-dependencies;
54
55 pythonImportsCheck = [ "werkzeug" ];
56
57 disabledTests = [
58 # ConnectionRefusedError: [Errno 111] Connection refused
59 "test_http_proxy"
60 # ResourceWarning: subprocess 309 is still running
61 "test_basic"
62 "test_long_build"
63 ]
64 ++ lib.optionals stdenv.hostPlatform.isDarwin [ "test_get_machine_id" ];
65
66 disabledTestPaths = [
67 # ConnectionRefusedError: [Errno 111] Connection refused
68 "tests/test_serving.py"
69 ];
70
71 disabledTestMarks = [
72 # don't run tests that are marked with filterwarnings, they fail with
73 # warnings._OptionError: unknown warning category: 'pytest.PytestUnraisableExceptionWarning'
74 "filterwarnings"
75 ];
76
77 passthru.tests = {
78 inherit moto sentry-sdk;
79 };
80
81 meta = {
82 changelog = "https://werkzeug.palletsprojects.com/en/${lib.versions.majorMinor version}.x/changes/#version-${
83 lib.replaceStrings [ "." ] [ "-" ] version
84 }";
85 homepage = "https://palletsprojects.com/p/werkzeug/";
86 description = "Comprehensive WSGI web application library";
87 longDescription = ''
88 Werkzeug is a comprehensive WSGI web application library. It
89 began as a simple collection of various utilities for WSGI
90 applications and has become one of the most advanced WSGI
91 utility libraries.
92 '';
93 license = lib.licenses.bsd3;
94 maintainers = [ ];
95 };
96}