ngpt 2.11.1__py3-none-any.whl → 2.11.2__py3-none-any.whl

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.
ngpt/utils/cli_config.py CHANGED
@@ -212,7 +212,13 @@ def apply_cli_config(args: Any, mode: str) -> Any:
212
212
  # Keep track of applied exclusive options
213
213
  applied_exclusives = set()
214
214
 
215
- # For each option in CLI config, check if it should be applied
215
+ # First pass: Check explicitly set args and track their exclusive options
216
+ for option in CLI_CONFIG_OPTIONS:
217
+ cli_option = f"--{option}"
218
+ if cli_option in explicit_args and "exclusive" in CLI_CONFIG_OPTIONS[option]:
219
+ applied_exclusives.update(CLI_CONFIG_OPTIONS[option]["exclusive"])
220
+
221
+ # Second pass: Apply CLI config options
216
222
  for option, value in cli_config.items():
217
223
  # Skip if not a valid option
218
224
  if option not in CLI_CONFIG_OPTIONS:
@@ -227,12 +233,8 @@ def apply_cli_config(args: Any, mode: str) -> Any:
227
233
  arg_name = option.replace("-", "_")
228
234
 
229
235
  # Skip if explicitly set via command line
230
- # Check common variants like --option
231
236
  cli_option = f"--{option}"
232
237
  if cli_option in explicit_args:
233
- # Add to applied_exclusives if this option has exclusivity constraints
234
- if "exclusive" in CLI_CONFIG_OPTIONS[option]:
235
- applied_exclusives.update(CLI_CONFIG_OPTIONS[option]["exclusive"])
236
238
  continue
237
239
 
238
240
  # Skip if an exclusive option has already been applied
@@ -240,7 +242,6 @@ def apply_cli_config(args: Any, mode: str) -> Any:
240
242
  continue
241
243
 
242
244
  # Check exclusivity constraints against *explicitly set* args
243
- # Don't apply a CLI config option if an exclusive option was explicitly set
244
245
  if "exclusive" in CLI_CONFIG_OPTIONS[option]:
245
246
  skip = False
246
247
  for excl_option in CLI_CONFIG_OPTIONS[option]["exclusive"]:
@@ -250,14 +251,23 @@ def apply_cli_config(args: Any, mode: str) -> Any:
250
251
  break # Skip applying this CLI config value
251
252
  if skip:
252
253
  continue
253
-
254
- # If we're applying this option, add its exclusives to the tracking set
255
- applied_exclusives.update(CLI_CONFIG_OPTIONS[option]["exclusive"])
256
-
254
+
257
255
  # Apply the value from CLI config
258
256
  # Ensure the attribute exists on args before setting
259
257
  if hasattr(args, arg_name):
260
258
  setattr(args, arg_name, value)
259
+
260
+ # For boolean options that are True, explicitly disable their exclusive options
261
+ option_type = CLI_CONFIG_OPTIONS[option]["type"]
262
+ if option_type == "bool" and value is True and "exclusive" in CLI_CONFIG_OPTIONS[option]:
263
+ for excl_option in CLI_CONFIG_OPTIONS[option]["exclusive"]:
264
+ # Convert to argparse naming and set to False if the attribute exists
265
+ excl_arg_name = excl_option.replace("-", "_")
266
+ if hasattr(args, excl_arg_name):
267
+ setattr(args, excl_arg_name, False)
268
+
269
+ # Add exclusives to tracking set to prevent them from being applied
270
+ applied_exclusives.update(CLI_CONFIG_OPTIONS[option]["exclusive"])
261
271
 
262
272
  return args
263
273
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ngpt
3
- Version: 2.11.1
3
+ Version: 2.11.2
4
4
  Summary: A lightweight Python CLI and library for interacting with OpenAI-compatible APIs, supporting both official and self-hosted LLM endpoints.
5
5
  Project-URL: Homepage, https://github.com/nazdridoy/ngpt
6
6
  Project-URL: Repository, https://github.com/nazdridoy/ngpt
@@ -15,11 +15,11 @@ ngpt/cli/modes/code.py,sha256=bFE6x_CUncOM0gyAHOpcJs6nxj_ljFK0AYwJiT1Ndaw,4332
15
15
  ngpt/cli/modes/shell.py,sha256=oqqEqWdqcH5q4pmis-hT9ZEFNk9-kaKHHdpRu217u5A,2721
16
16
  ngpt/cli/modes/text.py,sha256=sUhgE5XubYxksnQDUvnCFrEbqz1G-CS_iWZZMGkULcI,3179
17
17
  ngpt/utils/__init__.py,sha256=E46suk2-QgYBI0Qrs6WXOajOUOebF3ETAFY7ah8DTWs,942
18
- ngpt/utils/cli_config.py,sha256=fUtahEUJlFt1cguIXrfHk0exn6O1qnm50uTKAgvtySc,9984
18
+ ngpt/utils/cli_config.py,sha256=_epz6MzSBOiE6cMkQDggkzfRRV5gga4eg-2UW955GrM,10545
19
19
  ngpt/utils/config.py,sha256=WYOk_b1eiYjo6hpV3pfXr2RjqhOnmKqwZwKid1T41I4,10363
20
20
  ngpt/utils/log.py,sha256=Bxv2-GbWtVYa3u94Zs_OVEvYk_CbuT5hrDH06KHLXa8,6369
21
- ngpt-2.11.1.dist-info/METADATA,sha256=8M9Vs0Me23qWxlCcuaynSHwC_xVuNOOfI4_s69OXN08,20627
22
- ngpt-2.11.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
23
- ngpt-2.11.1.dist-info/entry_points.txt,sha256=1cnAMujyy34DlOahrJg19lePSnb08bLbkUs_kVerqdk,39
24
- ngpt-2.11.1.dist-info/licenses/LICENSE,sha256=mQkpWoADxbHqE0HRefYLJdm7OpdrXBr3vNv5bZ8w72M,1065
25
- ngpt-2.11.1.dist-info/RECORD,,
21
+ ngpt-2.11.2.dist-info/METADATA,sha256=XpjOCWolqeW9YKDL_VQCITLYcDxedgDCQCrxnzlcLr4,20627
22
+ ngpt-2.11.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
23
+ ngpt-2.11.2.dist-info/entry_points.txt,sha256=1cnAMujyy34DlOahrJg19lePSnb08bLbkUs_kVerqdk,39
24
+ ngpt-2.11.2.dist-info/licenses/LICENSE,sha256=mQkpWoADxbHqE0HRefYLJdm7OpdrXBr3vNv5bZ8w72M,1065
25
+ ngpt-2.11.2.dist-info/RECORD,,
File without changes