(session)
| 1421 | |
| 1422 | @nox.session(python=False, name="compress-dependencies") |
| 1423 | def compress_dependencies(session): |
| 1424 | if not session.posargs: |
| 1425 | session.error( |
| 1426 | "The 'compress-dependencies' session target needs " |
| 1427 | "two arguments, '<platform> <arch>'." |
| 1428 | ) |
| 1429 | try: |
| 1430 | platform = session.posargs.pop(0) |
| 1431 | arch = session.posargs.pop(0) |
| 1432 | if session.posargs: |
| 1433 | session.error( |
| 1434 | "The 'compress-dependencies' session target only accepts " |
| 1435 | "two arguments, '<platform> <arch>'." |
| 1436 | ) |
| 1437 | except IndexError: |
| 1438 | session.error( |
| 1439 | "The 'compress-dependencies' session target needs " |
| 1440 | "two arguments, '<platform> <arch>'." |
| 1441 | ) |
| 1442 | if platform == "windows": |
| 1443 | extension = "tar.gz" |
| 1444 | else: |
| 1445 | extension = "tar.xz" |
| 1446 | nox_dependencies_tarball = f"nox.{platform}.{arch}.{extension}" |
| 1447 | nox_dependencies_tarball_path = REPO_ROOT / nox_dependencies_tarball |
| 1448 | if nox_dependencies_tarball_path.exists(): |
| 1449 | session_warn( |
| 1450 | session, f"Found existing {nox_dependencies_tarball}. Deleting it." |
| 1451 | ) |
| 1452 | nox_dependencies_tarball_path.unlink() |
| 1453 | |
| 1454 | session_run_always( |
| 1455 | session, |
| 1456 | "tar", |
| 1457 | "-caf", |
| 1458 | nox_dependencies_tarball, |
| 1459 | "--exclude=.nox/pre-archive-cleanup", |
| 1460 | ".nox", |
| 1461 | ) |
| 1462 | |
| 1463 | |
| 1464 | @nox.session( |
nothing calls this directly
no test coverage detected