cartha-cli 1.0.2__tar.gz → 1.0.4__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. {cartha_cli-1.0.2 → cartha_cli-1.0.4}/PKG-INFO +1 -1
  2. {cartha_cli-1.0.2 → cartha_cli-1.0.4}/cartha_cli/commands/pair_status.py +1 -1
  3. {cartha_cli-1.0.2 → cartha_cli-1.0.4}/cartha_cli/commands/pools.py +5 -25
  4. {cartha_cli-1.0.2 → cartha_cli-1.0.4}/cartha_cli/commands/prove_lock.py +20 -49
  5. {cartha_cli-1.0.2 → cartha_cli-1.0.4}/pyproject.toml +1 -3
  6. {cartha_cli-1.0.2 → cartha_cli-1.0.4}/.github/workflows/README.md +0 -0
  7. {cartha_cli-1.0.2 → cartha_cli-1.0.4}/.github/workflows/ci.yml +0 -0
  8. {cartha_cli-1.0.2 → cartha_cli-1.0.4}/.gitignore +0 -0
  9. {cartha_cli-1.0.2 → cartha_cli-1.0.4}/.ruff.toml +0 -0
  10. {cartha_cli-1.0.2 → cartha_cli-1.0.4}/CONTRIBUTING.md +0 -0
  11. {cartha_cli-1.0.2 → cartha_cli-1.0.4}/LICENSE +0 -0
  12. {cartha_cli-1.0.2 → cartha_cli-1.0.4}/Makefile +0 -0
  13. {cartha_cli-1.0.2 → cartha_cli-1.0.4}/README.md +0 -0
  14. {cartha_cli-1.0.2 → cartha_cli-1.0.4}/cartha_cli/__init__.py +0 -0
  15. {cartha_cli-1.0.2 → cartha_cli-1.0.4}/cartha_cli/bt.py +0 -0
  16. {cartha_cli-1.0.2 → cartha_cli-1.0.4}/cartha_cli/commands/__init__.py +0 -0
  17. {cartha_cli-1.0.2 → cartha_cli-1.0.4}/cartha_cli/commands/common.py +0 -0
  18. {cartha_cli-1.0.2 → cartha_cli-1.0.4}/cartha_cli/commands/config.py +0 -0
  19. {cartha_cli-1.0.2 → cartha_cli-1.0.4}/cartha_cli/commands/health.py +0 -0
  20. {cartha_cli-1.0.2 → cartha_cli-1.0.4}/cartha_cli/commands/help.py +0 -0
  21. {cartha_cli-1.0.2 → cartha_cli-1.0.4}/cartha_cli/commands/miner_password.py +0 -0
  22. {cartha_cli-1.0.2 → cartha_cli-1.0.4}/cartha_cli/commands/miner_status.py +0 -0
  23. {cartha_cli-1.0.2 → cartha_cli-1.0.4}/cartha_cli/commands/register.py +0 -0
  24. {cartha_cli-1.0.2 → cartha_cli-1.0.4}/cartha_cli/commands/shared_options.py +0 -0
  25. {cartha_cli-1.0.2 → cartha_cli-1.0.4}/cartha_cli/commands/version.py +0 -0
  26. {cartha_cli-1.0.2 → cartha_cli-1.0.4}/cartha_cli/config.py +0 -0
  27. {cartha_cli-1.0.2 → cartha_cli-1.0.4}/cartha_cli/display.py +0 -0
  28. {cartha_cli-1.0.2 → cartha_cli-1.0.4}/cartha_cli/eth712.py +0 -0
  29. {cartha_cli-1.0.2 → cartha_cli-1.0.4}/cartha_cli/main.py +0 -0
  30. {cartha_cli-1.0.2 → cartha_cli-1.0.4}/cartha_cli/pair.py +0 -0
  31. {cartha_cli-1.0.2 → cartha_cli-1.0.4/cartha_cli}/testnet/README.md +0 -0
  32. {cartha_cli-1.0.2 → cartha_cli-1.0.4/cartha_cli}/testnet/__init__.py +0 -0
  33. {cartha_cli-1.0.2 → cartha_cli-1.0.4/cartha_cli}/testnet/pool_ids.py +0 -0
  34. {cartha_cli-1.0.2 → cartha_cli-1.0.4}/cartha_cli/utils.py +0 -0
  35. {cartha_cli-1.0.2 → cartha_cli-1.0.4}/cartha_cli/verifier.py +0 -0
  36. {cartha_cli-1.0.2 → cartha_cli-1.0.4}/cartha_cli/wallet.py +0 -0
  37. {cartha_cli-1.0.2 → cartha_cli-1.0.4}/docs/COMMANDS.md +0 -0
  38. {cartha_cli-1.0.2 → cartha_cli-1.0.4}/docs/FEEDBACK.md +0 -0
  39. {cartha_cli-1.0.2 → cartha_cli-1.0.4}/tests/conftest.py +0 -0
  40. {cartha_cli-1.0.2 → cartha_cli-1.0.4}/tests/test_cli.py +0 -0
  41. {cartha_cli-1.0.2 → cartha_cli-1.0.4}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cartha-cli
