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 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 searx/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 mweinelt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noted for the next time and fixed

@Mic92 Mic92 merged commit f3d1942 into NixOS:master Jun 23, 2020
@jojosch jojosch deleted the searx-werkzeug-import branch June 23, 2020 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants