clapp-pm 1.0.7__py3-none-any.whl → 1.0.9__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.
- {clapp_pm-1.0.7.dist-info → clapp_pm-1.0.9.dist-info}/METADATA +1 -1
- {clapp_pm-1.0.7.dist-info → clapp_pm-1.0.9.dist-info}/RECORD +10 -10
- dependency_resolver.py +439 -1
- install_command.py +31 -0
- main.py +59 -0
- {clapp_pm-1.0.7.data → clapp_pm-1.0.9.data}/data/version.json +0 -0
- {clapp_pm-1.0.7.dist-info → clapp_pm-1.0.9.dist-info}/WHEEL +0 -0
- {clapp_pm-1.0.7.dist-info → clapp_pm-1.0.9.dist-info}/entry_points.txt +0 -0
- {clapp_pm-1.0.7.dist-info → clapp_pm-1.0.9.dist-info}/licenses/LICENSE +0 -0
- {clapp_pm-1.0.7.dist-info → clapp_pm-1.0.9.dist-info}/top_level.txt +0 -0
@@ -2,13 +2,13 @@ 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
4
|
cli_commands.py,sha256=7tXrBE0pPkuaFIbsIGXg3RxH7GwisL-Zz2N2oMGe2GQ,12682
|
5
|
-
dependency_resolver.py,sha256=
|
5
|
+
dependency_resolver.py,sha256=OyzWOW45OWTr8BX0gcy5fFbk9qIVBP9JQyMtXrKPmEM,24499
|
6
6
|
doctor_command.py,sha256=jLnvpU9Oglq553bwgF7fhAcUChZTMD2Qle9ZxNHPefc,7680
|
7
7
|
info_command.py,sha256=b74Pl1-x_PSezALx-lS3FkEcVNTF7a9McTKk5XTDhjM,5629
|
8
|
-
install_command.py,sha256=
|
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=
|
11
|
+
main.py,sha256=qunqz-FMwmnyat5bLP3YpZLkyCcEgL7vuUsY3UTDJpc,14493
|
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.
|
33
|
-
clapp_pm-1.0.
|
32
|
+
clapp_pm-1.0.9.data/data/version.json,sha256=S7yOmQU4A-UqpUE3AX0vmjehgSS--fxuVEPG1YcIvDo,238
|
33
|
+
clapp_pm-1.0.9.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.
|
41
|
-
clapp_pm-1.0.
|
42
|
-
clapp_pm-1.0.
|
43
|
-
clapp_pm-1.0.
|
44
|
-
clapp_pm-1.0.
|
40
|
+
clapp_pm-1.0.9.dist-info/METADATA,sha256=7Lehlo4mcYxbwf61VxTCb7qTcumO91KtZyAJpGdNYuI,3979
|
41
|
+
clapp_pm-1.0.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
42
|
+
clapp_pm-1.0.9.dist-info/entry_points.txt,sha256=7j-3pQVpQfnaVzUV83g7zlCA30ePlnXkhHLAGGz9xrQ,36
|
43
|
+
clapp_pm-1.0.9.dist-info/top_level.txt,sha256=90PY3qqc7ZdaDsLvwHtQiUG0OZqpsjxw_zkjiTTFY0I,351
|
44
|
+
clapp_pm-1.0.9.dist-info/RECORD,,
|
dependency_resolver.py
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
import os
|
2
|
-
|
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,439 @@ 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
|
+
|
495
|
+
# Dependency Command Functions
|
496
|
+
def handle_dependency_check(args):
|
497
|
+
"""Bağımlılık kontrolü komutunu işler"""
|
498
|
+
app_name = args.app_name
|
499
|
+
|
500
|
+
if app_name:
|
501
|
+
# Belirli bir uygulama için bağımlılık kontrolü
|
502
|
+
print(f"🔍 {app_name} bağımlılık kontrolü...")
|
503
|
+
print("=" * 50)
|
504
|
+
|
505
|
+
# Bağımlılık raporu
|
506
|
+
report = get_dependency_report(app_name)
|
507
|
+
print(report)
|
508
|
+
|
509
|
+
# Detaylı çözümleme
|
510
|
+
resolution = resolve_all_dependencies(app_name)
|
511
|
+
if resolution["status"] == "resolved":
|
512
|
+
print("✅ Tüm bağımlılıklar çözümlenmiş!")
|
513
|
+
elif resolution["status"] == "missing_dependencies":
|
514
|
+
print("❌ Eksik bağımlılıklar var!")
|
515
|
+
else:
|
516
|
+
print(f"⚠️ Durum: {resolution['status']}")
|
517
|
+
|
518
|
+
else:
|
519
|
+
# Sistem geneli bağımlılık kontrolü
|
520
|
+
print("🔍 Sistem geneli bağımlılık kontrolü...")
|
521
|
+
print("=" * 50)
|
522
|
+
|
523
|
+
report = get_system_dependency_report()
|
524
|
+
print(report)
|
525
|
+
|
526
|
+
# Gelişmiş sistem raporu
|
527
|
+
enhanced_report = get_enhanced_system_dependency_report()
|
528
|
+
print("\n" + enhanced_report)
|
529
|
+
|
530
|
+
def handle_dependency_install(args):
|
531
|
+
"""Bağımlılık kurulumu komutunu işler"""
|
532
|
+
app_name = args.app_name
|
533
|
+
force = args.force
|
534
|
+
|
535
|
+
if not app_name:
|
536
|
+
print("❌ Uygulama adı belirtilmelidir!")
|
537
|
+
return False, "Uygulama adı eksik"
|
538
|
+
|
539
|
+
apps_dir = get_apps_directory()
|
540
|
+
app_path = os.path.join(apps_dir, app_name)
|
541
|
+
|
542
|
+
if not os.path.exists(app_path):
|
543
|
+
return False, f"Uygulama bulunamadı: {app_name}"
|
544
|
+
|
545
|
+
print(f"🔧 {app_name} bağımlılıkları kuruluyor...")
|
546
|
+
print("=" * 50)
|
547
|
+
|
548
|
+
# Manifest'i oku
|
549
|
+
manifest_path = os.path.join(app_path, "manifest.json")
|
550
|
+
if not os.path.exists(manifest_path):
|
551
|
+
return False, "Manifest dosyası bulunamadı"
|
552
|
+
|
553
|
+
try:
|
554
|
+
with open(manifest_path, 'r', encoding='utf-8') as f:
|
555
|
+
manifest = json.load(f)
|
556
|
+
except Exception as e:
|
557
|
+
return False, f"Manifest okuma hatası: {e}"
|
558
|
+
|
559
|
+
language = manifest.get('language', 'unknown')
|
560
|
+
|
561
|
+
if language == 'python':
|
562
|
+
success, message, missing_packages = check_and_install_python_dependencies(app_path)
|
563
|
+
if success:
|
564
|
+
if missing_packages:
|
565
|
+
print(f"✅ {message}")
|
566
|
+
print(f"📦 Kurulan paketler: {', '.join(missing_packages)}")
|
567
|
+
else:
|
568
|
+
print("✅ Tüm Python bağımlılıkları zaten kurulu")
|
569
|
+
return True, message
|
570
|
+
else:
|
571
|
+
return False, message
|
572
|
+
|
573
|
+
elif language == 'lua':
|
574
|
+
success, message, missing_packages = check_and_install_lua_dependencies(app_path)
|
575
|
+
if success:
|
576
|
+
if missing_packages:
|
577
|
+
print(f"✅ {message}")
|
578
|
+
print(f"🪨 Kurulan paketler: {', '.join(missing_packages)}")
|
579
|
+
else:
|
580
|
+
print("✅ Tüm Lua bağımlılıkları zaten kurulu")
|
581
|
+
return True, message
|
582
|
+
else:
|
583
|
+
return False, message
|
584
|
+
|
585
|
+
else:
|
586
|
+
return False, f"Desteklenmeyen dil: {language}"
|
587
|
+
|
588
|
+
def handle_engine_check(args):
|
589
|
+
"""Engine kontrolü komutunu işler"""
|
590
|
+
app_name = args.app_name
|
591
|
+
|
592
|
+
if app_name:
|
593
|
+
# Belirli bir uygulama için engine kontrolü
|
594
|
+
apps_dir = get_apps_directory()
|
595
|
+
app_path = os.path.join(apps_dir, app_name)
|
596
|
+
|
597
|
+
if not os.path.exists(app_path):
|
598
|
+
return False, f"Uygulama bulunamadı: {app_name}"
|
599
|
+
|
600
|
+
print(f"🔧 {app_name} engine kontrolü...")
|
601
|
+
print("=" * 50)
|
602
|
+
|
603
|
+
available, message, engine_info = check_engine_availability(app_path)
|
604
|
+
|
605
|
+
if available:
|
606
|
+
print(f"✅ {message}")
|
607
|
+
else:
|
608
|
+
print(f"❌ {message}")
|
609
|
+
|
610
|
+
if engine_info:
|
611
|
+
print(f"📊 Engine Bilgileri:")
|
612
|
+
print(f" - Ad: {engine_info.get('name', 'Bilinmiyor')}")
|
613
|
+
print(f" - Dil: {engine_info.get('language', 'Bilinmiyor')}")
|
614
|
+
print(f" - Gerekli: {engine_info.get('required', False)}")
|
615
|
+
print(f" - Mevcut: {engine_info.get('available', False)}")
|
616
|
+
|
617
|
+
return available, message
|
618
|
+
|
619
|
+
else:
|
620
|
+
# Tüm uygulamalar için engine kontrolü
|
621
|
+
print("🔧 Sistem geneli engine kontrolü...")
|
622
|
+
print("=" * 50)
|
623
|
+
|
624
|
+
packages = list_packages()
|
625
|
+
engine_report = {
|
626
|
+
"total_apps": len(packages),
|
627
|
+
"apps_with_engines": 0,
|
628
|
+
"apps_with_missing_engines": 0,
|
629
|
+
"engine_details": []
|
630
|
+
}
|
631
|
+
|
632
|
+
for package in packages:
|
633
|
+
app_name = package['name']
|
634
|
+
apps_dir = get_apps_directory()
|
635
|
+
app_path = os.path.join(apps_dir, app_name)
|
636
|
+
|
637
|
+
available, message, engine_info = check_engine_availability(app_path)
|
638
|
+
|
639
|
+
if engine_info:
|
640
|
+
engine_report["apps_with_engines"] += 1
|
641
|
+
if not available:
|
642
|
+
engine_report["apps_with_missing_engines"] += 1
|
643
|
+
|
644
|
+
engine_report["engine_details"].append({
|
645
|
+
"app": app_name,
|
646
|
+
"engine": engine_info.get('name', 'Bilinmiyor'),
|
647
|
+
"language": engine_info.get('language', 'Bilinmiyor'),
|
648
|
+
"available": available,
|
649
|
+
"message": message
|
650
|
+
})
|
651
|
+
|
652
|
+
# Raporu yazdır
|
653
|
+
print(f"📊 Engine Raporu:")
|
654
|
+
print(f" - Toplam Uygulama: {engine_report['total_apps']}")
|
655
|
+
print(f" - Engine Gereksinimi: {engine_report['apps_with_engines']}")
|
656
|
+
print(f" - Eksik Engine: {engine_report['apps_with_missing_engines']}")
|
657
|
+
print()
|
658
|
+
|
659
|
+
if engine_report["engine_details"]:
|
660
|
+
print("🔍 Detaylı Engine Durumu:")
|
661
|
+
for detail in engine_report["engine_details"]:
|
662
|
+
status = "✅" if detail["available"] else "❌"
|
663
|
+
print(f" {status} {detail['app']}: {detail['engine']} ({detail['language']})")
|
664
|
+
|
665
|
+
return True, "Engine kontrolü tamamlandı"
|
666
|
+
|
667
|
+
def handle_dependency_tree(args):
|
668
|
+
"""Bağımlılık ağacı komutunu işler"""
|
669
|
+
app_name = args.app_name
|
670
|
+
|
671
|
+
if not app_name:
|
672
|
+
print("❌ Uygulama adı belirtilmelidir!")
|
673
|
+
return False, "Uygulama adı eksik"
|
674
|
+
|
675
|
+
print(f"🌳 {app_name} bağımlılık ağacı...")
|
676
|
+
print("=" * 50)
|
677
|
+
|
678
|
+
resolution = resolve_all_dependencies(app_name)
|
679
|
+
|
680
|
+
if resolution["status"] == "error":
|
681
|
+
print(f"❌ Hata: {resolution.get('dependency_tree', {}).get('error', 'Bilinmeyen hata')}")
|
682
|
+
return False, "Bağımlılık ağacı oluşturulamadı"
|
683
|
+
|
684
|
+
tree = resolution["dependency_tree"]
|
685
|
+
|
686
|
+
def print_tree(node, level=0):
|
687
|
+
indent = " " * level
|
688
|
+
status = "✅" if node.get("missing_dependencies") == [] else "❌"
|
689
|
+
print(f"{indent}{status} {node['name']} (v{node['version']}) [{node['language']}]")
|
690
|
+
|
691
|
+
if node.get("missing_dependencies"):
|
692
|
+
for missing in node["missing_dependencies"]:
|
693
|
+
print(f"{indent} ❌ Eksik: {missing}")
|
694
|
+
|
695
|
+
for dep in node.get("dependencies", []):
|
696
|
+
print_tree(dep, level + 1)
|
697
|
+
|
698
|
+
print_tree(tree)
|
699
|
+
|
700
|
+
print(f"\n📊 Özet:")
|
701
|
+
print(f" - Durum: {resolution['status']}")
|
702
|
+
print(f" - Toplam Bağımlılık: {len(resolution['all_dependencies'])}")
|
703
|
+
print(f" - Eksik: {len(resolution['missing_dependencies'])}")
|
704
|
+
|
705
|
+
return True, "Bağımlılık ağacı gösterildi"
|
706
|
+
|
269
707
|
if __name__ == "__main__":
|
270
708
|
# Test için örnek kullanım
|
271
709
|
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_resolver 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")
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|