From f2cd48bb9c12fba299375e93225a70d4aa2f2680 Mon Sep 17 00:00:00 2001 From: Kerstin Humm Date: Sat, 15 Feb 2025 15:38:38 +0100 Subject: [PATCH 1/6] python3Packages.drf-standardized-errors: init at 0.14.1 --- .../drf-standardized-errors/default.nix | 66 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 68 insertions(+) create mode 100644 pkgs/development/python-modules/drf-standardized-errors/default.nix diff --git a/pkgs/development/python-modules/drf-standardized-errors/default.nix b/pkgs/development/python-modules/drf-standardized-errors/default.nix new file mode 100644 index 000000000000..c20114c2542f --- /dev/null +++ b/pkgs/development/python-modules/drf-standardized-errors/default.nix @@ -0,0 +1,66 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + fetchpatch, + flit-core, + django, + djangorestframework, + drf-spectacular, + inflection, + pytestCheckHook, + pytest-django, + django-filter, +}: + +buildPythonPackage rec { + pname = "drf-standardized-errors"; + version = "0.14.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "ghazi-git"; + repo = "drf-standardized-errors"; + tag = "v${version}"; + hash = "sha256-Gr4nj2dd0kZTc4IbLhb0i3CnY+VZaNnr3YJctyxIgQU="; + }; + + patches = [ + # fix test_openapi_utils test + (fetchpatch { + url = "https://github.com/ghazi-git/drf-standardized-errors/pull/96/commits/4a2b1be3c97cd6db50543e6ff0303c0df0731d8a.patch"; + hash = "sha256-8+zVzBX7yDGfpsyvj61auqV+zdG6mIyj2LtR3D8l4jc="; + }) + ]; + + build-system = [ flit-core ]; + + dependencies = [ + django + djangorestframework + ]; + + nativeCheckInputs = [ + pytestCheckHook + pytest-django + django-filter + drf-spectacular + ]; + + env.DJANGO_SETTINGS_MODULE = "tests.settings"; + + pythonImportsCheck = [ "drf_standardized_errors" ]; + + optional-dependencies.openapi = [ + drf-spectacular + inflection + ]; + + meta = with lib; { + description = "Standardize your DRF API error responses"; + homepage = "https://github.com/ghazi-git/drf-standardized-errors"; + changelog = "https://github.com/ghazi-git/drf-standardized-errors/releases/tag/${src.tag}"; + license = licenses.mit; + maintainers = with maintainers; [ erictapen ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 51bc0c6ba105..1852bf1e842f 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3926,6 +3926,8 @@ self: super: with self; { drf-spectacular-sidecar = callPackage ../development/python-modules/drf-spectacular-sidecar { }; + drf-standardized-errors = callPackage ../development/python-modules/drf-standardized-errors { }; + drf-ujson2 = callPackage ../development/python-modules/drf-ujson2 { }; drf-writable-nested = callPackage ../development/python-modules/drf-writable-nested { }; From 3446bd3122714d7339dda592463df3a5b0157ba8 Mon Sep 17 00:00:00 2001 From: Kerstin Humm Date: Sat, 15 Feb 2025 15:40:51 +0100 Subject: [PATCH 2/6] python3Packages.weblate-language-data: 2024.16 -> 2025.2 --- .../python-modules/weblate-language-data/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/weblate-language-data/default.nix b/pkgs/development/python-modules/weblate-language-data/default.nix index 12c26e81e323..b1301c6237be 100644 --- a/pkgs/development/python-modules/weblate-language-data/default.nix +++ b/pkgs/development/python-modules/weblate-language-data/default.nix @@ -8,13 +8,13 @@ buildPythonPackage rec { pname = "weblate-language-data"; - version = "2024.16"; + version = "2025.2"; pyproject = true; src = fetchPypi { pname = "weblate_language_data"; inherit version; - hash = "sha256-zPYUsOkYizkaGcN+orrR7mZKAq+4KuSXTZc1arsu/Xw="; + hash = "sha256-T3O107CQ01loE68vlQtcCjeytxCSiu0m5Oj5P06z2NU="; }; build-system = [ setuptools ]; From 85901fb63822439cae3aef81f46c017e41fa322d Mon Sep 17 00:00:00 2001 From: Kerstin Humm Date: Sat, 15 Feb 2025 16:05:35 +0100 Subject: [PATCH 3/6] python3Packages.django-otp: 1.5.2 -> 1.5.4 Diff: https://github.com/django-otp/django-otp/compare/v1.5.2...v1.5.4 Changelog: https://github.com/django-otp/django-otp/blob/v1.5.4/CHANGES.rst --- pkgs/development/python-modules/django-otp/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/django-otp/default.nix b/pkgs/development/python-modules/django-otp/default.nix index 791ee2716d32..d58ddda9abdc 100644 --- a/pkgs/development/python-modules/django-otp/default.nix +++ b/pkgs/development/python-modules/django-otp/default.nix @@ -12,14 +12,14 @@ buildPythonPackage rec { pname = "django-otp"; - version = "1.5.2"; + version = "1.5.4"; pyproject = true; src = fetchFromGitHub { owner = "django-otp"; repo = "django-otp"; - rev = "v${version}"; - hash = "sha256-fn3MptdlnqY0rOLwcPhKiLfrhYvov4YVLZ58Jp/j6zc="; + tag = "v${version}"; + hash = "sha256-Hwi0Z5/e91peGbp+GvL/gCtUI4hcJ4kevJMWe9sFvYk="; }; build-system = [ hatchling ]; @@ -52,7 +52,7 @@ buildPythonPackage rec { meta = with lib; { homepage = "https://github.com/django-otp/django-otp"; - changelog = "https://github.com/django-otp/django-otp/blob/${src.rev}/CHANGES.rst"; + changelog = "https://github.com/django-otp/django-otp/blob/${src.tag}/CHANGES.rst"; description = "Pluggable framework for adding two-factor authentication to Django using one-time passwords"; license = licenses.bsd2; maintainers = [ ]; From 8ba1fefd767932cd8853969e4a4cec5b5c61ceb1 Mon Sep 17 00:00:00 2001 From: Kerstin Humm Date: Sat, 15 Feb 2025 16:06:09 +0100 Subject: [PATCH 4/6] weblate: 5.9.2 -> 5.10 Changelog: https://github.com/WeblateOrg/weblate/releases/tag/weblate-5.10 also compile messages during build --- pkgs/by-name/we/weblate/package.nix | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/pkgs/by-name/we/weblate/package.nix b/pkgs/by-name/we/weblate/package.nix index c5e954134479..730456373768 100644 --- a/pkgs/by-name/we/weblate/package.nix +++ b/pkgs/by-name/we/weblate/package.nix @@ -2,6 +2,7 @@ lib, python3, fetchFromGitHub, + gettext, pango, harfbuzz, librsvg, @@ -26,7 +27,7 @@ let in python.pkgs.buildPythonApplication rec { pname = "weblate"; - version = "5.9.2"; + version = "5.10"; pyproject = true; @@ -39,7 +40,7 @@ python.pkgs.buildPythonApplication rec { owner = "WeblateOrg"; repo = "weblate"; tag = "weblate-${version}"; - hash = "sha256-/fsNQvIIgcTPZHHIwr8sruEJpPJTmXbevoxy1GPmOOU="; + hash = "sha256-DRodQb4IvLfpL+TzLigtiKTvXvGYbpa9Ej4+fCHSGmo="; }; patches = [ @@ -47,7 +48,9 @@ python.pkgs.buildPythonApplication rec { ./cache.lock.patch ]; - build-system = with python.pkgs; [ setuptools ]; + build-system = [ gettext ] ++ (with python.pkgs; [ setuptools ]); + + nativeBuildInputs = [ gettext ]; # Build static files into a separate output postBuild = @@ -64,14 +67,11 @@ python.pkgs.buildPythonApplication rec { mkdir $static cat weblate/settings_example.py ${staticSettings} > weblate/settings_static.py export DJANGO_SETTINGS_MODULE="weblate.settings_static" + ${python.pythonOnBuildForHost.interpreter} manage.py compilemessages ${python.pythonOnBuildForHost.interpreter} manage.py collectstatic --no-input ${python.pythonOnBuildForHost.interpreter} manage.py compress ''; - pythonRelaxDeps = [ - "rapidfuzz" - ]; - dependencies = with python.pkgs; [ @@ -99,14 +99,16 @@ python.pkgs.buildPythonApplication rec { django-otp django-otp-webauthn django + djangorestframework-csv djangorestframework + docutils drf-spectacular + drf-standardized-errors filelock fluent-syntax gitpython hiredis html2text - httpx iniparse jsonschema lxml @@ -143,7 +145,8 @@ python.pkgs.buildPythonApplication rec { ++ django.optional-dependencies.argon2 ++ python-redis-lock.optional-dependencies.django ++ celery.optional-dependencies.redis - ++ drf-spectacular.optional-dependencies.sidecar; + ++ drf-spectacular.optional-dependencies.sidecar + ++ drf-standardized-errors.optional-dependencies.openapi; optional-dependencies = { postgres = with python.pkgs; [ psycopg ]; From 23157759ebffc7d56de7d205542d848e560bd415 Mon Sep 17 00:00:00 2001 From: Kerstin Humm Date: Sat, 15 Feb 2025 16:24:50 +0100 Subject: [PATCH 5/6] nixos/weblate: run the integration test without --deploy for now --- nixos/tests/web-apps/weblate.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixos/tests/web-apps/weblate.nix b/nixos/tests/web-apps/weblate.nix index 40d60f7e5f99..b294dd01cfe5 100644 --- a/nixos/tests/web-apps/weblate.nix +++ b/nixos/tests/web-apps/weblate.nix @@ -97,6 +97,7 @@ import ../make-test-python.nix ( # TODO: Check sending and receiving email. # server.wait_for_unit("postfix.service") + server.succeed("sudo -iu weblate -- weblate check") # TODO: The goal is for this to succeed, but there are still some checks failing. # server.succeed("sudo -iu weblate -- weblate check --deploy") ''; From c559ae7ea43cc1f2314829db9ede94a2155487ae Mon Sep 17 00:00:00 2001 From: Sandro Date: Sun, 16 Feb 2025 22:27:49 +0100 Subject: [PATCH 6/6] weblate: cleanup gettext change --- pkgs/by-name/we/weblate/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/we/weblate/package.nix b/pkgs/by-name/we/weblate/package.nix index 730456373768..050e34c97f38 100644 --- a/pkgs/by-name/we/weblate/package.nix +++ b/pkgs/by-name/we/weblate/package.nix @@ -48,7 +48,7 @@ python.pkgs.buildPythonApplication rec { ./cache.lock.patch ]; - build-system = [ gettext ] ++ (with python.pkgs; [ setuptools ]); + build-system = with python.pkgs; [ setuptools ]; nativeBuildInputs = [ gettext ];