clapp-pm 1.0.6__py3-none-any.whl → 1.0.8__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: clapp-pm
3
- Version: 1.0.6
3
+ Version: 1.0.8
4
4
  Summary: Lightweight cross-language app manager for Python and Lua
5
5
  Home-page: https://github.com/mburakmmm/clapp
6
6
  Author: Melih Burak Memiş
@@ -1,14 +1,14 @@
1
1
  check_env.py,sha256=5DJwdALpRe1TLbzF_Zta-zD312J065-pPmsJZ17xRDg,4425
2
2
  clapp_core.py,sha256=5tkzt7J4GKSv7Chv5Zoe9N0dv_sWlYGqYxmIn3dhEPY,1764
3
3
  clean_command.py,sha256=nmzitkdNo0Ovgi-tGPUxa9mkAIFzwEzGNaTm82MUdvw,6806
4
- cli_commands.py,sha256=ffJeRJTeipzHkSXhIUKrGzmymqtuv9bKCCQ2WGMQUD4,12482
5
- dependency_resolver.py,sha256=slskJhZJ5rRIv0Gcefd-cakHxdYl45bPwE4s_0APpsA,8562
4
+ cli_commands.py,sha256=7tXrBE0pPkuaFIbsIGXg3RxH7GwisL-Zz2N2oMGe2GQ,12682
5
+ dependency_resolver.py,sha256=Dzrg2LvXYkmMYKgpafIFiZMIxDL4zTBjfQPuSB99bW0,16872
6
6
  doctor_command.py,sha256=jLnvpU9Oglq553bwgF7fhAcUChZTMD2Qle9ZxNHPefc,7680
7
7
  info_command.py,sha256=b74Pl1-x_PSezALx-lS3FkEcVNTF7a9McTKk5XTDhjM,5629
8
- install_command.py,sha256=jnvTjgJjBiohIlcHf-74EW8cxZqx8vcirnZ3k2O-sgw,7907
8
+ install_command.py,sha256=Yj884DDYFANrCISg17-3zRQdwFaobHgvSjtemlUtEfw,9353
9
9
  installer.py,sha256=EkQ5Z1Cq_Z5u_Ssv2Nc8hryI5E97x4D1QVjSqEHe0dE,10619
10
10
  list_command.py,sha256=qbeocvrg2eXRklxbYS3audQhYHGXTlMBk_tNh1cMxd0,8391
11
- main.py,sha256=aLwnLGv5AOjRsEBCyJKANKFKccpGEEo8PNe2_Mgm7w4,11806
11
+ main.py,sha256=pt57hhDVj_rqGYR9Z4_lD8d9vZv0BVBFARSiV350OZI,14492
12
12
  manifest_schema.py,sha256=IxfKuYgcIhILJrDMOm5vjSJn2jp7hPpUoxtjPMCPvbE,2201
13
13
  manifest_validator.py,sha256=MTI6c_sYfVakQ6aQUu5_qkukTh4H1FcSrT4uRdE6xIg,7990
14
14
  package_registry.py,sha256=Rco15cvz-6lpCEDdCzwGZNCKtvVhlFIsEPy-WFAESMM,4233
@@ -29,16 +29,16 @@ clapp-packages-repo/packages/test-app/main.py,sha256=rN4Zo9u53bIVjcUlul059knx6v-
29
29
  clapp-packages-repo/packages/test-app/manifest.json,sha256=kJe4sjYdPRNZD5hEeca80jj3lxeEWBMJoZ59RW7tiKI,118
30
30
  clapp-packages-repo/packages/test-app2/main.py,sha256=lHkbjTmehFY4VuYYF2dYiVBH7W0oqHHeY0I5W85iPTY,35
31
31
  clapp-packages-repo/packages/test-app2/manifest.json,sha256=vshXJrtRxBc_ISM6E8KT5BSmveMbjWszenlgxgSN86w,121
