clapp-pm 1.0.43__py3-none-any.whl → 1.0.44__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.
publish_command.py CHANGED
@@ -79,7 +79,10 @@ def copy_app_to_packages(source_folder: str, app_name: str) -> Tuple[bool, str]:
79
79
  shutil.rmtree(target_path)
80
80
  print(f"⚠️ Mevcut {app_name} klasörü silindi")
81
81
 
82
- # Hariç tutulacak dosya ve klasörler
82
+ # Önce tüm klasörü kopyala
83
+ shutil.copytree(source_folder, target_path)
84
+
85
+ # Gereksiz dosya ve klasörleri sil
83
86
  exclude_patterns = [
84
87
  '.venv', '__pycache__', '.git', '.gitignore', '.DS_Store',
85
88
  '*.pyc', '*.pyo', '*.pyd', '*.so', '*.dll', '*.dylib',
@@ -89,45 +92,44 @@ def copy_app_to_packages(source_folder: str, app_name: str) -> Tuple[bool, str]:
89
92
  'packages' # packages klasörünü de hariç tut
90
93
  ]
91
94
 
92
- def should_exclude(path):
93
- """Dosya/klasörün hariç tutulup tutulmayacağını kontrol eder"""
94
- basename = os.path.basename(path)
95
- rel_path = os.path.relpath(path, source_folder)
96
-
97
- for pattern in exclude_patterns:
98
- if pattern.startswith('*'):
99
- # *.ext formatındaki pattern'ler
100
- if basename.endswith(pattern[1:]):
101
- return True
102
- else:
103
- # Tam eşleşme
104
- if basename == pattern or rel_path == pattern:
105
- return True
106
- return False
107
-
108
- # Önce hedef klasörü oluştur
109
- os.makedirs(target_path, exist_ok=True)
110
-
111
- # Dosyaları tek tek kopyala (hariç tutma ile)
112
- for root, dirs, files in os.walk(source_folder):
113
- # Dizinleri filtrele
114
- dirs[:] = [d for d in dirs if not should_exclude(os.path.join(root, d))]
115
-
116
- # Hedef dizini oluştur
117
- rel_root = os.path.relpath(root, source_folder)
118
- target_root = os.path.join(target_path, rel_root)
119
- os.makedirs(target_root, exist_ok=True)
120
-
121
- # Dosyaları kopyala
122
- for file in files:
123
- source_file = os.path.join(root, file)
95
+ def remove_excluded_files(path):
96
+ """Gereksiz dosya ve klasörleri sil"""
97
+ for root, dirs, files in os.walk(path, topdown=False):
98
+ # Dosyaları sil
99
+ for file in files:
100
+ file_path = os.path.join(root, file)
101
+ basename = os.path.basename(file_path)
102
+
103
+ for pattern in exclude_patterns:
104
+ if pattern.startswith('*'):
105
+ if basename.endswith(pattern[1:]):
106
+ try:
107
+ os.remove(file_path)
108
+ break
109
+ except:
110
+ pass
111
+ else:
112
+ if basename == pattern:
113
+ try:
114
+ os.remove(file_path)
115
+ break
116
+ except:
117
+ pass
124
118
 
125
- # Dosyayı hariç tut
126
- if should_exclude(source_file):
127
- continue
128
-
129
- target_file = os.path.join(target_root, file)
130
- shutil.copy2(source_file, target_file)
119
+ # Dizinleri sil
120
+ for dir_name in dirs:
121
+ dir_path = os.path.join(root, dir_name)
122
+
123
+ for pattern in exclude_patterns:
124
+ if dir_name == pattern:
125
+ try:
126
+ shutil.rmtree(dir_path)
127
+ break
128
+ except:
129
+ pass
130
+
131
+ # Gereksiz dosyaları sil
132
+ remove_excluded_files(target_path)
131
133
 
132
134
  print(f"✅ {app_name} -> packages/{app_name} kopyalandı")
133
135
 
version.py CHANGED
@@ -2,7 +2,7 @@
2
2
  Version information for clapp-pm package.
3
3
  """
4
4
 
5
- __version__ = "1.0.43"
5
+ __version__ = "1.0.44"
6
6
  __author__ = "Melih Burak Memiş"
7
7
  __email__ = "mburakmemiscy@gmail.com"
8
8
  __description__ = "Lightweight cross-language app manager for Python and Lua"