1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6 pythonOlder,
7 aniso8601,
8 jsonschema,
9 flask,
10 importlib-resources,
11 werkzeug,
12 pytz,
13 faker,
14 mock,
15 blinker,
16 py,
17 pytest-flask,
18 pytest-mock,
19 pytest-benchmark,
20 pytestCheckHook,
21 setuptools,
22}:
23
24buildPythonPackage rec {
25 pname = "flask-restx";
26 version = "1.3.0";
27 pyproject = true;
28
29 disabled = pythonOlder "3.8";
30
31 # Tests not included in PyPI tarball
32 src = fetchFromGitHub {
33 owner = "python-restx";
34 repo = "flask-restx";
35 rev = "refs/tags/${version}";
36 hash = "sha256-CBReP/u96fsr28lMV1BfLjjdBMXEvsD03wvsxkIcteI=";
37 };
38
39 build-system = [ setuptools ];
40
41 dependencies = [
42 aniso8601
43 flask
44 importlib-resources
45 jsonschema
46 pytz
47 werkzeug
48 ];
49
50 nativeCheckInputs = [
51 blinker
52 faker
53 mock
54 py
55 pytest-benchmark
56 pytest-flask
57 pytest-mock
58 pytestCheckHook
59 ];
60
61 pytestFlagsArray =
62 [
63 "--benchmark-disable"
64 "--deselect=tests/test_inputs.py::URLTest::test_check"
65 "--deselect=tests/test_inputs.py::EmailTest::test_valid_value_check"
66 "--deselect=tests/test_logging.py::LoggingTest::test_override_app_level"
67 ]
68 ++ lib.optionals stdenv.isDarwin [
69 "--deselect=tests/test_inputs.py::EmailTest::test_invalid_values_check"
70 ];
71
72 disabledTests = [
73 # broken in werkzeug 2.3 upgrade
74 "test_media_types_method"
75 "test_media_types_q"
76 ];
77
78 pythonImportsCheck = [ "flask_restx" ];
79
80 meta = with lib; {
81 description = "Fully featured framework for fast, easy and documented API development with Flask";
82 homepage = "https://github.com/python-restx/flask-restx";
83 changelog = "https://github.com/python-restx/flask-restx/blob/${version}/CHANGELOG.rst";
84 license = licenses.bsd3;
85 maintainers = [ ];
86 };
87}