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") ''; diff --git a/pkgs/by-name/we/weblate/package.nix b/pkgs/by-name/we/weblate/package.nix index c5e954134479..050e34c97f38 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 = [ @@ -49,6 +50,8 @@ python.pkgs.buildPythonApplication rec { build-system = with python.pkgs; [ setuptools ]; + nativeBuildInputs = [ gettext ]; + # Build static files into a separate output postBuild = let @@ -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 ]; 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 = [ ]; 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/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 ]; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 0ae76237beed..13523a44cbc5 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3930,6 +3930,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 { };