|
8 | 8 | """Sync shared files from the typespec repo (http-client-python) into this repo. |
9 | 9 |
|
10 | 10 | The typespec repo is the source of truth for: |
11 | | - 1. regenerate-common.ts — shared regeneration logic |
12 | | - 2. requirements — test dependency files (tests/requirements/) |
13 | | - 3. Test files — mock API tests under tests/mock_api/{shared,azure,unbranded} |
| 11 | + 1. requirements — test dependency files (tests/requirements/) |
| 12 | + 2. Test files — mock API tests under tests/mock_api/{shared,azure,unbranded} |
14 | 13 |
|
15 | 14 | Usage: |
16 | 15 | python sync_from_typespec.py <local-typespec-repo-path> |
|
27 | 26 |
|
28 | 27 | # --- Path configuration (relative to each repo root) --- |
29 | 28 |
|
30 | | -TYPESPEC_COMMON_TS = Path("packages/http-client-python/eng/scripts/ci/regenerate-common.ts") |
31 | | -AUTOREST_COMMON_TS = Path("packages/typespec-python/eng/scripts/regenerate-common.ts") |
32 | | - |
33 | 29 | TYPESPEC_TEST_DIR = Path("packages/http-client-python/tests") |
34 | 30 | AUTOREST_TEST_DIR = Path("packages/typespec-python/tests") |
35 | 31 |
|
@@ -279,37 +275,28 @@ def main() -> int: |
279 | 275 | print(f"ERROR: typespec repo not found: {typespec_repo}", file=sys.stderr) |
280 | 276 | return 1 |
281 | 277 |
|
282 | | - # 1. Sync regenerate-common.ts |
283 | | - src_ts = typespec_repo / TYPESPEC_COMMON_TS |
284 | | - dst_ts = autorest_repo / AUTOREST_COMMON_TS |
285 | | - if not src_ts.is_file(): |
286 | | - print(f"ERROR: {src_ts} not found", file=sys.stderr) |
287 | | - return 1 |
288 | | - shutil.copy2(src_ts, dst_ts) |
289 | | - print(f"Synced regenerate-common.ts") |
290 | | - |
291 | | - # 2. Sync requirements files |
| 278 | + # 1. Sync requirements files |
292 | 279 | print("Syncing requirements...") |
293 | 280 | sync_requirements( |
294 | 281 | typespec_repo / TYPESPEC_TEST_DIR / "requirements", |
295 | 282 | autorest_repo / AUTOREST_TEST_DIR / "requirements", |
296 | 283 | ) |
297 | 284 |
|
298 | | - # 3. Sync dev_requirements.txt |
| 285 | + # 2. Sync dev_requirements.txt |
299 | 286 | print("Syncing dev_requirements.txt...") |
300 | 287 | sync_dev_requirements( |
301 | 288 | typespec_repo / TYPESPEC_DEV_REQUIREMENTS, |
302 | 289 | autorest_repo / AUTOREST_DEV_REQUIREMENTS, |
303 | 290 | ) |
304 | 291 |
|
305 | | - # 4. Sync test files |
| 292 | + # 3. Sync test files |
306 | 293 | print("Syncing test files...") |
307 | 294 | sync_test_files( |
308 | 295 | typespec_repo / TYPESPEC_TEST_DIR, |
309 | 296 | autorest_repo / AUTOREST_TEST_DIR, |
310 | 297 | ) |
311 | 298 |
|
312 | | - # 5. Format TypeScript files |
| 299 | + # 4. Format TypeScript files |
313 | 300 | ts_python_dir = autorest_repo / "packages" / "typespec-python" |
314 | 301 | print("Running pnpm format...") |
315 | 302 | result = subprocess.run( |
|
0 commit comments