32
- clapp_pm-1.0.6.data/data/version.json,sha256=S7yOmQU4A-UqpUE3AX0vmjehgSS--fxuVEPG1YcIvDo,238
33
- clapp_pm-1.0.6.dist-info/licenses/LICENSE,sha256=_hryv9pKR6udRexceUYuoYCJGmYBz7e-vRuFWmm38UY,1075
32
+ clapp_pm-1.0.8.data/data/version.json,sha256=S7yOmQU4A-UqpUE3AX0vmjehgSS--fxuVEPG1YcIvDo,238
33
+ clapp_pm-1.0.8.dist-info/licenses/LICENSE,sha256=_hryv9pKR6udRexceUYuoYCJGmYBz7e-vRuFWmm38UY,1075
34
34
  packages/hello-python/main.py,sha256=Dy-Ov-Vumj8oQYI6qKWU6fIKD0gCB8b7KzAJVrGyLMg,1429
35
35
  packages/hello-python/manifest.json,sha256=fJOVJk_2rwpRJ6IeWMPieklJD3gAR279jvuqRH69s90,179
36
36
  packages/test-app/main.py,sha256=rN4Zo9u53bIVjcUlul059knx6v-2Cd1MFftPS57FIRU,33
37
37
  packages/test-app/manifest.json,sha256=kJe4sjYdPRNZD5hEeca80jj3lxeEWBMJoZ59RW7tiKI,118
38
38
  packages/test-app2/main.py,sha256=lHkbjTmehFY4VuYYF2dYiVBH7W0oqHHeY0I5W85iPTY,35
39
39
  packages/test-app2/manifest.json,sha256=vshXJrtRxBc_ISM6E8KT5BSmveMbjWszenlgxgSN86w,121
40
- clapp_pm-1.0.6.dist-info/METADATA,sha256=fR3YBXHuGhZGI-gaVl-g7-GIRXW3D2pd783IhGax55M,3979
41
- clapp_pm-1.0.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
42
- clapp_pm-1.0.6.dist-info/entry_points.txt,sha256=7j-3pQVpQfnaVzUV83g7zlCA30ePlnXkhHLAGGz9xrQ,36
43
- clapp_pm-1.0.6.dist-info/top_level.txt,sha256=90PY3qqc7ZdaDsLvwHtQiUG0OZqpsjxw_zkjiTTFY0I,351
44
- clapp_pm-1.0.6.dist-info/RECORD,,
40
+ clapp_pm-1.0.8.dist-info/METADATA,sha256=l3YAaufrnJXZB0d79q5I5QSC-LT5kC89F7Pdeu3986o,3979
41
+ clapp_pm-1.0.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
42
+ clapp_pm-1.0.8.dist-info/entry_points.txt,sha256=7j-3pQVpQfnaVzUV83g7zlCA30ePlnXkhHLAGGz9xrQ,36
43
+ clapp_pm-1.0.8.dist-info/top_level.txt,sha256=90PY3qqc7ZdaDsLvwHtQiUG0OZqpsjxw_zkjiTTFY0I,351
44
+ clapp_pm-1.0.8.dist-info/RECORD,,
cli_commands.py CHANGED
@@ -11,6 +11,7 @@ from publish_command import publish_app
11
11
  from install_command import install_app
12
12
  from uninstall_command import uninstall_app
13
13
  from list_command import list_apps
14
+ from version_command import print_version
14
15
 
15
16
  def install_from_remote(app_name, force=False):
16
17
  """
@@ -385,8 +386,13 @@ def handle_uninstall_command(args):
385
386
 
386
387
  return uninstall_from_local(args.app_name, args.yes)
387
388
 
389
+ def handle_version_command(args):
390
+ """Version komutunu işler"""
391
+ format_type = getattr(args, 'format', 'default')
392
+ return print_version(format_type)
393
+
388
394
  def handle_list_command(args):
389
- """List komutunu işler"""
395
+ """List komutu işler"""
390
396
  format_type = getattr(args, 'format', 'table')
391
397
  language_filter = getattr(args, 'language', None)
392
398
  search_term = getattr(args, 'search', None)
dependency_resolver.py CHANGED
@@ -1,5 +1,10 @@
1
1
  import os
2
- from package_registry import get_manifest, app_exists
2
+ import sys
3
+ import json
4
+ import subprocess
5
+ import importlib
6
+ from pathlib import Path
7
+ from package_registry import get_manifest, app_exists, get_apps_directory
3
8
 
4
9
  def check_dependencies(manifest):
5
10
  """
