chromium,chromedriver: 129.0.6668.91 -> 129.0.6668.100
[NixPkgs.git] / pkgs / by-name / ir / irrd / package.nix
blobd1c7a1903ec0a8194ddebec14d334b6fe5a6b3ff
1 { lib
2 , python3
3 , fetchPypi
4 , fetchFromGitHub
5 , fetchpatch
6 , git
7 , postgresql
8 , postgresqlTestHook
9 , redis
12 let
13   py = python3.override {
14     self = py;
15     packageOverrides = final: prev: {
16       # sqlalchemy 1.4.x or 2.x are not supported
17       sqlalchemy = prev.sqlalchemy_1_4.overridePythonAttrs (oldAttrs: rec {
18         version = "1.3.24";
19         src = fetchPypi {
20           pname = "SQLAlchemy";
21           inherit version;
22           hash = "sha256-67t3fL+TEjWbiXv4G6ANrg9ctp+6KhgmXcwYpvXvdRk=";
23         };
24         postPatch = ''
25           sed -i '/tag_build = dev/d' setup.cfg
26         '';
27         doCheck = false;
28       });
29       alembic = prev.alembic.overridePythonAttrs (lib.const {
30         doCheck = false;
31       });
32       factory-boy = prev.factory-boy.overridePythonAttrs (lib.const {
33         doCheck = false;
34       });
35       beautifultable = prev.beautifultable.overridePythonAttrs (oldAttrs: rec {
36         version = "0.8.0";
37         src = fetchPypi {
38           inherit (oldAttrs) pname;
39           inherit version;
40           hash = "sha256-1E2VUbvte/qIZ1Mk+E77mqhXOE1E6fsh61MPCgutuBU=";
41         };
42         doCheck = false;
43       });
44     };
45   };
48 py.pkgs.buildPythonPackage rec {
49   pname = "irrd";
50   version = "4.4.4";
51   format = "pyproject";
53   src = fetchFromGitHub {
54     owner = "irrdnet";
55     repo = "irrd";
56     rev = "v${version}";
57     hash = "sha256-UIOKXU92JEOeVdpYLNmDBtLn0u3LMdKItcn9bFd9u8g=";
58   };
60   patches = [
61     # starlette 0.37.2 reverted the behaviour change which this adjusted to
62     (fetchpatch {
63       url = "https://github.com/irrdnet/irrd/commit/43e26647e18f8ff3459bbf89ffbff329a0f1eed5.patch";
64       revert = true;
65       hash = "sha256-G216rHfWMZIl9GuXBz6mjHCIm3zrfDDLSmHQK/HkkzQ=";
66     })
67     # Backport build fix for webauthn 2.1
68     (fetchpatch {
69       url = "https://github.com/irrdnet/irrd/commit/20b771e1ee564f38e739fdb0a2a79c10319f638f.patch";
70       hash = "sha256-PtNdhSoFPT1kt71kFsySp/VnUpUdO23Gu9FKknHLph8=";
71       includes = ["irrd/webui/auth/endpoints_mfa.py"];
72     })
73   ];
75   postPatch = ''
76     substituteInPlace pyproject.toml \
77       --replace-fail psycopg2-binary psycopg2
78   '';
79   pythonRelaxDeps = true;
81   nativeBuildInputs = with python3.pkgs; [
82     poetry-core
83   ];
85   nativeCheckInputs = [
86     git
87     redis
88     postgresql
89     postgresqlTestHook
90   ] ++ (with py.pkgs; [
91     pytest-asyncio
92     pytest-freezegun
93     pytestCheckHook
94     smtpdfix
95     httpx
96   ]);
98   propagatedBuildInputs = with py.pkgs; [
99     python-gnupg
100     passlib
101     bcrypt
102     ipy
103     ordered-set
104     beautifultable
105     pyyaml
106     datrie
107     setproctitle
108     python-daemon
109     pid
110     py.pkgs.redis
111     hiredis
112     coredis
113     requests
114     pytz
115     ariadne
116     uvicorn
117     starlette
118     psutil
119     asgiref
120     pydantic
121     typing-extensions
122     py-radix-sr
123     psycopg2
124     sqlalchemy
125     alembic
126     ujson
127     wheel
128     websockets
129     limits
130     factory-boy
131     webauthn
132     wtforms
133     imia
134     starlette-wtf
135     zxcvbn
136     pyotp
137     asgi-logger
138     wtforms-bootstrap5
139     email-validator
140     jinja2
141   ] ++ py.pkgs.uvicorn.optional-dependencies.standard;
143   preCheck = ''
144     redis-server &
145     REDIS_PID=$!
147     while ! redis-cli --scan ; do
148       echo waiting for redis
149       sleep 1
150     done
152     export SMTPD_HOST=127.0.0.1
153     export IRRD_DATABASE_URL="postgres:///$PGDATABASE"
154     export IRRD_REDIS_URL="redis://localhost/1"
155   '';
157   # required for test_object_writing_and_status_checking
158   postgresqlTestSetupPost = ''
159     echo "track_commit_timestamp=on" >> $PGDATA/postgresql.conf
160     pg_ctl restart
161   '';
163   postCheck = ''
164     kill $REDIS_PID
165   '';
167   # skip tests that require internet access
168   disabledTests = [
169     "test_020_dash_o_noop"
170     "test_050_non_json_response"
171   ];
173   meta = with lib; {
174     changelog = "https://irrd.readthedocs.io/en/v${version}/releases/";
175     description = "Internet Routing Registry database server, processing IRR objects in the RPSL format";
176     license = licenses.mit;
177     homepage = "https://github.com/irrdnet/irrd";
178     maintainers = teams.wdz.members;
179   };