irrd: 4.3.0.post1 -> 4.4.2

This commit is contained in:
Yureka 2023-11-30 13:27:53 +01:00
parent 013f3808ed
commit 77417f2c76
2 changed files with 39 additions and 87 deletions

View file

@ -1,6 +1,8 @@
{ lib
, python3
, fetchPypi
, fetchFromGitHub
, fetchpatch
, git
, postgresql
, postgresqlTestHook
@ -10,6 +12,7 @@
let
py = python3.override {
packageOverrides = final: prev: {
# sqlalchemy 1.4.x or 2.x are not supported
sqlalchemy = prev.sqlalchemy.overridePythonAttrs (oldAttrs: rec {
version = "1.3.24";
src = fetchPypi {
@ -19,33 +22,12 @@ let
};
doCheck = false;
});
starlette = prev.starlette.overridePythonAttrs (oldAttrs: rec {
version = "0.20.4";
src = fetchPypi {
inherit (oldAttrs) pname;
inherit version;
hash = "sha256-QvzzEi+Zj+/OPixa1+Xtvw8Cz2hdZGqDoI1ARyavUIQ=";
};
nativeBuildInputs = with final; [
setuptools
];
doCheck = false;
});
ariadne = prev.ariadne.overridePythonAttrs (oldAttrs: rec {
version = "0.17.1";
src = fetchPypi {
inherit (oldAttrs) pname;
inherit version;
hash = "sha256-B98wl/NkNOyq99AKsVQem9TZ0meOnvg7IdWIEAI2vy8=";
};
nativeBuildInputs = with final; [
setuptools
];
doCheck = false;
});
alembic = prev.alembic.overridePythonAttrs (lib.const {
doCheck = false;
});
factory-boy = prev.factory-boy.overridePythonAttrs (lib.const {
doCheck = false;
});
beautifultable = prev.beautifultable.overridePythonAttrs (oldAttrs: rec {
version = "0.8.0";
src = fetchPypi {
@ -61,25 +43,27 @@ in
py.pkgs.buildPythonPackage rec {
pname = "irrd";
version = "4.3.0.post1";
format = "setuptools";
version = "4.4.2";
format = "pyproject";
src = fetchPypi {
inherit pname version;
hash = "sha256-hayfdcYAgIopfUiAR/AUWMuTzwpXvXuq6iPp9uhWN1M=";
src = fetchFromGitHub {
owner = "irrdnet";
repo = "irrd";
rev = "v${version}";
hash = "sha256-vZSuBP44ZvN0mu2frcaQNZN/ilvKWIY9ETnrStzSnG0=";
};
patches = [
./irrd-asgiref-3.8.0.diff
# replace poetry dependency with poetry-core
# https://github.com/irrdnet/irrd/pull/884
(fetchpatch {
url = "https://github.com/irrdnet/irrd/commit/4fb6e9b50d65729aff2d0a94c2e9b4e2daadea85.patch";
hash = "sha256-DcE6VZfJkbHnPiEdYDpXea7S/8P0SmdvvJ42hywnpf0=";
})
];
pythonRelaxDeps = true;
nativeBuildInputs = with python3.pkgs; [
pythonRelaxDepsHook
poetry-core
];
postPatch = ''
substituteInPlace setup.py --replace psycopg2-binary psycopg2
'';
nativeCheckInputs = [
git
@ -90,6 +74,7 @@ py.pkgs.buildPythonPackage rec {
pytest-asyncio
pytest-freezegun
pytestCheckHook
smtpdfix
]);
propagatedBuildInputs = with py.pkgs; [
@ -123,6 +108,17 @@ py.pkgs.buildPythonPackage rec {
ujson
wheel
websockets
limits
factory-boy
webauthn
wtforms
imia
starlette-wtf
zxcvbn
pyotp
asgi-logger
wtforms-bootstrap5
email-validator
] ++ py.pkgs.uvicorn.optional-dependencies.standard;
preCheck = ''
@ -134,10 +130,17 @@ py.pkgs.buildPythonPackage rec {
sleep 1
done
export SMTPD_HOST=127.0.0.1
export IRRD_DATABASE_URL="postgres:///$PGDATABASE"
export IRRD_REDIS_URL="redis://localhost/1"
'';
# required for test_object_writing_and_status_checking
postgresqlTestSetupPost = ''
echo "track_commit_timestamp=on" >> $PGDATA/postgresql.conf
pg_ctl restart
'';
postCheck = ''
kill $REDIS_PID
'';

View file

@ -1,51 +0,0 @@
diff --git a/irrd/server/graphql/schema_builder.py b/irrd/server/graphql/schema_builder.py
index 65ddf5d..b3b385a 100644
--- a/irrd/server/graphql/schema_builder.py
+++ b/irrd/server/graphql/schema_builder.py
@@ -31,32 +31,32 @@ def build_executable_schema():
"""
schema = SchemaGenerator()
- schema.rpsl_object_type.set_type_resolver(sta(resolve_rpsl_object_type, False))
- schema.rpsl_contact_union_type.set_type_resolver(sta(resolve_rpsl_object_type, False))
+ schema.rpsl_object_type.set_type_resolver(sta(resolve_rpsl_object_type, thread_sensitive=False))
+ schema.rpsl_contact_union_type.set_type_resolver(sta(resolve_rpsl_object_type, thread_sensitive=False))
- schema.query_type.set_field("rpslObjects", sta(resolve_rpsl_objects, False))
- schema.query_type.set_field("databaseStatus", sta(resolve_database_status, False))
- schema.query_type.set_field("asnPrefixes", sta(resolve_asn_prefixes, False))
- schema.query_type.set_field("asSetPrefixes", sta(resolve_as_set_prefixes, False))
- schema.query_type.set_field("recursiveSetMembers", sta(resolve_recursive_set_members, False))
+ schema.query_type.set_field("rpslObjects", sta(resolve_rpsl_objects, thread_sensitive=False))
+ schema.query_type.set_field("databaseStatus", sta(resolve_database_status, thread_sensitive=False))
+ schema.query_type.set_field("asnPrefixes", sta(resolve_asn_prefixes, thread_sensitive=False))
+ schema.query_type.set_field("asSetPrefixes", sta(resolve_as_set_prefixes, thread_sensitive=False))
+ schema.query_type.set_field("recursiveSetMembers", sta(resolve_recursive_set_members, thread_sensitive=False))
- schema.rpsl_object_type.set_field("mntByObjs", sta(resolve_rpsl_object_mnt_by_objs, False))
- schema.rpsl_object_type.set_field("journal", sta(resolve_rpsl_object_journal, False))
+ schema.rpsl_object_type.set_field("mntByObjs", sta(resolve_rpsl_object_mnt_by_objs, thread_sensitive=False))
+ schema.rpsl_object_type.set_field("journal", sta(resolve_rpsl_object_journal, thread_sensitive=False))
for object_type in schema.object_types:
if "adminCObjs" in schema.graphql_types[object_type.name]:
- object_type.set_field("adminCObjs", sta(resolve_rpsl_object_adminc_objs, False))
+ object_type.set_field("adminCObjs", sta(resolve_rpsl_object_adminc_objs, thread_sensitive=False))
for object_type in schema.object_types:
if "techCObjs" in schema.graphql_types[object_type.name]:
- object_type.set_field("techCObjs", sta(resolve_rpsl_object_techc_objs, False))
+ object_type.set_field("techCObjs", sta(resolve_rpsl_object_techc_objs, thread_sensitive=False))
for object_type in schema.object_types:
if "mbrsByRefObjs" in schema.graphql_types[object_type.name]:
- object_type.set_field("mbrsByRefObjs", sta(resolve_rpsl_object_members_by_ref_objs, False))
+ object_type.set_field("mbrsByRefObjs", sta(resolve_rpsl_object_members_by_ref_objs, thread_sensitive=False))
for object_type in schema.object_types:
if "memberOfObjs" in schema.graphql_types[object_type.name]:
- object_type.set_field("memberOfObjs", sta(resolve_rpsl_object_member_of_objs, False))
+ object_type.set_field("memberOfObjs", sta(resolve_rpsl_object_member_of_objs, thread_sensitive=False))
for object_type in schema.object_types:
if "membersObjs" in schema.graphql_types[object_type.name]:
- object_type.set_field("membersObjs", sta(resolve_rpsl_object_members_objs, False))
+ object_type.set_field("membersObjs", sta(resolve_rpsl_object_members_objs, thread_sensitive=False))
@schema.asn_scalar_type.value_parser
def parse_asn_scalar(value):