clapp-pm 1.0.10__py3-none-any.whl → 1.0.11__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.
Files changed (40) hide show
  1. backup_current/build_index.py +132 -0
  2. backup_current/check_env.py +133 -0
  3. backup_current/clapp_core.py +61 -0
  4. backup_current/clean_command.py +214 -0
  5. backup_current/cli_commands.py +404 -0
  6. backup_current/dependency_resolver.py +272 -0
  7. backup_current/doctor_command.py +239 -0
  8. backup_current/info_command.py +194 -0
  9. backup_current/install_command.py +236 -0
  10. backup_current/installer.py +323 -0
  11. backup_current/list_command.py +262 -0
  12. backup_current/main.py +294 -0
  13. backup_current/manifest_schema.py +84 -0
  14. backup_current/manifest_validator.py +245 -0
  15. backup_current/package_registry.py +127 -0
  16. backup_current/package_runner.py +85 -0
  17. backup_current/post_install_hint.py +144 -0
  18. backup_current/publish_command.py +253 -0
  19. backup_current/remote_registry.py +285 -0
  20. backup_current/setup.py +160 -0
  21. backup_current/system_test.py +477 -0
  22. backup_current/uninstall_command.py +215 -0
  23. backup_current/validate_command.py +225 -0
  24. backup_current/version.py +8 -0
  25. backup_current/version_command.py +145 -0
  26. backup_current/where_command.py +207 -0
  27. check_env.py +1 -8
  28. clapp-packages-repo/packages/hello-python/main.py +0 -49
  29. clapp-packages-repo/packages/hello-python/manifest.json +0 -8
  30. {clapp_pm-1.0.10.data → clapp_pm-1.0.11.data}/data/version.json +1 -1
  31. {clapp_pm-1.0.10.dist-info → clapp_pm-1.0.11.dist-info}/METADATA +1 -1
  32. clapp_pm-1.0.11.dist-info/RECORD +71 -0
  33. {clapp_pm-1.0.10.dist-info → clapp_pm-1.0.11.dist-info}/top_level.txt +1 -0
  34. doctor_command.py +0 -1
  35. install_command.py +3 -0
  36. version.py +1 -1
  37. clapp_pm-1.0.10.dist-info/RECORD +0 -45
  38. {clapp_pm-1.0.10.dist-info → clapp_pm-1.0.11.dist-info}/WHEEL +0 -0
  39. {clapp_pm-1.0.10.dist-info → clapp_pm-1.0.11.dist-info}/entry_points.txt +0 -0
  40. {clapp_pm-1.0.10.dist-info → clapp_pm-1.0.11.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,285 @@
1
+ import json
2
+ import urllib.request
3
+ import urllib.parse
4
+ from typing import List, Dict, Optional
5
+
6
+ # Uzak paket deposu URL'si
7
+ REMOTE_PACKAGES_URL = "https://raw.githubusercontent.com/mburakmmm/clapp-packages/main/packages.json"
8
+
9
+ def fetch_remote_packages() -> List[Dict]:
10
+ """
11
+ Uzak paket deposundan paket listesini indirir.
12
+
13
+ Returns:
14
+ list: Paket listesi (dict formatında)
15
+ """
16
+ try:
17
+ print("Uzak paket deposu kontrol ediliyor...")
18
+
19
+ # HTTP isteği gönder
20
+ with urllib.request.urlopen(REMOTE_PACKAGES_URL) as response:
21
+ data = response.read().decode('utf-8')
22
+
23
+ # JSON'u parse et
24
+ packages = json.loads(data)
25
+
26
+ print(f"✅ {len(packages)} paket bulundu")
27
+ return packages
28
+
29
+ except urllib.error.URLError as e:
30
+ print(f"❌ Ağ hatası: {e}")
31
+ return []
32
+ except json.JSONDecodeError as e:
33
+ print(f"❌ JSON parse hatası: {e}")
34
+ return []
35
+ except Exception as e:
36
+ print(f"❌ Beklenmeyen hata: {e}")
37
+ return []
38
+
39
+ def get_package_info(app_name: str) -> Optional[Dict]:
40
+ """
41
+ Belirtilen uygulama için uzak paket bilgilerini döndürür.
42
+
43
+ Args:
44
+ app_name (str): Uygulama adı
45
+
46
+ Returns:
47
+ dict or None: Paket bilgileri veya None
48
+ """
49
+ packages = fetch_remote_packages()
50
+
51
+ for package in packages:
52
+ if package.get('name') == app_name:
53
+ return package
54
+
55
+ return None
56
+
57
+ def search_packages(query: str) -> List[Dict]:
58
+ """
59
+ Paket deposunda arama yapar.
60
+
61
+ Args:
62
+ query (str): Arama terimi
63
+
64
+ Returns:
65
+ list: Eşleşen paketler
66
+ """
67
+ packages = fetch_remote_packages()
68
+ results = []
69
+
70
+ query_lower = query.lower()
71
+
72
+ for package in packages:
73
+ # İsim, açıklama ve dilde arama yap
74
+ name = package.get('name', '').lower()
75
+ description = package.get('description', '').lower()
76
+ language = package.get('language', '').lower()
77
+
78
+ if (query_lower in name or
79
+ query_lower in description or
80
+ query_lower in language):
81
+ results.append(package)
82
+
83
+ return results
84
+
85
+ def get_packages_by_language(language: str) -> List[Dict]:
86
+ """
87
+ Belirtilen dildeki paketleri döndürür.
88
+
89
+ Args:
90
+ language (str): Programlama dili
91
+
92
+ Returns:
93
+ list: Belirtilen dildeki paketler
94
+ """
95
+ packages = fetch_remote_packages()
96
+ filtered_packages = []
97
+
98
+ for package in packages:
99
+ if package.get('language', '').lower() == language.lower():
100
+ filtered_packages.append(package)
101
+
102
+ return filtered_packages
103
+
104
+ def list_remote_packages(show_details=False) -> str:
105
+ """
106
+ Uzak paket deposundaki paketleri listeler.
107
+
108
+ Args:
109
+ show_details (bool): Detayları göster
110
+
111
+ Returns:
112
+ str: Formatlanmış paket listesi
113
+ """
114
+ packages = fetch_remote_packages()
115
+
116
+ if not packages:
117
+ return "❌ Uzak paket deposuna erişilemedi veya paket bulunamadı"
118
+
119
+ output = f"🌐 Uzak Paket Deposu ({len(packages)} paket)\n"
120
+ output += "=" * 50 + "\n"
121
+
122
+ # Dillere göre grupla
123
+ by_language = {}
124
+ for package in packages:
125
+ language = package.get('language', 'unknown')
126
+ if language not in by_language:
127
+ by_language[language] = []
128
+ by_language[language].append(package)
129
+
130
+ for language, lang_packages in sorted(by_language.items()):
131
+ output += f"\n📚 {language.upper()} ({len(lang_packages)} paket):\n"
132
+
133
+ for package in sorted(lang_packages, key=lambda x: x.get('name', '')):
134
+ name = package.get('name', 'Bilinmiyor')
135
+ version = package.get('version', '0.0.0')
136
+ description = package.get('description', 'Açıklama yok')
137
+
138
+ output += f" 📦 {name} (v{version})\n"
139
+
140
+ if show_details:
141
+ output += f" Açıklama: {description}\n"
142
+ output += f" İndirme: {package.get('download_url', 'Yok')}\n"
143
+
144
+ if package.get('dependencies'):
145
+ deps = ', '.join(package['dependencies'])
146
+ output += f" Bağımlılıklar: {deps}\n"
147
+
148
+ return output
149
+
150
+ def validate_package_url(url: str) -> bool:
151
+ """
152
+ Paket URL'sinin geçerli olup olmadığını kontrol eder.
153
+
154
+ Args:
155
+ url (str): Kontrol edilecek URL
156
+
157
+ Returns:
158
+ bool: Geçerliyse True
159
+ """
160
+ try:
161
+ # URL formatını kontrol et
162
+ parsed = urllib.parse.urlparse(url)
163
+ if not parsed.scheme or not parsed.netloc:
164
+ return False
165
+
166
+ # HTTP HEAD isteği gönder
167
+ request = urllib.request.Request(url, method='HEAD')
168
+ with urllib.request.urlopen(request) as response:
169
+ return response.status == 200
170
+
171
+ except Exception:
172
+ return False
173
+
174
+ def get_package_statistics() -> Dict:
175
+ """
176
+ Paket deposu istatistiklerini döndürür.
177
+
178
+ Returns:
179
+ dict: İstatistik bilgileri
180
+ """
181
+ packages = fetch_remote_packages()
182
+
183
+ stats = {
184
+ "total_packages": len(packages),
185
+ "languages": {},
186
+ "with_dependencies": 0,
187
+ "without_dependencies": 0,
188
+ "total_dependencies": 0
189
+ }
190
+
191
+ for package in packages:
192
+ # Dil istatistikleri
193
+ language = package.get('language', 'unknown')
194
+ stats["languages"][language] = stats["languages"].get(language, 0) + 1
195
+
196
+ # Bağımlılık istatistikleri
197
+ dependencies = package.get('dependencies', [])
198
+ if dependencies:
199
+ stats["with_dependencies"] += 1
200
+ stats["total_dependencies"] += len(dependencies)
201
+ else:
202
+ stats["without_dependencies"] += 1
203
+
204
+ return stats
205
+
206
+ def get_statistics_report() -> str:
207
+ """
208
+ İstatistik raporunu döndürür.
209
+
210
+ Returns:
211
+ str: Formatlanmış istatistik raporu
212
+ """
213
+ stats = get_package_statistics()
214
+
215
+ if stats["total_packages"] == 0:
216
+ return "❌ Paket deposu verisi alınamadı"
217
+
218
+ report = "📊 Paket Deposu İstatistikleri\n"
219
+ report += "=" * 40 + "\n"
220
+
221
+ report += f"📦 Toplam Paket: {stats['total_packages']}\n"
222
+ report += f"🔗 Bağımlılığa Sahip: {stats['with_dependencies']}\n"
223
+ report += f"🆓 Bağımlılıksız: {stats['without_dependencies']}\n"
224
+ report += f"📊 Toplam Bağımlılık: {stats['total_dependencies']}\n\n"
225
+
226
+ # Dil dağılımı
227
+ report += "💻 Dil Dağılımı:\n"
228
+ for language, count in sorted(stats["languages"].items()):
229
+ percentage = (count / stats["total_packages"]) * 100
230
+ report += f" {language}: {count} paket (%{percentage:.1f})\n"
231
+
232
+ return report
233
+
234
+ def check_remote_connectivity() -> bool:
235
+ """
236
+ Uzak paket deposuna bağlantıyı kontrol eder.
237
+
238
+ Returns:
239
+ bool: Bağlantı varsa True
240
+ """
241
+ try:
242
+ request = urllib.request.Request(REMOTE_PACKAGES_URL, method='HEAD')
243
+ with urllib.request.urlopen(request, timeout=5) as response:
244
+ return response.status == 200
245
+ except Exception:
246
+ return False
247
+
248
+ def get_package_versions(app_name: str) -> List[str]:
249
+ """
250
+ Paketin mevcut sürümlerini döndürür (şu an sadece mevcut sürüm).
251
+
252
+ Args:
253
+ app_name (str): Uygulama adı
254
+
255
+ Returns:
256
+ list: Sürüm listesi
257
+ """
258
+ package = get_package_info(app_name)
259
+
260
+ if package:
261
+ return [package.get('version', '0.0.0')]
262
+
263
+ return []
264
+
265
+ if __name__ == "__main__":
266
+ # Test için örnek kullanım
267
+ print("Remote Registry Test")
268
+ print("=" * 30)
269
+
270
+ # Bağlantı testi
271
+ if check_remote_connectivity():
272
+ print("✅ Uzak paket deposuna bağlantı başarılı")
273
+
274
+ # Paket listesi
275
+ print("\nPaket listesi:")
276
+ print(list_remote_packages())
277
+
278
+ # İstatistikler
279
+ print("\nİstatistikler:")
280
+ print(get_statistics_report())
281
+
282
+ else:
283
+ print("❌ Uzak paket deposuna bağlantı kurulamadı")
284
+
285
+ print("\nTest tamamlandı.")
@@ -0,0 +1,160 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ setup.py - clapp PyPI Packaging Konfigürasyonu
4
+
5
+ Bu dosya clapp'i PyPI'da yayınlamak için gerekli
6
+ packaging konfigürasyonunu içerir.
7
+ """
8
+
9
+ from setuptools import setup, find_packages
10
+ import json
11
+ from pathlib import Path
12
+
13
+ # Version bilgisini version.json'dan oku
14
+ version_file = Path("version.json")
15
+ if version_file.exists():
16
+ with open(version_file, 'r', encoding='utf-8') as f:
17
+ version_data = json.load(f)
18
+ VERSION = version_data.get("version", "1.0.0")
19
+ AUTHOR = version_data.get("author", "Melih Burak Memiş")
20
+ else:
21
+ VERSION = "1.0.0"
22
+ AUTHOR = "Melih Burak Memiş"
23
+
24
+ # README.md'yi long description olarak kullan
25
+ readme_file = Path("README.md")
26
+ if readme_file.exists():
27
+ with open(readme_file, 'r', encoding='utf-8') as f:
28
+ LONG_DESCRIPTION = f.read()
29
+ else:
30
+ LONG_DESCRIPTION = "Lightweight cross-language app manager for Python and Lua"
31
+
32
+ setup(
33
+ name="clapp-pm",
34
+ version=VERSION,
35
+ author=AUTHOR,
36
+ author_email="mburakmemiscy@gmail.com",
37
+ description="Lightweight cross-language app manager for Python and Lua",
38
+ long_description=LONG_DESCRIPTION,
39
+ long_description_content_type="text/markdown",
40
+ url="https://github.com/mburakmmm/clapp",
41
+ project_urls={
42
+ "Bug Tracker": "https://github.com/mburakmmm/clapp/issues",
43
+ "Documentation": "https://github.com/mburakmmm/clapp/blob/main/README.md",
44
+ "Source Code": "https://github.com/mburakmmm/clapp",
45
+ "Package Repository": "https://github.com/mburakmmm/clapp-packages",
46
+ "Changelog": "https://github.com/mburakmmm/clapp/blob/main/CHANGELOG.md",
47
+ },
48
+
49
+ # Paket bilgileri
50
+ packages=find_packages(exclude=["tests*", "apps*", "packages-repo-files*"]),
51
+ py_modules=[
52
+ "main",
53
+ "clapp_core",
54
+ "package_registry",
55
+ "package_runner",
56
+ "manifest_schema",
57
+ "manifest_validator",
58
+ "dependency_resolver",
59
+ "installer",
60
+ "remote_registry",
61
+ "cli_commands",
62
+ "publish_command",
63
+ "install_command",
64
+ "list_command",
65
+ "uninstall_command",
66
+ "check_env",
67
+ "post_install_hint",
68
+ "info_command",
69
+ "validate_command",
70
+ "doctor_command",
71
+ "clean_command",
72
+ "where_command",
73
+ "version_command",
74
+ ],
75
+
76
+ # Paket verileri
77
+ include_package_data=True,
78
+ package_data={
79
+ "": ["*.json", "*.md", "*.txt"],
80
+ },
81
+
82
+ # Gereksinimler
83
+ install_requires=[
84
+ "requests>=2.31.0",
85
+ "typing-extensions>=4.0.0; python_version<'3.10'",
86
+ ],
87
+
88
+ # Ek gereksinimler
89
+ extras_require={
90
+ "dev": [
91
+ "pytest>=7.0.0",
92
+ "black>=22.0.0",
93
+ "flake8>=4.0.0",
94
+ "mypy>=0.950",
95
+ "pre-commit>=2.20.0",
96
+ ],
97
+ "test": [
98
+ "pytest>=7.0.0",
99
+ "pytest-cov>=4.0.0",
100
+ "coverage>=6.0.0",
101
+ ],
102
+ },
103
+
104
+ # Python sürümü gereksinimleri
105
+ python_requires=">=3.8",
106
+
107
+ # Konsol komutları
108
+ entry_points={
109
+ "console_scripts": [
110
+ "clapp=main:main",
111
+ ],
112
+ },
113
+
114
+ # Sınıflandırma
115
+ classifiers=[
116
+ "Development Status :: 4 - Beta",
117
+ "Intended Audience :: Developers",
118
+ "Intended Audience :: End Users/Desktop",
119
+ "License :: OSI Approved :: MIT License",
120
+ "Operating System :: OS Independent",
121
+ "Programming Language :: Python :: 3",
122
+ "Programming Language :: Python :: 3.8",
123
+ "Programming Language :: Python :: 3.9",
124
+ "Programming Language :: Python :: 3.10",
125
+ "Programming Language :: Python :: 3.11",
126
+ "Programming Language :: Python :: 3.12",
127
+ "Topic :: Software Development :: Libraries :: Python Modules",
128
+ "Topic :: System :: Software Distribution",
129
+ "Topic :: Utilities",
130
+ "Environment :: Console",
131
+ "Natural Language :: Turkish",
132
+ "Natural Language :: English",
133
+ ],
134
+
135
+ # Anahtar kelimeler
136
+ keywords=[
137
+ "package-manager",
138
+ "app-manager",
139
+ "python",
140
+ "lua",
141
+ "cross-language",
142
+ "cli",
143
+ "lightweight",
144
+ "desktop",
145
+ "applications",
146
+ "manifest",
147
+ "dependency",
148
+ ],
149
+
150
+ # Lisans
151
+ license="MIT",
152
+
153
+ # Proje durumu
154
+ zip_safe=False,
155
+
156
+ # Manifest dosyası
157
+ data_files=[
158
+ ("", ["version.json"]),
159
+ ],
160
+ )