@@ -266,6 +271,227 @@ def get_system_dependency_report():
266
271
 
267
272
  return report
268
273
 
274
+ def check_and_install_python_dependencies(app_path):
275
+ """
276
+ Python uygulamasının bağımlılıklarını kontrol eder ve eksik olanları kurar.
277
+
278
+ Args:
279
+ app_path (str): Uygulama dizini
280
+
281
+ Returns:
282
+ tuple: (success: bool, message: str, missing_packages: list)
283
+ """
284
+ missing_packages = []
285
+
286
+ # Manifest dosyasını kontrol et
287
+ manifest_path = Path(app_path) / "manifest.json"
288
+ if not manifest_path.exists():
289
+ return False, "Manifest dosyası bulunamadı", []
290
+
291
+ try:
292
+ with open(manifest_path, 'r', encoding='utf-8') as f:
293
+ manifest = json.load(f)
294
+ except Exception as e:
295
+ return False, f"Manifest dosyası okunamadı: {e}", []
296
+
297
+ # Sadece Python uygulamaları için
298
+ if manifest.get('language') != 'python':
299
+ return True, "Python uygulaması değil", []
300
+
301
+ # 1. İlk olarak inline dependencies kontrol et
302
+ dependencies = manifest.get('dependencies', [])
303
+ for pkg in dependencies:
304
+ try:
305
+ importlib.import_module(pkg)
306
+ except ImportError:
307
+ missing_packages.append(pkg)
308
+ try:
309
+ print(f"📦 {pkg} kuruluyor...")
310
+ result = subprocess.run([sys.executable, "-m", "pip", "install", pkg],
311
+ capture_output=True, text=True, timeout=60)
312
+ if result.returncode == 0:
313
+ print(f"✅ {pkg} başarıyla kuruldu")
314
+ else:
315
+ print(f"❌ {pkg} kurulumu başarısız: {result.stderr}")
316
+ except Exception as e:
317
+ print(f"❌ {pkg} kurulum hatası: {e}")
318
+
319
+ # 2. requirements.txt dosyasını kontrol et (fallback)
320
+ req_txt_path = Path(app_path) / "requirements.txt"
321
+ if req_txt_path.exists() and missing_packages:
322
+ try:
323
+ print(f"📦 requirements.txt dosyasından bağımlılıklar kuruluyor...")
324
+ result = subprocess.run([sys.executable, "-m", "pip", "install", "-r", str(req_txt_path)],
325
+ capture_output=True, text=True, timeout=120)
326
+ if result.returncode == 0:
327
+ print("✅ requirements.txt bağımlılıkları kuruldu")
328
+ else:
329
+ print(f"❌ requirements.txt kurulum hatası: {result.stderr}")
330
+ except Exception as e:
331
+ print(f"❌ requirements.txt kurulum hatası: {e}")
332
+
333
+ if missing_packages:
334
+ return True, f"{len(missing_packages)} bağımlılık kuruldu", missing_packages
335
+ else:
336
+ return True, "Tüm bağımlılıklar zaten kurulu", []
337
+
338
+ def check_and_install_lua_dependencies(app_path):
339
+ """
340
+ Lua uygulamasının bağımlılıklarını kontrol eder ve eksik olanları kurar.
341
+
342
+ Args:
343
+ app_path (str): Uygulama dizini
344
+
345
+ Returns:
346
+ tuple: (success: bool, message: str, missing_packages: list)
347
+ """
348
+ missing_packages = []
349
+
350
+ # Manifest dosyasını kontrol et
351
+ manifest_path = Path(app_path) / "manifest.json"
352
+ if not manifest_path.exists():
353
+ return False, "Manifest dosyası bulunamadı", []
354
+
355
+ try:
356
+ with open(manifest_path, 'r', encoding='utf-8') as f:
357
+ manifest = json.load(f)
358
+ except Exception as e:
359
+ return False, f"Manifest dosyası okunamadı: {e}", []
360
+
361
+ # Sadece Lua uygulamaları için
362
+ if manifest.get('language') != 'lua':
363
+ return True, "Lua uygulaması değil", []
364
+
365
+ # Lua bağımlılıklarını kontrol et
366
+ dependencies = manifest.get('dependencies', [])
367
+ for pkg in dependencies:
368
+ try:
369
+ result = subprocess.run(["luarocks", "show", pkg],
370
+ capture_output=True, text=True, timeout=30)
371
+ if result.returncode != 0:
372
+ missing_packages.append(pkg)
373
+ try:
374
+ print(f"🪨 {pkg} kuruluyor...")
375
+ result = subprocess.run(["luarocks", "install", pkg],
376
+ capture_output=True, text=True, timeout=60)
377
+ if result.returncode == 0:
378
+ print(f"✅ {pkg} başarıyla kuruldu")
379
+ else:
380
+ print(f"❌ {pkg} kurulumu başarısız: {result.stderr}")
381
+ except Exception as e:
382
+ print(f"❌ {pkg} kurulum hatası: {e}")
383
+ except Exception as e:
384
+ print(f"❌ {pkg} kontrol hatası: {e}")
385
+
386
+ if missing_packages:
387
+ return True, f"{len(missing_packages)} Lua bağımlılığı kuruldu", missing_packages
388
+ else:
389
+ return True, "Tüm Lua bağımlılıkları zaten kurulu", []
390
+
391
+ def check_engine_availability(app_path):
392
+ """
393
+ Uygulamanın gerekli motor/framework'ünün kurulu olup olmadığını kontrol eder.
394
+
395
+ Args:
396
+ app_path (str): Uygulama dizini
397
+
398
+ Returns:
399
+ tuple: (available: bool, message: str, engine_info: dict)
400
+ """
401
+ # Manifest dosyasını kontrol et
402
+ manifest_path = Path(app_path) / "manifest.json"
403
+ if not manifest_path.exists():
404
+ return False, "Manifest dosyası bulunamadı", {}
405
+
406
+ try:
407
+ with open(manifest_path, 'r', encoding='utf-8') as f:
408
+ manifest = json.load(f)
409
+ except Exception as e:
410
+ return False, f"Manifest dosyası okunamadı: {e}", {}
411
+
412
+ # Engine bilgisi yoksa
413
+ if "engine" not in manifest:
414
+ return True, "Engine gereksinimi yok", {}
415
+
416
+ engine = manifest["engine"]
417
+ language = manifest.get("language", "unknown")
418
+
419
+ engine_info = {
420
+ "name": engine,
421
+ "language": language,
422
+ "required": True
423
+ }
424
+
425
+ if language == "python":
426
+ try:
427
+ importlib.import_module(engine)
428
+ engine_info["available"] = True
429
+ return True, f"Python motoru '{engine}' kurulu", engine_info
430
+ except ImportError:
431
+ engine_info["available"] = False
432
+ return False, f"Python motoru '{engine}' eksik", engine_info
433
+
434
+ elif language == "lua":
435
+ try:
436
+ result = subprocess.run(["luarocks", "show", engine],
437
+ capture_output=True, text=True, timeout=30)
438
+ if result.returncode == 0:
439
+ engine_info["available"] = True
440
+ return True, f"Lua modülü '{engine}' kurulu", engine_info
441
+ else:
442
+ engine_info["available"] = False
443
+ return False, f"Lua modülü '{engine}' eksik", engine_info
444
+ except Exception as e:
445
+ engine_info["available"] = False
446
+ return False, f"Lua modülü '{engine}' kontrol edilemedi: {e}", engine_info
447
+
448
+ return True, "Bilinmeyen dil türü", engine_info
449
+
450
+ def get_enhanced_system_dependency_report():
451
+ """
452
+ Gelişmiş sistem bağımlılık raporu oluşturur.
453
+
454
+ Returns:
455
+ str: Gelişmiş sistem raporu
456
+ """
457
+ report = "🔍 Gelişmiş Sistem Bağımlılık Raporu\n"
458
+ report += "=" * 50 + "\n"
459
+
460
+ # Python sürümü
461
+ report += f"🐍 Python Sürümü: {sys.version}\n"
462
+
463
+ # Pip durumu
464
+ try:
465
+ result = subprocess.run([sys.executable, "-m", "pip", "--version"],
466
+ capture_output=True, text=True)
467
+ if result.returncode == 0:
468
+ report += f"📦 Pip: {result.stdout.strip()}\n"
469
+ else:
470
+ report += "❌ Pip: Kurulu değil\n"
471
+ except Exception:
472
+ report += "❌ Pip: Erişilemiyor\n"
473
+
474
+ # Lua/Luarocks durumu
475
+ try:
476
+ result = subprocess.run(["lua", "--version"], capture_output=True, text=True)
477
+ if result.returncode == 0:
478
+ report += f"🌙 Lua: {result.stdout.strip()}\n"
479
+ else:
480
+ report += "❌ Lua: Kurulu değil\n"
481
+ except Exception:
482
+ report += "❌ Lua: Erişilemiyor\n"
483
+
484
+ try:
485
+ result = subprocess.run(["luarocks", "--version"], capture_output=True, text=True)
486
+ if result.returncode == 0:
487
+ report += f"🪨 Luarocks: {result.stdout.strip()}\n"
488
+ else:
489
+ report += "❌ Luarocks: Kurulu değil\n"
490
+ except Exception:
491
+ report += "❌ Luarocks: Erişilemiyor\n"
492
+
493
+ return report
494
+
269
495
  if __name__ == "__main__":
