File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -133,7 +133,6 @@ select = [
133
133
" PLW" , # pylint warning
134
134
" RUF100" , # Checks noqa rules are used
135
135
" SIM" , # SIMplify
136
- " T20" , # prinT present
137
136
" W" , # Warnings (pycodestyle)
138
137
" UP" , # pyUPgrade
139
138
" YTT" , # Year TwentyTwenty (flake8-2020), sys.version checks
Original file line number Diff line number Diff line change 13
13
AllPlatforms = Literal [SupportedPlatforms , "unsupported" ]
14
14
15
15
raw_platform = platform .system ()
16
+ print (raw_platform )
17
+ print (platform .release ())
16
18
17
19
PLATFORM : AllPlatforms
18
20
19
21
if raw_platform == "Linux" :
20
22
PLATFORM = "WSL" if "microsoft" in platform .release ().lower () else "Linux"
23
+ # platform.release() seems to give kernel version - hence microsoft for WSL?
24
+ # TODO: In future we can use freedesktop_os_release() (python 3.10)
25
+ extra = f"kernel { platform .release ()} "
21
26
elif raw_platform == "Darwin" :
22
27
PLATFORM = "MacOS"
28
+ # platform.release() gives kernel version, but this gives OS & architecture
29
+ mac_ver = platform .mac_ver ()
30
+ extra = f"{ mac_ver [0 ]} on { mac_ver [2 ]} "
31
+ elif raw_platform == "Windows" :
32
+ PLATFORM = "unsupported"
33
+ # platform.win32_ver() gives more information as a tuple
34
+ # Note that this includes Windows here, since it is not a supported native platform
35
+ extra = f"Windows { platform .release ()} "
23
36
else :
24
37
PLATFORM = "unsupported"
38
+ extra = platform .release ()
25
39
26
40
27
41
# PLATFORM DEPENDENT HELPERS
28
42
MOUSE_SELECTION_KEY = "Fn + Alt" if PLATFORM == "MacOS" else "Shift"
29
43
30
44
31
45
def detected_platform () -> str :
46
+ print (f"{ PLATFORM } ({ extra } )" )
32
47
return PLATFORM
33
48
34
49
You can’t perform that action at this time.
0 commit comments