-
Notifications
You must be signed in to change notification settings - Fork 2.3k
[mod] addition of various type hints / engine processors #5204
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
Conversation
2e2ef7a to
4a539df
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR continues the typification work from #5147 by adding type hints and improving engine processors. It introduces structured request parameter types for different engine types, removes obsolete engine properties, and enhances the currency conversion functionality.
Key changes:
- Adds comprehensive type annotations to all engine processors and their parameter types
- Introduces type-safe parameter classes (OnlineParams, OnlineDictParams, OnlineCurrenciesParams) for different engine types
- Replaces the old engine initialization system with a new setup/init pattern allowing asynchronous initialization
- Removes the obsolete
https_supportproperty from engines
Reviewed Changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| searx/search/processors/*.py | Complete type annotation overhaul for all processor classes with structured parameter types |
| searx/engines/*.py | Updates to use new parameter types and removal of obsolete properties |
| searx/data/currencies.py | Enhanced with type annotations and improved currency validation methods |
| searx/search/models.py | Type refinements for SearchQuery class with literal types for enums |
| tests/unit/*.py | Updated to match new processor initialization patterns |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Continuation of searxng#5147 .. typification of the engine processors. BTW: - removed obsolete engine property https_support - fixed & improved currency_convert - engine instances can now implement a engine.setup method [searxng#5147] searxng#5147 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
4a539df to
a0d1c87
Compare
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
a0d1c87 to
6433c4f
Compare
Commit 8f8343d [1] introduced a bug in the network logic of SearXNG where stream requests (such as the one from the image proxy) would fail because a wrapper was returned instead of a response object with the correct attribute. This is just a quick in place fix I implemented to get it working again. It would be better to implement corresponding logic to give stream requests the correct object. [1] searxng#5204
Commit 8f8343d [1] introduced a bug in the network logic of SearXNG where stream requests (such as the one from the image proxy) would fail because a wrapper was returned instead of a response object with the correct attribute. This is just a quick in place fix I implemented to get it working again. It would be better to implement corresponding logic to give stream requests the correct object. [1] #5204
This patch is a leftover from PR-5204 [1]. [1] searxng#5204 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This patch is a leftover from PR-5204 [1]. [1] searxng#5204 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This patch is a leftover from PR-5204 [1]. [1] searxng#5204 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This patch is a leftover from PR-5204 [1]. [1] searxng#5204 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
…ring
Issue was introduced by PR-5204 [1]
reported issue::
logger.error("init method of engine %s failed (%s).", eng_proc.engine.name)
TypeError: not enough arguments for format string
[1] searxng#5204
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This patch is a leftover from PR-5204 [1]. [1] searxng#5204 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This patch is a leftover from PR-5204 [1]. [1] searxng#5204 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This patch is a leftover from PR-5204 [1]. [1] #5204 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Continuation of #5147 .. typification of the engine processors.
BTW:
engine.setup()method