270
496
  # Test için örnek kullanım
271
497
  print("Sistem bağımlılık raporu:")
install_command.py CHANGED
@@ -156,6 +156,37 @@ def install_app_locally(app_name: str, source_path: str) -> Tuple[bool, str]:
156
156
  shutil.rmtree(target_path)
157
157
  return False, f"Manifest doğrulama hatası: {errors}"
158
158
 
159
+ # Bağımlılık çözümleme entegrasyonu
160
+ print("5️⃣ Bağımlılıklar kontrol ediliyor...")
161
+ from dependency_resolver import check_and_install_python_dependencies, check_and_install_lua_dependencies, check_engine_availability
162
+
163
+ # Engine kontrolü
164
+ engine_available, engine_message, engine_info = check_engine_availability(target_path)
165
+ if not engine_available:
166
+ print(f"⚠️ {engine_message}")
167
+
168
+ # Dil bazlı bağımlılık kontrolü
169
+ language = manifest.get('language', 'unknown')
170
+ if language == 'python':
171
+ success, message, missing_packages = check_and_install_python_dependencies(target_path)
172
+ if success:
173
+ if missing_packages:
174
+ print(f"✅ {message}")
175
+ else:
176
+ print("✅ Tüm Python bağımlılıkları zaten kurulu")
177
+ else:
178
+ print(f"⚠️ Python bağımlılık hatası: {message}")
179
+
180
+ elif language == 'lua':
181
+ success, message, missing_packages = check_and_install_lua_dependencies(target_path)
182
+ if success:
183
+ if missing_packages:
184
+ print(f"✅ {message}")
185
+ else:
186
+ print("✅ Tüm Lua bağımlılıkları zaten kurulu")
187
+ else:
188
+ print(f"⚠️ Lua bağımlılık hatası: {message}")
189
+
159
190
  return True, f"Uygulama kuruldu: {target_path}"
