Merge pull request #330634 from r-ryantm/auto-update/circumflex
[NixPkgs.git] / pkgs / servers / apache-airflow / default.nix
blob1055f79806d49229adee6e9bcd3e556c3c2650af
1 { fetchFromGitHub
2 , fetchPypi
3 , python3
4 }:
6 let
7   python = python3.override {
8     packageOverrides = pySelf: pySuper: {
9       connexion = pySuper.connexion.overridePythonAttrs (o: rec {
10         version = "2.14.2";
11         src = fetchFromGitHub {
12           owner = "spec-first";
13           repo = "connexion";
14           rev = "refs/tags/${version}";
15           hash = "sha256-1v1xCHY3ZnZG/Vu9wN/it7rLKC/StoDefoMNs+hMjIs=";
16         };
17         nativeBuildInputs = with pySelf; [
18           setuptools
19         ];
20         pythonRelaxDeps = [
21           "werkzeug"
22         ];
23         propagatedBuildInputs = with pySelf; [
24           aiohttp
25           aiohttp-jinja2
26           aiohttp-swagger
27           clickclick
28           flask
29           inflection
30           jsonschema
31           openapi-spec-validator
32           packaging
33           pyyaml
34           requests
35           swagger-ui-bundle
36         ];
37         nativeCheckInputs = with pySelf; [
38           aiohttp-remotes
39           decorator
40           pytest-aiohttp
41           pytestCheckHook
42           testfixtures
43         ];
44         disabledTests = [
45           "test_app"
46           "test_openapi_yaml_behind_proxy"
47           "test_swagger_ui"
48         ];
49       });
50       flask = pySuper.flask.overridePythonAttrs (o: rec {
51         version = "2.2.5";
52         src = fetchPypi {
53           pname = "Flask";
54           inherit version;
55           hash = "sha256-7e6bCn/yZiG9WowQ/0hK4oc3okENmbC7mmhQx/uXeqA=";
56         };
57         nativeBuildInputs = (o.nativeBuildInputs or []) ++ [
58           pySelf.setuptools
59         ];
60       });
61       # flask-appbuilder doesn't work with sqlalchemy 2.x, flask-appbuilder 3.x
62       # https://github.com/dpgaspar/Flask-AppBuilder/issues/2038
63       flask-appbuilder = pySuper.flask-appbuilder.overridePythonAttrs (o: {
64         meta.broken = false;
65       });
66       # a knock-on effect from overriding the sqlalchemy version
67       flask-sqlalchemy = pySuper.flask-sqlalchemy.overridePythonAttrs (o: {
68         src = fetchPypi {
69           pname = "Flask-SQLAlchemy";
70           version = "2.5.1";
71           hash = "sha256-K9pEtD58rLFdTgX/PMH4vJeTbMRkYjQkECv8LDXpWRI=";
72         };
73         format = "setuptools";
74       });
75       httpcore = pySuper.httpcore.overridePythonAttrs (o: rec {
76         # nullify upstream's pytest flags which cause
77         # "TLS/SSL connection has been closed (EOF)"
78         # with pytest-httpbin 1.x
79         preCheck = ''
80           substituteInPlace pyproject.toml \
81             --replace '[tool.pytest.ini_options]' '[tool.notpytest.ini_options]'
82         '';
83       });
84       pytest-httpbin = pySuper.pytest-httpbin.overridePythonAttrs (o: rec {
85         version = "1.0.2";
86         src = fetchFromGitHub {
87           owner = "kevin1024";
88           repo = "pytest-httpbin";
89           rev = "refs/tags/v${version}";
90           hash = "sha256-S4ThQx4H3UlKhunJo35esPClZiEn7gX/Qwo4kE1QMTI=";
91         };
92       });
93       # apache-airflow doesn't work with sqlalchemy 2.x
94       # https://github.com/apache/airflow/issues/28723
95       sqlalchemy = pySuper.sqlalchemy_1_4;
97       apache-airflow = pySelf.callPackage ./python-package.nix { };
98     };
99   };
101 # See note in ./python-package.nix for
102 # instructions on manually testing the web UI
103 with python.pkgs; (toPythonApplication apache-airflow).overrideAttrs (previousAttrs: {
104   # Provide access to airflow's modified python package set
105   # for the cases where external scripts need to import
106   # airflow modules, though *caveat emptor* because many of
107   # these packages will not be built by hydra and many will
108   # not work at all due to the unexpected version overrides
109   # here.
110   passthru = (previousAttrs.passthru or { }) // {
111     pythonPackages = python.pkgs;
112   };