flyshell 1.2.9__tar.gz → 1.2.11__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. {flyshell-1.2.9/src/flyshell.egg-info → flyshell-1.2.11}/PKG-INFO +1 -1
  2. {flyshell-1.2.9 → flyshell-1.2.11}/src/flyshell/constants.py +2 -2
  3. {flyshell-1.2.9 → flyshell-1.2.11}/src/flyshell/core/env.py +0 -2
  4. {flyshell-1.2.9 → flyshell-1.2.11}/src/flyshell/core/loader.py +36 -2
  5. {flyshell-1.2.9 → flyshell-1.2.11}/src/flyshell/main.py +1 -0
  6. {flyshell-1.2.9 → flyshell-1.2.11/src/flyshell.egg-info}/PKG-INFO +1 -1
  7. {flyshell-1.2.9 → flyshell-1.2.11}/tests/test_env_keys.py +0 -1
  8. {flyshell-1.2.9 → flyshell-1.2.11}/LICENSE +0 -0
  9. {flyshell-1.2.9 → flyshell-1.2.11}/README.md +0 -0
  10. {flyshell-1.2.9 → flyshell-1.2.11}/pyproject.toml +0 -0
  11. {flyshell-1.2.9 → flyshell-1.2.11}/setup.cfg +0 -0
  12. {flyshell-1.2.9 → flyshell-1.2.11}/src/flyshell/__init__.py +0 -0
  13. {flyshell-1.2.9 → flyshell-1.2.11}/src/flyshell/abstract/__init__.py +0 -0
  14. {flyshell-1.2.9 → flyshell-1.2.11}/src/flyshell/abstract/base_cmd.py +0 -0
  15. {flyshell-1.2.9 → flyshell-1.2.11}/src/flyshell/abstract/base_plugin.py +0 -0
  16. {flyshell-1.2.9 → flyshell-1.2.11}/src/flyshell/abstract/parent_cmd.py +0 -0
  17. {flyshell-1.2.9 → flyshell-1.2.11}/src/flyshell/builtin/__init__.py +0 -0
  18. {flyshell-1.2.9 → flyshell-1.2.11}/src/flyshell/builtin/diskops.py +0 -0
  19. {flyshell-1.2.9 → flyshell-1.2.11}/src/flyshell/builtin/fs.py +0 -0
  20. {flyshell-1.2.9 → flyshell-1.2.11}/src/flyshell/builtin/pkg.py +0 -0
  21. {flyshell-1.2.9 → flyshell-1.2.11}/src/flyshell/builtin/system.py +0 -0
  22. {flyshell-1.2.9 → flyshell-1.2.11}/src/flyshell/builtin/utils.py +0 -0
  23. {flyshell-1.2.9 → flyshell-1.2.11}/src/flyshell/core/__init__.py +0 -0
  24. {flyshell-1.2.9 → flyshell-1.2.11}/src/flyshell/core/auth.py +0 -0
  25. {flyshell-1.2.9 → flyshell-1.2.11}/src/flyshell/core/console.py +0 -0
  26. {flyshell-1.2.9 → flyshell-1.2.11}/src/flyshell/core/data.py +0 -0
  27. {flyshell-1.2.9 → flyshell-1.2.11}/src/flyshell/core/directory.py +0 -0
  28. {flyshell-1.2.9 → flyshell-1.2.11}/src/flyshell.egg-info/SOURCES.txt +0 -0
  29. {flyshell-1.2.9 → flyshell-1.2.11}/src/flyshell.egg-info/dependency_links.txt +0 -0
  30. {flyshell-1.2.9 → flyshell-1.2.11}/src/flyshell.egg-info/entry_points.txt +0 -0
  31. {flyshell-1.2.9 → flyshell-1.2.11}/src/flyshell.egg-info/requires.txt +0 -0
  32. {flyshell-1.2.9 → flyshell-1.2.11}/src/flyshell.egg-info/top_level.txt +0 -0
  33. {flyshell-1.2.9 → flyshell-1.2.11}/tests/test_auth.py +0 -0
  34. {flyshell-1.2.9 → flyshell-1.2.11}/tests/test_data.py +0 -0
  35. {flyshell-1.2.9 → flyshell-1.2.11}/tests/test_directory.py +0 -0
  36. {flyshell-1.2.9 → flyshell-1.2.11}/tests/test_diskops.py +0 -0
  37. {flyshell-1.2.9 → flyshell-1.2.11}/tests/test_fs.py +0 -0
  38. {flyshell-1.2.9 → flyshell-1.2.11}/tests/test_loader.py +0 -0
  39. {flyshell-1.2.9 → flyshell-1.2.11}/tests/test_pkg.py +0 -0
  40. {flyshell-1.2.9 → flyshell-1.2.11}/tests/test_security.py +0 -0
  41. {flyshell-1.2.9 → flyshell-1.2.11}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flyshell
3
- Version: 1.2.9
3
+ Version: 1.2.11
4
4
  Summary: A modular, zero-dependency command-line environment in Python.
5
5
  License: MIT
6
6
  Requires-Python: >=3.10
@@ -5,8 +5,8 @@ import os
5
5
  import platform
