(ns, *, for_embed=False, for_test=False)
| 21 | |
| 22 | |
| 23 | def calculate_install_json(ns, *, for_embed=False, for_test=False): |
| 24 | TARGET = "python.exe" |
| 25 | TARGETW = "pythonw.exe" |
| 26 | |
| 27 | SYS_ARCH = { |
| 28 | "win32": "32bit", |
| 29 | "amd64": "64bit", |
| 30 | "arm64": "64bit", # Unfortunate, but this is how it's spec'd |
| 31 | }[ns.arch] |
| 32 | TAG_ARCH = { |
| 33 | "win32": "-32", |
| 34 | "amd64": "-64", |
| 35 | "arm64": "-arm64", |
| 36 | }[ns.arch] |
| 37 | |
| 38 | COMPANY = "PythonCore" |
| 39 | DISPLAY_NAME = "Python" |
| 40 | TAG_SUFFIX = "" |
| 41 | ALIAS_PREFIX = "python" |
| 42 | ALIAS_WPREFIX = "pythonw" |
| 43 | FILE_PREFIX = "python-" |
| 44 | FILE_SUFFIX = f"-{ns.arch}" |
| 45 | DISPLAY_TAGS = [{ |
| 46 | "win32": "32-bit", |
| 47 | "amd64": "", |
| 48 | "arm64": "ARM64", |
| 49 | }[ns.arch]] |
| 50 | |
| 51 | if for_test: |
| 52 | # Packages with the test suite come under a different Company |
| 53 | COMPANY = "PythonTest" |
| 54 | DISPLAY_TAGS.append("with tests") |
| 55 | FILE_SUFFIX = f"-test-{ns.arch}" |
| 56 | if for_embed: |
| 57 | # Embeddable distro comes under a different Company |
| 58 | COMPANY = "PythonEmbed" |
| 59 | TARGETW = None |
| 60 | ALIAS_PREFIX = None |
| 61 | ALIAS_WPREFIX = None |
| 62 | DISPLAY_TAGS.append("embeddable") |
| 63 | # Deliberately name the file differently from the existing distro |
| 64 | # so we can republish old versions without replacing files. |
| 65 | FILE_SUFFIX = f"-embeddable-{ns.arch}" |
| 66 | if ns.include_freethreaded: |
| 67 | # Free-threaded distro comes with a tag suffix |
| 68 | TAG_SUFFIX = "t" |
| 69 | TARGET = f"python{VER_MAJOR}.{VER_MINOR}t.exe" |
| 70 | TARGETW = f"pythonw{VER_MAJOR}.{VER_MINOR}t.exe" |
| 71 | DISPLAY_TAGS.append("free-threaded") |
| 72 | FILE_SUFFIX = f"t-{ns.arch}" |
| 73 | |
| 74 | FULL_TAG = f"{VER_MAJOR}.{VER_MINOR}.{VER_MICRO}{VER_SUFFIX}{TAG_SUFFIX}" |
| 75 | FULL_ARCH_TAG = f"{FULL_TAG}{TAG_ARCH}" |
| 76 | XY_TAG = f"{VER_MAJOR}.{VER_MINOR}{TAG_SUFFIX}" |
| 77 | XY_ARCH_TAG = f"{XY_TAG}{TAG_ARCH}" |
| 78 | X_TAG = f"{VER_MAJOR}{TAG_SUFFIX}" |
| 79 | X_ARCH_TAG = f"{X_TAG}{TAG_ARCH}" |
| 80 |
no test coverage detected
searching dependent graphs…