Fix plugin loading type annotations and improve code readability#4524
Fix plugin loading type annotations and improve code readability#4524hariomphulre wants to merge 4 commits into
Conversation
|
Hello, anyone can review it plz... @svartkanin @codefiles @Torxed |
|
Hi. A_Course_Wishes.cpp is empty. Was this intentional? |
ohh, its just bymistake created. |
|
i deleted it. |
|
@Torxed please review it. |
|
@hariomphulre what kind of tests have you tried for this patch? |
|
|
||
|
|
||
| def load_plugin(path: Path) -> None: | ||
| def load_plugin(path: str | Path) -> None: |
There was a problem hiding this comment.
This is no longer a Path so that should be removed
| namespace: str | None = None | ||
| parsed_url = urllib.parse.urlparse(str(path)) | ||
| # Keep URL as string to preserve scheme (avoid Path normalization) | ||
| path_str = str(path) if isinstance(path, Path) else path |
There was a problem hiding this comment.
This can't be a Path anymore
| plugin_path = Path(args.plugin) | ||
| load_plugin(plugin_path) | ||
| # Pass plugin as string to preserve URL format (avoid Path normalization) | ||
| load_plugin(args.plugin) |
There was a problem hiding this comment.
At this point plugin can be either pointing to a local file or a url which does not correlate with the actual arg defintion
archinstall/archinstall/lib/args.py
Line 408 in dcc38fe
Instead I'm proposing to introduce a --plugin-url instead to clearly differentiate between them. This also aligns with the config arguments
archinstall/archinstall/lib/args.py
Line 314 in dcc38fe
bd1c0dc to
34c6fc4
Compare
|
Now check |
Pass plugin paths as strings so HTTPS URLs are not mangled by pathlib. Fix mixed tab/space indentation in ArchConfig.from_config that broke imports. Harden plugin import (spec handling, failed-import cleanup), and skip version comparison when version tuples are empty. Add tests for URL handling and HTTP rejection. Co-authored-by: Cursor <cursoragent@cursor.com>
|
@Torxed @svartkanin hello, now plz review it and approve jobs |
|
What do you want me to review here? None of the comments have been addressed |
Fix: Plugin loading with URL support
Issue: Plugin loading failed when using remote URLs due to Path normalization
Changes:
urllib.errorimport for proper error handling_localize_path()to acceptstr | Pathos.path.basename()load_plugin()to acceptstr | PathImpact:
@codefiles