-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnextgis_utils.py
68 lines (49 loc) · 1.56 KB
/
nextgis_utils.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
from enum import IntEnum
from typing import Iterable, List
class RepkaRepository(IntEnum):
# Borsch repo
BORSCH = 2
# QGIS repos
QGIS_MAIN = 1
QGIS_DEV = 10
# Installer
WIN32 = 4
WIN64 = 5
MACOS = 6
SOFTWARE = 14
IMAGES = 15
# Ubuntu
DEBIAN = 11
# Common
VM_CPU_COUNT = 8
# MacOS settings
MAC_OS_MIN_VERSION = "10.14"
MAC_OS_SDKS_PATH = "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs"
def create_tags(identifiers: Iterable[str]) -> List[str]:
UBUNTU_DISTROS = ("focal", "bullseye", "jammy")
ASTRA_DISTROS = ("astra",)
LINUX_DISTROS = (*UBUNTU_DISTROS, *ASTRA_DISTROS)
tags = []
# Add result type
for product in ("installer", "borsch", "deb"):
if product in identifiers:
tags.append(product)
if any("win" in identifier for identifier in identifiers):
tags.append("windows")
elif any("mac" in identifier for identifier in identifiers):
tags.append("macos")
else:
for identifier in identifiers:
if identifier not in LINUX_DISTROS:
continue
tags.append("linux")
if identifier in UBUNTU_DISTROS:
tags.extend(["ubuntu", identifier])
elif identifier == "astra":
tags.extend(["astra", "astra-17"])
break
if any("64" in identifier for identifier in identifiers):
tags.append("x64")
if any("static" in identifier for identifier in identifiers):
tags.append("static")
return tags