pyhw 0.5.0__tar.gz → 0.6.1__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {pyhw-0.5.0/src/pyhw.egg-info → pyhw-0.6.1}/PKG-INFO +8 -6
- {pyhw-0.5.0 → pyhw-0.6.1}/README.md +7 -5
- {pyhw-0.5.0 → pyhw-0.6.1}/pyproject.toml +2 -2
- pyhw-0.6.1/src/pyhw/backend/gpu/macos.py +100 -0
- pyhw-0.6.1/src/pyhw/library/iokitGPULib/te.py +12 -0
- pyhw-0.6.1/src/pyhw/library/lib/iokitGPULib.dylib +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1/src/pyhw.egg-info}/PKG-INFO +8 -6
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw.egg-info/SOURCES.txt +2 -1
- pyhw-0.5.0/MANIFEST.in +0 -1
- pyhw-0.5.0/src/pyhw/backend/gpu/macos.py +0 -63
- {pyhw-0.5.0 → pyhw-0.6.1}/LICENSE +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/setup.cfg +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/__init__.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/__main__.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/__init__.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/backendBase.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/cpu/__init__.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/cpu/cpuBase.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/cpu/cpuInfo.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/cpu/linux.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/cpu/macos.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/gpu/__init__.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/gpu/gpuBase.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/gpu/gpuInfo.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/gpu/linux.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/host/__init__.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/host/hostBase.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/host/hostInfo.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/host/linux.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/host/macos.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/host/windows.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/kernel/__init__.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/kernel/kernelBase.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/kernel/kernelInfo.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/kernel/unix.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/kernel/windows.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/memory/__init__.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/memory/linux.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/memory/macos.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/memory/memoryBase.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/memory/memoryInfo.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/metal/t.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/nic/__init__.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/nic/linux.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/nic/macos.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/nic/nicBase.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/nic/nicInfo.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/npu/__init__.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/npu/linux.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/npu/macos.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/npu/npuBase.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/npu/npuInfo.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/os/__init__.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/os/linux.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/os/macos.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/os/osBase.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/os/osInfo.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/shell/__init__.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/shell/shellBase.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/shell/unix.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/title/__init__.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/title/titleBase.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/title/unix.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/title/windows.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/uptime/__init__.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/uptime/linux.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/uptime/macos.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/uptime/uptimeBase.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/backend/uptime/uptimeInfo.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/frontend/__init__.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/frontend/color/__init__.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/frontend/color/colorConfig.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/frontend/color/colorSet.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/frontend/color/colorUtil.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/frontend/frontendBase.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/frontend/logo/__init__.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/frontend/logo/ascii/alpine.pyhw +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/frontend/logo/ascii/arch.pyhw +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/frontend/logo/ascii/armbian.pyhw +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/frontend/logo/ascii/centos.pyhw +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/frontend/logo/ascii/debian.pyhw +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/frontend/logo/ascii/fedora.pyhw +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/frontend/logo/ascii/fedora_small.pyhw +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/frontend/logo/ascii/linux.pyhw +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/frontend/logo/ascii/macOS.pyhw +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/frontend/logo/ascii/raspbian.pyhw +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/frontend/logo/ascii/ubuntu.pyhw +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/frontend/logo/ascii/ubuntu_small.pyhw +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/frontend/logo/logoBase.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/macos.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/pyhwException/__init__.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/pyhwException/pyhwException.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/pyhwUtil/__init__.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/pyhwUtil/pyhwUtil.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw/pyhwUtil/sysctlUtil.py +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw.egg-info/dependency_links.txt +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw.egg-info/entry_points.txt +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw.egg-info/requires.txt +0 -0
- {pyhw-0.5.0 → pyhw-0.6.1}/src/pyhw.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: pyhw
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.6.1
|
4
4
|
Summary: PyHw, a neofetch-like command line tool for fetching system information but written mostly in python.
|
5
5
|
Author-email: Xiao Ran <xiaoran.007@icloud.com>
|
6
6
|
License: BSD-3-Clause
|
@@ -19,7 +19,8 @@ Requires-Dist: pypci-ng>=0.0.3
|
|
19
19
|
[](https://pepy.tech/project/pyhw)
|
20
20
|

|
21
21
|
|
22
|
-

|
23
24
|

|
24
25
|
|
25
26
|
|
@@ -42,6 +43,8 @@ pip install pyhw
|
|
42
43
|
```
|
43
44
|
To upgrade pyhw:
|
44
45
|
```shell
|
46
|
+
pip install pyhw -U
|
47
|
+
# or
|
45
48
|
pip install pyhw --upgrade
|
46
49
|
```
|
47
50
|
You can then use this tool directly from the command line with the following command, just like neofetch.
|
@@ -74,7 +77,7 @@ This is due to the fact that system python is not supposed to be managed by pip.
|
|
74
77
|
|
75
78
|
## Supported (Tested) OS
|
76
79
|
* macOS arm64, x86_64
|
77
|
-
* debian-based distro x86_64
|
80
|
+
* debian-based distro arm64, x86_64
|
78
81
|
* RaspberryPi OS arm64
|
79
82
|
|
80
83
|
|
@@ -90,8 +93,7 @@ clone the project, and run:
|
|
90
93
|
```shell
|
91
94
|
python -m build
|
92
95
|
```
|
93
|
-
|
96
|
+
After the build process, the source package and the binary whl package can be found in the dist folder. Then you can use the following command to install the new package.
|
94
97
|
```shell
|
95
|
-
|
98
|
+
pip install dist/*.whl --force-reinstall
|
96
99
|
```
|
97
|
-
After the build process, the source package and the binary whl package can be found in the dist folder.
|
@@ -2,7 +2,8 @@
|
|
2
2
|
[](https://pepy.tech/project/pyhw)
|
3
3
|

|
4
4
|
|
5
|
-

|
6
7
|

|
7
8
|
|
8
9
|
|
@@ -25,6 +26,8 @@ pip install pyhw
|
|
25
26
|
```
|
26
27
|
To upgrade pyhw:
|
27
28
|
```shell
|
29
|
+
pip install pyhw -U
|
30
|
+
# or
|
28
31
|
pip install pyhw --upgrade
|
29
32
|
```
|
30
33
|
You can then use this tool directly from the command line with the following command, just like neofetch.
|
@@ -57,7 +60,7 @@ This is due to the fact that system python is not supposed to be managed by pip.
|
|
57
60
|
|
58
61
|
## Supported (Tested) OS
|
59
62
|
* macOS arm64, x86_64
|
60
|
-
* debian-based distro x86_64
|
63
|
+
* debian-based distro arm64, x86_64
|
61
64
|
* RaspberryPi OS arm64
|
62
65
|
|
63
66
|
|
@@ -73,8 +76,7 @@ clone the project, and run:
|
|
73
76
|
```shell
|
74
77
|
python -m build
|
75
78
|
```
|
76
|
-
|
79
|
+
After the build process, the source package and the binary whl package can be found in the dist folder. Then you can use the following command to install the new package.
|
77
80
|
```shell
|
78
|
-
|
81
|
+
pip install dist/*.whl --force-reinstall
|
79
82
|
```
|
80
|
-
After the build process, the source package and the binary whl package can be found in the dist folder.
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "pyhw"
|
7
|
-
version = "0.
|
7
|
+
version = "0.6.1"
|
8
8
|
description = "PyHw, a neofetch-like command line tool for fetching system information but written mostly in python."
|
9
9
|
keywords = ["neofetch", "system information", "command line tool", "python", "hardware information", "fastfetch", "fetching"]
|
10
10
|
authors = [
|
@@ -30,7 +30,7 @@ package-dir = {"" = "src"}
|
|
30
30
|
include-package-data = true
|
31
31
|
|
32
32
|
[tool.setuptools.package-data]
|
33
|
-
"pyhw" = ["frontend/logo/ascii/*.pyhw"]
|
33
|
+
"pyhw" = ["frontend/logo/ascii/*.pyhw", "library/lib/*.dylib"]
|
34
34
|
|
35
35
|
[project.scripts]
|
36
36
|
pyhw = "pyhw.__main__:main"
|
@@ -0,0 +1,100 @@
|
|
1
|
+
from .gpuInfo import GPUInfo
|
2
|
+
from ...pyhwUtil import getArch
|
3
|
+
import json
|
4
|
+
import subprocess
|
5
|
+
import ctypes
|
6
|
+
from pathlib import Path
|
7
|
+
|
8
|
+
|
9
|
+
class GPUDetectMacOS:
|
10
|
+
def __init__(self):
|
11
|
+
self.__gpuInfo = GPUInfo()
|
12
|
+
self.__arch = getArch()
|
13
|
+
|
14
|
+
def getGPUInfo(self):
|
15
|
+
if self.__arch == "aarch64":
|
16
|
+
self.__getGPUAppleSilicon()
|
17
|
+
else: # Does not consider powerPC based Macs.
|
18
|
+
self.__getGPUIntel()
|
19
|
+
return self.__gpuInfo
|
20
|
+
|
21
|
+
def __getGPUAppleSilicon(self):
|
22
|
+
gpus = list()
|
23
|
+
try:
|
24
|
+
gpu_info_dict = json.loads(subprocess.check_output(["system_profiler", "SPDisplaysDataType", "-json"]))
|
25
|
+
if 'SPDisplaysDataType' in gpu_info_dict:
|
26
|
+
gpus = gpu_info_dict['SPDisplaysDataType']
|
27
|
+
self.__gpuInfo.number = len(gpus)
|
28
|
+
else:
|
29
|
+
pass
|
30
|
+
except Exception:
|
31
|
+
return
|
32
|
+
|
33
|
+
for gpu in gpus:
|
34
|
+
self.__gpuInfo.gpus.append(f'{gpu.get("sppci_model")} ({gpu.get("sppci_cores")} cores) [SOC Integrated]')
|
35
|
+
|
36
|
+
def __getGPUIntel(self):
|
37
|
+
if self.__getGPUIOKit():
|
38
|
+
pass
|
39
|
+
else:
|
40
|
+
gpus = list()
|
41
|
+
try:
|
42
|
+
gpu_info_dict = json.loads(subprocess.check_output(["system_profiler", "SPDisplaysDataType", "-json"]))
|
43
|
+
if 'SPDisplaysDataType' in gpu_info_dict:
|
44
|
+
gpus = gpu_info_dict['SPDisplaysDataType']
|
45
|
+
self.__gpuInfo.number = len(gpus)
|
46
|
+
else:
|
47
|
+
pass
|
48
|
+
except Exception:
|
49
|
+
return
|
50
|
+
|
51
|
+
for gpu in gpus:
|
52
|
+
if self.__handleVendor(gpu.get("spdisplays_vendor")) == "Intel": # Integrated GPU
|
53
|
+
self.__gpuInfo.gpus.append(f'{gpu.get("sppci_model")} [CPU Integrated]')
|
54
|
+
elif self.__handleVendor(gpu.get("spdisplays_vendor")) == "AMD": # dGPU
|
55
|
+
self.__gpuInfo.gpus.append(f'{gpu.get("sppci_model")} {gpu.get("spdisplays_vram")} [Discrete]')
|
56
|
+
elif self.__handleVendor(gpu.get("spdisplays_vendor")) == "Nvidia": # Since current macOS does not support NVIDIA GPUs, this condition is not applicable
|
57
|
+
pass
|
58
|
+
|
59
|
+
def __getGPUIOKit(self):
|
60
|
+
try:
|
61
|
+
package_root = Path(__file__).resolve().parent.parent.parent
|
62
|
+
lib = ctypes.CDLL(f"{package_root}/library/lib/iokitGPULib.dylib")
|
63
|
+
lib.getGPUInfo.restype = ctypes.c_char_p
|
64
|
+
gpu_info = lib.getGPUInfo()
|
65
|
+
gpus = gpu_info.decode('utf-8').split("; ")
|
66
|
+
self.__gpuInfo.number = len(gpus)
|
67
|
+
for gpu in gpus:
|
68
|
+
info_list = gpu.split(", ")
|
69
|
+
model = info_list[0]
|
70
|
+
vendor_id = info_list[1]
|
71
|
+
vram = int(info_list[2]) / 1024
|
72
|
+
if self.__handleVendorID(vendor_id) == "Intel": # Integrated GPU
|
73
|
+
self.__gpuInfo.gpus.append(f'{model} [CPU Integrated]')
|
74
|
+
elif self.__handleVendorID(vendor_id) == "AMD": # dGPU
|
75
|
+
self.__gpuInfo.gpus.append(f'{model} {vram} GB [Discrete]')
|
76
|
+
return True
|
77
|
+
except Exception as e:
|
78
|
+
print(f"An error occurred while getting GPU info using IOKit: {e}")
|
79
|
+
return False
|
80
|
+
|
81
|
+
@staticmethod
|
82
|
+
def __handleVendor(vendor):
|
83
|
+
if vendor == "sppci_vendor_Apple":
|
84
|
+
return "Apple"
|
85
|
+
elif vendor == "sppci_vendor_intel":
|
86
|
+
return "Intel"
|
87
|
+
elif vendor == "sppci_vendor_amd":
|
88
|
+
return "AMD"
|
89
|
+
else:
|
90
|
+
return vendor
|
91
|
+
|
92
|
+
@staticmethod
|
93
|
+
def __handleVendorID(vendor_id):
|
94
|
+
if vendor_id == "0x8086":
|
95
|
+
return "Intel"
|
96
|
+
elif vendor_id == "0x1002":
|
97
|
+
return "AMD"
|
98
|
+
else:
|
99
|
+
return vendor_id
|
100
|
+
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import ctypes
|
2
|
+
|
3
|
+
# Load the dynamic library
|
4
|
+
lib = ctypes.CDLL('./iokitGPULib.dylib')
|
5
|
+
|
6
|
+
# Define the function return type as c_char_p (pointer to C char)
|
7
|
+
lib.getGPUInfo.restype = ctypes.c_char_p
|
8
|
+
|
9
|
+
# Call the function and get the result
|
10
|
+
gpu_info = lib.getGPUInfo()
|
11
|
+
print("Detected GPUs:", gpu_info)
|
12
|
+
|
Binary file
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: pyhw
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.6.1
|
4
4
|
Summary: PyHw, a neofetch-like command line tool for fetching system information but written mostly in python.
|
5
5
|
Author-email: Xiao Ran <xiaoran.007@icloud.com>
|
6
6
|
License: BSD-3-Clause
|
@@ -19,7 +19,8 @@ Requires-Dist: pypci-ng>=0.0.3
|
|
19
19
|
[](https://pepy.tech/project/pyhw)
|
20
20
|

|
21
21
|
|
22
|
-

|
23
24
|

|
24
25
|
|
25
26
|
|
@@ -42,6 +43,8 @@ pip install pyhw
|
|
42
43
|
```
|
43
44
|
To upgrade pyhw:
|
44
45
|
```shell
|
46
|
+
pip install pyhw -U
|
47
|
+
# or
|
45
48
|
pip install pyhw --upgrade
|
46
49
|
```
|
47
50
|
You can then use this tool directly from the command line with the following command, just like neofetch.
|
@@ -74,7 +77,7 @@ This is due to the fact that system python is not supposed to be managed by pip.
|
|
74
77
|
|
75
78
|
## Supported (Tested) OS
|
76
79
|
* macOS arm64, x86_64
|
77
|
-
* debian-based distro x86_64
|
80
|
+
* debian-based distro arm64, x86_64
|
78
81
|
* RaspberryPi OS arm64
|
79
82
|
|
80
83
|
|
@@ -90,8 +93,7 @@ clone the project, and run:
|
|
90
93
|
```shell
|
91
94
|
python -m build
|
92
95
|
```
|
93
|
-
|
96
|
+
After the build process, the source package and the binary whl package can be found in the dist folder. Then you can use the following command to install the new package.
|
94
97
|
```shell
|
95
|
-
|
98
|
+
pip install dist/*.whl --force-reinstall
|
96
99
|
```
|
97
|
-
After the build process, the source package and the binary whl package can be found in the dist folder.
|
@@ -1,5 +1,4 @@
|
|
1
1
|
LICENSE
|
2
|
-
MANIFEST.in
|
3
2
|
README.md
|
4
3
|
pyproject.toml
|
5
4
|
src/pyhw/__init__.py
|
@@ -87,6 +86,8 @@ src/pyhw/frontend/logo/ascii/macOS.pyhw
|
|
87
86
|
src/pyhw/frontend/logo/ascii/raspbian.pyhw
|
88
87
|
src/pyhw/frontend/logo/ascii/ubuntu.pyhw
|
89
88
|
src/pyhw/frontend/logo/ascii/ubuntu_small.pyhw
|
89
|
+
src/pyhw/library/iokitGPULib/te.py
|
90
|
+
src/pyhw/library/lib/iokitGPULib.dylib
|
90
91
|
src/pyhw/pyhwException/__init__.py
|
91
92
|
src/pyhw/pyhwException/pyhwException.py
|
92
93
|
src/pyhw/pyhwUtil/__init__.py
|
pyhw-0.5.0/MANIFEST.in
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
include src/pyhw/frontend/logo/ascii/*.pyhw
|
@@ -1,63 +0,0 @@
|
|
1
|
-
from .gpuInfo import GPUInfo
|
2
|
-
from ...pyhwUtil import getArch
|
3
|
-
import json
|
4
|
-
import subprocess
|
5
|
-
|
6
|
-
|
7
|
-
class GPUDetectMacOS:
|
8
|
-
def __init__(self):
|
9
|
-
self.__gpuInfo = GPUInfo()
|
10
|
-
self.__arch = getArch()
|
11
|
-
|
12
|
-
def getGPUInfo(self):
|
13
|
-
if self.__arch == "aarch64":
|
14
|
-
self.__getGPUAppleSilicon()
|
15
|
-
else: # Does not consider powerPC based Macs.
|
16
|
-
self.__getGPUIntel()
|
17
|
-
return self.__gpuInfo
|
18
|
-
|
19
|
-
def __getGPUAppleSilicon(self):
|
20
|
-
gpus = list()
|
21
|
-
try:
|
22
|
-
gpu_info_dict = json.loads(subprocess.check_output(["system_profiler", "SPDisplaysDataType", "-json"]))
|
23
|
-
if 'SPDisplaysDataType' in gpu_info_dict:
|
24
|
-
gpus = gpu_info_dict['SPDisplaysDataType']
|
25
|
-
self.__gpuInfo.number = len(gpus)
|
26
|
-
else:
|
27
|
-
pass
|
28
|
-
except Exception:
|
29
|
-
return
|
30
|
-
|
31
|
-
for gpu in gpus:
|
32
|
-
self.__gpuInfo.gpus.append(f'{gpu.get("sppci_model")} ({gpu.get("sppci_cores")} cores) [SOC Integrated]')
|
33
|
-
|
34
|
-
def __getGPUIntel(self):
|
35
|
-
gpus = list()
|
36
|
-
try:
|
37
|
-
gpu_info_dict = json.loads(subprocess.check_output(["system_profiler", "SPDisplaysDataType", "-json"]))
|
38
|
-
if 'SPDisplaysDataType' in gpu_info_dict:
|
39
|
-
gpus = gpu_info_dict['SPDisplaysDataType']
|
40
|
-
self.__gpuInfo.number = len(gpus)
|
41
|
-
else:
|
42
|
-
pass
|
43
|
-
except Exception:
|
44
|
-
return
|
45
|
-
|
46
|
-
for gpu in gpus:
|
47
|
-
if self.__handleVendor(gpu.get("spdisplays_vendor")) == "Intel": # Integrated GPU
|
48
|
-
self.__gpuInfo.gpus.append(f'{gpu.get("sppci_model")} [CPU Integrated]')
|
49
|
-
elif self.__handleVendor(gpu.get("spdisplays_vendor")) == "AMD": # dGPU
|
50
|
-
self.__gpuInfo.gpus.append(f'{gpu.get("sppci_model")} {gpu.get("spdisplays_vram")} [Discrete]')
|
51
|
-
elif self.__handleVendor(gpu.get("spdisplays_vendor")) == "Nvidia": # Since current macOS does not support NVIDIA GPUs, this condition is not applicable
|
52
|
-
pass
|
53
|
-
|
54
|
-
@staticmethod
|
55
|
-
def __handleVendor(vendor):
|
56
|
-
if vendor == "sppci_vendor_Apple":
|
57
|
-
return "Apple"
|
58
|
-
elif vendor == "sppci_vendor_intel":
|
59
|
-
return "Intel"
|
60
|
-
elif vendor == "sppci_vendor_amd":
|
61
|
-
return "AMD"
|
62
|
-
else:
|
63
|
-
return vendor
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|