|
80 | 80 | stat = shutil.disk_usage(".") |
81 | 81 | free_gb = stat.free / (1024**3) |
82 | 82 |
|
83 | | -# With move+symlink approach, we only need ~1.1x the wheel size |
84 | | -# (not 1.5x or 2x, since we're moving not copying) |
85 | | -needed_gb = total_wheel_size / (1024**3) * 1.1 # 1.1x for filesystem overhead |
| 83 | +# With copy approach, we need 2x the wheel size for small wheels |
| 84 | +# (packages/ + packages-small/ both contain actual files) |
| 85 | +needed_gb = total_wheel_size / (1024**3) * 2.0 # 2x for dual storage |
86 | 86 |
|
87 | 87 | print(f"\nDisk Space Check:") |
88 | 88 | print(f" Total wheel size: {total_wheel_size/(1024**3):.2f} GB") |
89 | 89 | print(f" Available space: {free_gb:.2f} GB") |
90 | | -print(f" Estimated needed: {needed_gb:.2f} GB (using move+symlink)") |
| 90 | +print(f" Estimated needed: {needed_gb:.2f} GB (using copy for dumb-pypi compatibility)") |
91 | 91 |
|
92 | 92 | if free_gb < needed_gb: |
93 | 93 | print(f"\nERROR: Insufficient disk space!", file=sys.stderr) |
|
122 | 122 | large_total_size += size |
123 | 123 | operation = "moved -> packages-large/" |
124 | 124 | else: |
125 | | - # Small wheels: MOVE to packages/, SYMLINK in packages-small/ |
126 | | - # This uses only 1× space instead of 2× |
| 125 | + # Small wheels: MOVE to packages/, COPY to packages-small/ |
| 126 | + # Using actual files (not symlinks) for dumb-pypi compatibility |
127 | 127 | primary_dest = packages_dir / wheel.name |
128 | | - symlink_dest = small_dir / wheel.name |
| 128 | + small_dest = small_dir / wheel.name |
129 | 129 |
|
130 | 130 | # Move to primary location (packages/) |
131 | 131 | shutil.move(str(wheel), str(primary_dest)) |
132 | 132 |
|
133 | | - # Create relative symlink in packages-small/ |
134 | | - # Use relative path so symlink works regardless of absolute paths |
135 | | - relative_path = os.path.relpath(primary_dest, small_dir) |
136 | | - os.symlink(relative_path, symlink_dest) |
| 133 | + # Copy to packages-small/ for dumb-pypi indexing |
| 134 | + # dumb-pypi cannot process symlinks, needs actual files |
| 135 | + shutil.copy2(str(primary_dest), str(small_dest)) |
137 | 136 |
|
138 | 137 | small_count += 1 |
139 | 138 | small_total_size += size |
140 | | - operation = "moved -> packages/ + symlinked -> packages-small/" |
| 139 | + operation = "moved -> packages/ + copied -> packages-small/" |
141 | 140 |
|
142 | 141 | # Enhanced progress indicator |
143 | 142 | current_time = time.time() |
|
187 | 186 | print(f" Small wheels (<100MB): {small_count} -> GitHub Pages ({small_total_size/(1024**2):.1f} MB)") |
188 | 187 | print(f"Total processing time: {total_time:.1f} seconds") |
189 | 188 | print(f"Average rate: {total/total_time:.2f} wheels/second") |
190 | | -print(f"\nDisk space optimization: Using move+symlink approach") |
191 | | -print(f" Actual space used: ~{total_wheel_size/(1024**3):.2f} GB (not {total_wheel_size*2/(1024**3):.2f} GB)") |
192 | | -print(f" Space saved: ~{total_wheel_size/(1024**3):.2f} GB") |
| 189 | +print(f"\nDisk space usage: Using copy approach for dumb-pypi compatibility") |
| 190 | +print(f" Actual space used: ~{total_wheel_size*2/(1024**3):.2f} GB") |
| 191 | +print(f" Small wheels are in both packages/ and packages-small/ (actual files, not symlinks)") |
193 | 192 | print(f"{'='*70}\n") |
194 | 193 |
|
195 | 194 | # List examples |
|
204 | 203 | if small_sample: |
205 | 204 | print(f"\nSmall wheels sample (showing 5 of {small_count}):") |
206 | 205 | for w in small_sample: |
207 | | - # Check if symlink |
208 | | - if w.is_symlink(): |
209 | | - target = os.readlink(w) |
210 | | - size_mb = w.stat().st_size / (1024*1024) |
211 | | - print(f" - {w.name} ({size_mb:.1f} MB) [symlink -> {target}]") |
212 | | - else: |
213 | | - size_mb = w.stat().st_size / (1024*1024) |
214 | | - print(f" - {w.name} ({size_mb:.1f} MB)") |
| 206 | + size_mb = w.stat().st_size / (1024*1024) |
| 207 | + print(f" - {w.name} ({size_mb:.1f} MB)") |
215 | 208 |
|
216 | 209 | # Set output for next steps |
217 | 210 | release_tag = f"wheels-{datetime.now().strftime('%Y%m%d-%H%M%S')}" |
|
0 commit comments