From 0b854fe73926b31f1f14c7d7bdffd6377887b7e7 Mon Sep 17 00:00:00 2001 From: sinavir Date: Sat, 6 Apr 2024 16:02:36 +0200 Subject: [PATCH] tandoor-recipes: 1.5.12 -> 1.5.16 --- .../misc/tandoor-recipes/common.nix | 6 +++--- .../misc/tandoor-recipes/default.nix | 19 ++++++++++++------- .../misc/tandoor-recipes/pytest-xdist.patch | 12 ++++++++++++ 3 files changed, 27 insertions(+), 10 deletions(-) create mode 100644 pkgs/applications/misc/tandoor-recipes/pytest-xdist.patch diff --git a/pkgs/applications/misc/tandoor-recipes/common.nix b/pkgs/applications/misc/tandoor-recipes/common.nix index 8461ed816eb9..7b0c1f3897d4 100644 --- a/pkgs/applications/misc/tandoor-recipes/common.nix +++ b/pkgs/applications/misc/tandoor-recipes/common.nix @@ -1,15 +1,15 @@ { lib, fetchFromGitHub }: rec { - version = "1.5.12"; + version = "1.5.16"; src = fetchFromGitHub { owner = "TandoorRecipes"; repo = "recipes"; rev = version; - hash = "sha256-5UslXRoiq9cipGCOiqpf+rv7OPTsW4qpVTjakNeg4ug="; + hash = "sha256-A5cPO3uybTmAV8zWY90S9vtU/tLgbh1Iqhi+ty0RLhM="; }; - yarnHash = "sha256-CresovsRh+dLHGnv49fCi/i66QXOS3SnzfFNvkVUfd8="; + yarnHash = "sha256-OAgVaXWTVlKqIgDgKNT1MWN3dYzTqrAGgNAnXLDHE+I="; meta = with lib; { homepage = "https://tandoor.dev/"; diff --git a/pkgs/applications/misc/tandoor-recipes/default.nix b/pkgs/applications/misc/tandoor-recipes/default.nix index dc36156ff4a1..dbf5500494c4 100644 --- a/pkgs/applications/misc/tandoor-recipes/default.nix +++ b/pkgs/applications/misc/tandoor-recipes/default.nix @@ -32,15 +32,15 @@ python.pkgs.pythonPackages.buildPythonPackage rec { format = "other"; patches = [ - # Allow setting MEDIA_ROOT through environment variable - # https://github.com/TandoorRecipes/recipes/pull/2931 - (fetchpatch { - url = "https://github.com/TandoorRecipes/recipes/commit/abf981792057481f1d5b7473eb1090b3901ef8fa.patch"; - hash = "sha256-3AFf0K/BpVwPQ2NGLUsefj6HvW7ej3szd3WaxFoqMiQ="; - }) + ./pytest-xdist.patch # adapt pytest.ini the use $NIX_BUILD_CORES ]; + postPatch = '' + substituteInPlace pytest.ini --subst-var NIX_BUILD_CORES + ''; + propagatedBuildInputs = with python.pkgs; [ + aiohttp beautifulsoup4 bleach bleach-allowlist @@ -50,7 +50,6 @@ python.pkgs.pythonPackages.buildPythonPackage rec { django-allauth django-annoying django-auth-ldap - django-autocomplete-light django-cleanup django-cors-headers django-crispy-forms @@ -132,15 +131,21 @@ python.pkgs.pythonPackages.buildPythonPackage rec { ''; nativeCheckInputs = with python.pkgs; [ + mock pytestCheckHook + pytest-asyncio + pytest-cov pytest-django pytest-factoryboy + pytest-html + pytest-xdist ]; # flaky disabledTests = [ "test_search_count" "test_url_import_regex_replace" + "test_delete" ]; passthru = { diff --git a/pkgs/applications/misc/tandoor-recipes/pytest-xdist.patch b/pkgs/applications/misc/tandoor-recipes/pytest-xdist.patch new file mode 100644 index 000000000000..39b5acf00dea --- /dev/null +++ b/pkgs/applications/misc/tandoor-recipes/pytest-xdist.patch @@ -0,0 +1,12 @@ +diff --git a/pytest.ini b/pytest.ini +index a3d26ec4..8bdf12fb 100644 +--- a/pytest.ini ++++ b/pytest.ini +@@ -3,5 +3,5 @@ DJANGO_SETTINGS_MODULE = recipes.test_settings + testpaths = cookbook/tests + python_files = tests.py test_*.py *_tests.py + # uncomment to run coverage reports +-addopts = -n auto --cov=. --cov-report=html:docs/reports/coverage --cov-report=xml:docs/reports/coverage/coverage.xml --junitxml=docs/reports/tests/pytest.xml --html=docs/reports/tests/tests.html ++addopts = -n @NIX_BUILD_CORES@ --cov=. --cov-report=html:docs/reports/coverage --cov-report=xml:docs/reports/coverage/coverage.xml --junitxml=docs/reports/tests/pytest.xml --html=docs/reports/tests/tests.html + # addopts = -n auto --junitxml=docs/reports/tests/pytest.xml --html=docs/reports/tests/tests.html +\ No newline at end of file