3
- Version: 1.0.2
3
+ Version: 1.0.4
4
4
  Summary: CLI utilities for Cartha subnet miners.
5
5
  Project-URL: Homepage, https://cartha.finance
6
6
  Project-URL: Repository, https://github.com/General-Tao-Ventures/cartha-cli
@@ -50,7 +50,7 @@ def _fallback_pool_id_to_name(pool_id: str) -> str | None:
50
50
 
51
51
  # Try to import from testnet module, fallback to default if not available
52
52
  try:
53
- from ...testnet.pool_ids import pool_id_to_name
53
+ from ..testnet.pool_ids import pool_id_to_name
54
54
  except (ImportError, ModuleNotFoundError):
55
55
  # Use fallback function
56
56
  pool_id_to_name = _fallback_pool_id_to_name
@@ -22,36 +22,16 @@ def _fallback_pool_id_to_chain_id(pool_id: str) -> int | None:
22
22
 
23
23
  # Try to import from testnet module, fallback to defaults if not available
24
24
  try:
25
- from ...testnet.pool_ids import (
25
+ from ..testnet.pool_ids import (
26
26
  list_pools,
27
27
  pool_id_to_chain_id,
28
28
  pool_id_to_vault_address,
29
29
  )
30
30
  except (ImportError, ModuleNotFoundError):
31
- # Fallback if running from different context
32
- import sys
33
- from pathlib import Path
34
-
35
- # Try adding parent directory to path
36
- testnet_dir = Path(__file__).parent.parent.parent / "testnet"
37
- if testnet_dir.exists():
38
- sys.path.insert(0, str(testnet_dir.parent))
39
- try:
40
- from testnet.pool_ids import (
41
- list_pools,
42
- pool_id_to_chain_id,
43
- pool_id_to_vault_address,
44
- )
45
- except (ImportError, ModuleNotFoundError):
46
- # Use fallback functions
47
- list_pools = _fallback_list_pools
48
- pool_id_to_vault_address = _fallback_pool_id_to_vault_address
49
- pool_id_to_chain_id = _fallback_pool_id_to_chain_id
50
- else:
51
- # Use fallback functions if testnet directory doesn't exist
52
- list_pools = _fallback_list_pools
53
- pool_id_to_vault_address = _fallback_pool_id_to_vault_address
54
- pool_id_to_chain_id = _fallback_pool_id_to_chain_id
31
+ # Use fallback functions if import failed
32
+ list_pools = _fallback_list_pools
33
+ pool_id_to_vault_address = _fallback_pool_id_to_vault_address
34
+ pool_id_to_chain_id = _fallback_pool_id_to_chain_id
55
35
 
56
36
 
57
37
  def pools(
@@ -86,7 +86,8 @@ def _fallback_vault_address_to_chain_id(vault_address: str) -> int | None:
86
86
 
87
87
  # Try to import from testnet module, fallback to defaults if not available
88
88
  try:
89
- from ...testnet.pool_ids import (
89
+ # Import from cartha_cli.testnet (works both in development and when installed)
90
+ from ..testnet.pool_ids import (
90
91
  format_pool_id,
91
92
  list_pools,
92
93
  pool_id_to_chain_id,
@@ -97,45 +98,15 @@ try:
97
98
  vault_address_to_pool_id,
98
99
  )
99
100
  except (ImportError, ModuleNotFoundError):
100
- # Fallback if running from different context
101
- import sys
102
- from pathlib import Path
103
-
104
- # Try adding parent directory to path
105
- testnet_dir = Path(__file__).parent.parent.parent / "testnet"
106
- if testnet_dir.exists():
107
- sys.path.insert(0, str(testnet_dir.parent))
108
- try:
109
- from testnet.pool_ids import (
110
- format_pool_id,
111
- list_pools,
112
- pool_id_to_chain_id,
113
- pool_id_to_name,
114
- pool_id_to_vault_address,
115
- pool_name_to_id,
116
- vault_address_to_chain_id,
117
- vault_address_to_pool_id,
118
- )
119
- except (ImportError, ModuleNotFoundError):
120
- # Use fallback functions
121
- pool_name_to_id = _fallback_pool_name_to_id
122
- pool_id_to_name = _fallback_pool_id_to_name
123
- format_pool_id = _fallback_format_pool_id
124
- list_pools = _fallback_list_pools
125
- pool_id_to_vault_address = _fallback_pool_id_to_vault_address
126
- vault_address_to_pool_id = _fallback_vault_address_to_pool_id
127
- pool_id_to_chain_id = _fallback_pool_id_to_chain_id
128
- vault_address_to_chain_id = _fallback_vault_address_to_chain_id
129
- else:
130
- # Use fallback functions if testnet directory doesn't exist
131
- pool_name_to_id = _fallback_pool_name_to_id
132
- pool_id_to_name = _fallback_pool_id_to_name
133
- format_pool_id = _fallback_format_pool_id
134
- list_pools = _fallback_list_pools
135
- pool_id_to_vault_address = _fallback_pool_id_to_vault_address
136
- vault_address_to_pool_id = _fallback_vault_address_to_pool_id
137
- pool_id_to_chain_id = _fallback_pool_id_to_chain_id
138
- vault_address_to_chain_id = _fallback_vault_address_to_chain_id
101
+ # Use fallback functions if import failed
102
+ pool_name_to_id = _fallback_pool_name_to_id
103
+ pool_id_to_name = _fallback_pool_id_to_name
104
+ format_pool_id = _fallback_format_pool_id
105
+ list_pools = _fallback_list_pools
106
+ pool_id_to_vault_address = _fallback_pool_id_to_vault_address
107
+ vault_address_to_pool_id = _fallback_vault_address_to_pool_id
108
+ pool_id_to_chain_id = _fallback_pool_id_to_chain_id
109
+ vault_address_to_chain_id = _fallback_vault_address_to_chain_id
139
110
 
140
111
 
141
112
  def prove_lock(
@@ -412,24 +383,24 @@ def prove_lock(
412
383
  auto_chain_id = None
413
384
  try:
414
385
  auto_chain_id = pool_id_to_chain_id(pool_id)
415
- except NameError:
386
+ except (NameError, AttributeError):
416
387
  # Function not available - this shouldn't happen if imports worked
417
388
  # But handle gracefully by trying to import it
418
389
  try:
419
- from testnet.pool_ids import pool_id_to_chain_id
390
+ from ..testnet.pool_ids import pool_id_to_chain_id
420
391
  auto_chain_id = pool_id_to_chain_id(pool_id)
421
- except ImportError:
392
+ except (ImportError, ModuleNotFoundError):
422
393
  pass
423
394
 
424
395
  if not auto_chain_id:
425
396
  # Fallback: try to get from vault address
426
397
  try:
427
398
  auto_chain_id = vault_address_to_chain_id(vault)
428
- except NameError:
399
+ except (NameError, AttributeError):
429
400
  try:
430
- from testnet.pool_ids import vault_address_to_chain_id
401
+ from ..testnet.pool_ids import vault_address_to_chain_id
431
402
  auto_chain_id = vault_address_to_chain_id(vault)
432
- except ImportError:
403
+ except (ImportError, ModuleNotFoundError):
433
404
  pass
434
405
 
435
406
  if auto_chain_id:
@@ -460,11 +431,11 @@ def prove_lock(
460
431
  expected_chain_id = None
461
432
  try:
462
433
  expected_chain_id = vault_address_to_chain_id(vault)
463
- except NameError:
434
+ except (NameError, AttributeError):
464
435
  try:
465
- from testnet.pool_ids import vault_address_to_chain_id
436
+ from ..testnet.pool_ids import vault_address_to_chain_id
466
437
  expected_chain_id = vault_address_to_chain_id(vault)
467
- except ImportError:
438
+ except (ImportError, ModuleNotFoundError):
468
439
  pass
469
440
 
470
441
  if expected_chain_id and expected_chain_id != chain:
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "cartha-cli"
7
- version = "1.0.2"
7
+ version = "1.0.4"
8
8
  description = "CLI utilities for Cartha subnet miners."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11,<3.12"
@@ -51,5 +51,3 @@ cartha = "cartha_cli:main"
51
51
  addopts = "-ra"
52
52
  testpaths = ["tests"]
53
53
 
54
- [tool.hatchling.build.targets.wheel]
55
- packages = ["cartha_cli", "testnet"]
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
File without changes
File without changes