160
191
 
161
192
  except Exception as e:
main.py CHANGED
@@ -38,6 +38,14 @@ from install_command import install_app
38
38
  from uninstall_command import uninstall_app
39
39
  from list_command import list_apps as list_apps_new
40
40
 
41
+ # Dependency yönetimi komutları
42
+ from dependency_command import (
43
+ handle_dependency_check,
44
+ handle_dependency_install,
45
+ handle_engine_check,
46
+ handle_dependency_tree
47
+ )
48
+
41
49
  def main():
42
50
  """Ana CLI fonksiyonu"""
43
51
 
@@ -63,6 +71,13 @@ def main():
63
71
  clapp validate ./my-app # Uygulama klasörünü doğrula
64
72
  clapp publish ./my-app # Uygulama yayınla
65
73
 
74
+ 🔗 Bağımlılık Komutları:
75
+ clapp dependency check # Sistem geneli bağımlılık kontrolü
76
+ clapp dependency check app # Belirli uygulama bağımlılık kontrolü
77
+ clapp dependency install app # Uygulama bağımlılıklarını kur
78
+ clapp dependency engine app # Engine kontrolü
79
+ clapp dependency tree app # Bağımlılık ağacı
80
+
66
81
  🛠️ Sistem Komutları:
67
82
  clapp check-env # Ortam kontrolü
