Build the wheel for PyPI.
()
| 41 | |
| 42 | @cli.command() |
| 43 | def wheel(): |
| 44 | """Build the wheel for PyPI.""" |
| 45 | print("Building wheel...") |
| 46 | subprocess.check_call( |
| 47 | [ |
| 48 | "python", |
| 49 | "-m", |
| 50 | "build", |
| 51 | "--outdir", |
| 52 | DIST_DIR, |
| 53 | ] |
| 54 | ) |
| 55 | if os.environ.get("GITHUB_REF", "").startswith("refs/tags/"): |
| 56 | ver = version() # assert for tags that the version matches the tag. |
| 57 | else: |
| 58 | ver = "*" |
| 59 | (whl,) = DIST_DIR.glob(f"mitmproxy-{ver}-py3-none-any.whl") |
| 60 | print(f"Found wheel package: {whl}") |
| 61 | |
| 62 | |
| 63 | class ZipFile2(zipfile.ZipFile): |