Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

searx: fix werkzeug.contrib import #91356

Merged
merged 1 commit into from Jun 23, 2020
Merged

Conversation

@jojosch
Copy link
Member

jojosch commented Jun 23, 2020

Motivation for this change

Building searx failed with the following error message:

tests.unit.test_webapp (unittest.loader._FailedTest) ... ERROR

======================================================================
ERROR: webapp (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: webapp
Traceback (most recent call last):
  File "/nix/store/jli50q24fvik6pfsnjs1jd90g3dy4p6y-python3-3.8.3/lib/python3.8/unittest/loader.py", line 154, in loadTestsFromName
    module = __import__(module_name)
  File "/build/source/searx/webapp.py", line 50, in <module>
    from werkzeug.contrib.fixers import ProxyFix
ModuleNotFoundError: No module named 'werkzeug.contrib'


======================================================================
ERROR: test_webapp (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: test_webapp
Traceback (most recent call last):
  File "/nix/store/jli50q24fvik6pfsnjs1jd90g3dy4p6y-python3-3.8.3/lib/python3.8/unittest/loader.py", line 154, in loadTestsFromName
    module = __import__(module_name)
  File "/build/source/tests/unit/test_webapp.py", line 5, in <module>
    from searx import webapp
  File "/build/source/searx/webapp.py", line 50, in <module>
    from werkzeug.contrib.fixers import ProxyFix
ModuleNotFoundError: No module named 'werkzeug.contrib'


======================================================================
ERROR: tests.unit.test_webapp (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: tests.unit.test_webapp
Traceback (most recent call last):
  File "/nix/store/jli50q24fvik6pfsnjs1jd90g3dy4p6y-python3-3.8.3/lib/python3.8/unittest/loader.py", line 436, in _find_test_path
    module = self._get_module_from_name(name)
  File "/nix/store/jli50q24fvik6pfsnjs1jd90g3dy4p6y-python3-3.8.3/lib/python3.8/unittest/loader.py", line 377, in _get_module_from_name
    __import__(name)
  File "/build/source/tests/unit/test_webapp.py", line 5, in <module>
    from searx import webapp
  File "/build/source/searx/webapp.py", line 50, in <module>
    from werkzeug.contrib.fixers import ProxyFix
ModuleNotFoundError: No module named 'werkzeug.contrib'


----------------------------------------------------------------------
Ran 61 tests in 0.110s

FAILED (errors=3)
Test failed: <unittest.runner.TextTestResult run=61 errors=3 failures=0>
error: Test failed: <unittest.runner.TextTestResult run=61 errors=3 failures=0>
builder for '/nix/store/844dfa093nh0g1913wd5njv6fqsr5w3h-searx-0.16.0.drv' failed with exit code 1
error: build of '/nix/store/844dfa093nh0g1913wd5njv6fqsr5w3h-searx-0.16.0.drv' failed
Things done

Applied the patch from upstream asciimoo/searx#1831.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Copy link
Member

mweinelt left a comment

If this is the verbatim upstream patch you could also use fetchpatch and have it grab https://github.com/asciimoo/searx/commit/ab1b1ac358089d446d409026ee2a51cead2179fd.patch.

Otherwise LGTM.

@jojosch
Copy link
Member Author

jojosch commented Jun 23, 2020

@mweinelt using fetchpatch now.

@@ -14,6 +14,11 @@ buildPythonApplication rec {
sha256 = "0hfa4nmis98yvghxw866rzjpmhb2ln8l6l8g9yx4m79b2lk76xcs";
};

patches = [(fetchpatch {
url = "https://github.com/asciimoo/searx/commit/b8b13372c8fd3bfe978a1c724ab98b05348df054.patch";
sha256 = "0wrcywxihxiz1dka3mjbzprv8qznan0x4b0qjn0zfd8167pdwnk2";

This comment has been minimized.

Copy link
@mweinelt

mweinelt Jun 23, 2020

Member

Please note that fetchpatch is not compatible with hashes returned by nix-prefetch-url.

This comment has been minimized.

Copy link
@jojosch

jojosch Jun 23, 2020

Author Member

noted for the next time and fixed

@jojosch jojosch force-pushed the jojosch:searx-werkzeug-import branch from cbe65ca to dec248b Jun 23, 2020
@Mic92 Mic92 merged commit f3d1942 into NixOS:master Jun 23, 2020
16 checks passed
16 checks passed
Evaluation Performance Report Evaluator Performance Report
Details
grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-maintainers matching changed paths to changed attrs...
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="dec248b"; rev="dec248b07f8a1f650e148dc632992630de473496"; } ./pkgs/t
Details
grahamcofborg-eval-lib-tests nix-build --arg pkgs import ./. {} ./lib/tests/release.nix
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="dec248b"; rev="dec248b07f8a1f650e148dc632992630de473496"; } ./nixos/
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="dec248b"; rev="dec248b07f8a1f650e148dc632992630de473496"; } ./nixos/
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="dec248b"; rev="dec248b07f8a1f650e148dc632992630de473496"; } ./nixos/
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="dec248b"; rev="dec248b07f8a1f650e148dc632992630de473496"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="dec248b"; rev="dec248b07f8a1f650e148dc632992630de473496"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="dec248b"; rev="dec248b07f8a1f650e148dc632992630de473496"; } ./pkgs/t
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
searx, searx.passthru.tests on aarch64-linux Success
Details
searx, searx.passthru.tests on x86_64-linux Success
Details
@jojosch jojosch deleted the jojosch:searx-werkzeug-import branch Jun 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.