68
83
  clapp doctor # Kapsamlı sistem tanılaması
@@ -158,6 +173,27 @@ def main():
158
173
  version_parser.add_argument('--json', action='store_true', help='JSON formatında')
159
174
  version_parser.add_argument('--detailed', action='store_true', help='Detaylı bilgi')
160
175
 
176
+ # dependency komutu (yeni)
177
+ dependency_parser = subparsers.add_parser('dependency', help='Bağımlılık yönetimi')
178
+ dependency_subparsers = dependency_parser.add_subparsers(dest='dependency_command', help='Bağımlılık alt komutları')
179
+
180
+ # dependency check
181
+ dep_check_parser = dependency_subparsers.add_parser('check', help='Bağımlılık kontrolü')
182
+ dep_check_parser.add_argument('app_name', nargs='?', help='Uygulama adı (opsiyonel)')
183
+
184
+ # dependency install
185
+ dep_install_parser = dependency_subparsers.add_parser('install', help='Bağımlılık kurulumu')
186
+ dep_install_parser.add_argument('app_name', help='Uygulama adı')
187
+ dep_install_parser.add_argument('--force', '-f', action='store_true', help='Zorla kurulum')
188
+
189
+ # dependency engine
190
+ dep_engine_parser = dependency_subparsers.add_parser('engine', help='Engine kontrolü')
191
+ dep_engine_parser.add_argument('app_name', nargs='?', help='Uygulama adı (opsiyonel)')
192
+
193
+ # dependency tree
194
+ dep_tree_parser = dependency_subparsers.add_parser('tree', help='Bağımlılık ağacı')
195
+ dep_tree_parser.add_argument('app_name', help='Uygulama adı')
196
+
161
197
  # Argümanları parse et
162
198
  args = parser.parse_args()
163
199
 
@@ -282,6 +318,29 @@ def main():
282
318
  print_detailed_version()
283
319
  else:
284
320
  print_version("default")
321
+
322
+ elif args.command == 'dependency':
323
+ # Dependency komutlarını işle
324
+ if args.dependency_command == 'check':
325
+ handle_dependency_check(args)
326
+ elif args.dependency_command == 'install':
327
+ success, message = handle_dependency_install(args)
328
+ if not success:
329
+ print(f"❌ {message}")
330
+ sys.exit(1)
331
+ elif args.dependency_command == 'engine':
332
+ success, message = handle_engine_check(args)
333
+ if not success:
334
+ print(f"❌ {message}")
335
+ sys.exit(1)
336
+ elif args.dependency_command == 'tree':
337
+ success, message = handle_dependency_tree(args)
338
+ if not success:
339
+ print(f"❌ {message}")
340
+ sys.exit(1)
341
+ else:
342
+ print("❌ Geçersiz dependency komutu")
343
+ sys.exit(1)
285
344
 
286
345
  except KeyboardInterrupt:
287
346
  print("\n❌ İşlem iptal edildi")