6
6
  import time
7
7
 
8
- BUILD = 134
9
- VERSION = "1.2.9"
8
+ BUILD = 136
9
+ VERSION = "1.2.11"
10
10
 
11
11
 
12
12
  def _resolve_app_dir() -> Path:
@@ -39,7 +39,6 @@ def read_env_file() -> dict[str, str]:
39
39
 
40
40
 
41
41
  def _resolve_plugin_dir_name(target_name: str) -> tuple[str, object | None]:
42
- """Resolves an identifier, display name, or dir name to (dir_name, plugin_instance)."""
43
42
  target_lower = target_name.strip().lower()
44
43
  if hasattr(c, "PLUGINS"):
45
44
  if target_lower in c.PLUGINS:
@@ -85,7 +84,6 @@ def get_plugin_api_keys(plugin_name_or_dir: str) -> dict[str, str]:
85
84
 
86
85
 
87
86
  def get_all_keys() -> tuple[int, str]:
88
- """Retrieve and display all configured API keys in the environment."""
89
87
  env_path = get_env_path()
90
88
  if not env_path.exists():
91
89
  return (1, f"File Config Error: Environment file not found at '{env_path}'.")
@@ -58,7 +58,10 @@ def scan_plugins(plugin_folder=None):
58
58
  ctx = build_context(resolved_name, default_name, file_path)
59
59
  required_keys = getattr(obj, "api_keys", [])
60
60
  found_keys = ctx["api_keys"]
61
- missing_keys = [k for k in required_keys if k not in found_keys]
61
+ found_keys_lower = {k.lower(): v for k, v in found_keys.items()}
62
+ missing_keys = [
63
+ k for k in required_keys if k.lower() not in found_keys_lower
64
+ ]
62
65
  if missing_keys:
63
66
  env_file = ctx["env_path"]
64
67
  print(
@@ -67,7 +70,7 @@ def scan_plugins(plugin_folder=None):
67
70
  print(f"Please define them in: {env_file} as:")
68
71
  for mk in missing_keys:
69
72
  print(f"{default_name}_{mk}=<your_key>")
70
- break
73
+ print("You can do this once Flyshell has booted.")
71
74
  instance = obj(ctx)
72
75
  candidates.setdefault(resolved_name, []).append(
73
76
  (instance, file_path)
@@ -114,3 +117,34 @@ def build_context(plugin_name, default_name, file_path=None):
114
117
  "storage": plugin_storage,
115
118
  }
116
119
  return context
120
+
121
+
122
+ def check_plugin_api_keys():
123
+ if not c.PLUGINS:
124
+ return
125
+ print("\nFlyshell will now check plugin API keys.")
126
+ has_keys_to_report = False
127
+ for identifier, plugin in c.PLUGINS.items():
128
+ required_keys = getattr(plugin, "api_keys", [])
129
+ configured_keys = getattr(plugin, "api_keys_data", {})
130
+ dir_name = plugin.context.get("plugin_dir_name", identifier)
131
+ if not required_keys and not configured_keys:
132
+ continue
133
+ has_keys_to_report = True
134
+ configured_lookup = {k.lower(): (k, v) for k, v in configured_keys.items()}
135
+ seen_keys = set()
136
+ print(f"\nPlugin: {plugin.name} ({identifier})")
137
+ for req in required_keys:
138
+ req_lower = req.lower()
139
+ seen_keys.add(req_lower)
140
+ if req_lower in configured_lookup:
141
+ orig_k, _ = configured_lookup[req_lower]
142
+ print(f"✅ {orig_k} - Key found [Required]")
143
+ else:
144
+ print(f"⚠️ {req} - KEY NOT FOUND [Required]")
145
+ print(f"Please define in the .env file as: {dir_name}_{req}=<your_key>")
146
+ for k_lower, (orig_k, _) in sorted(configured_lookup.items()):
147
+ if k_lower not in seen_keys:
148
+ print(f"✅ {orig_k} - Key found [Optional/Extra]")
149
+ if not has_keys_to_report:
150
+ print("✅ No API keys required for any loaded plugins.")
@@ -82,6 +82,7 @@ def main():
82
82
  print(f"\nYour OS '{c.HOST_OS}' is compatible with Flyshell.")
83
83
  print("Flyshell will now boot.")
84
84
  loader.scan_plugins()
85
+ loader.check_plugin_api_keys()
85
86
  if auth.login_flow():
86
87
  console.boot()
87
88
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flyshell
3
- Version: 1.2.9
3
+ Version: 1.2.11
4
4
  Summary: A modular, zero-dependency command-line environment in Python.
5
5
  License: MIT
6
6
  Requires-Python: >=3.10
@@ -82,7 +82,6 @@ def test_loader_rejects_plugin_with_missing_keys(
82
82
  )
83
83
  monkeypatch.setattr(c, "USER_PLUGIN_DIR", tmp_path)
84
84
  loader.scan_plugins(plugin_folder=tmp_path)
85
- assert "needkey" not in c.PLUGINS
86
85
  out = capsys.readouterr().out
87
86
  assert "API Key Error" in out
88
87
  assert "second" in out
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes