pkgu
v0.0.28
查找PIP工具安裝的過時軟件包並進行更新。受depu的啟發(GO)。但是, pkgu支持完整和部分更新,這更方便和靈活。它還支持跨平台(Windows,Linux,MacOS)。 ?要在第一次之前更快地檢索數據(或不必再次執行命令),我將SQLITE用作緩存DB存儲數據,並可以快速從DB讀取數據並將其顯示給控制台。
但是,現在只有Python3.10及以上。
首先,您需要安裝依賴項。
如果您沒有poetry工具,請先安裝。 ? :詩歌安裝,否則,直接安裝軟件包。
poetry install然後,運行pkgu.py腳本。
python3 pkgu.pypip3 install pkgu安裝完成後, pkgu可執行文件將寫入Python bin目錄,您可以在終端上輸入pkgu -h命令以學習如何使用它。
# Usage
usage: pkgu [-h] [-v] {update,remove} ...
Upgrade and uninstall python package.
options:
-h, --help show this help message and exit
-v, --version Display pkgu version and information
Available commands:
{update,remove} Available commands
update Update python package.
remove remove python package with its dependencies.
# ------ update ------
options:
-h, --help show this help message and exit
-a, --async_upgrade Update the library asynchronously. Default: False
-d CACHE_FOLDER, --cache_folder CACHE_FOLDER
The cache.db file. Default: ~ /.cache/cache.db
-e EXPIRE_TIME, --expire_time EXPIRE_TIME
The expiration time. Default: 43200
--no-cache Whether to use db cache. Default: False
# ------ remove ------
options:
-h, --help show this help message and exit
-l, --list list unused dependencies, but don ' t uninstall them.
-L, --leaves list leaves (packages which are not used by any others).
-y, --yes don ' t ask for confirmation of uninstall deletions.
-f, --freeze list leaves (packages which are not used by any others) in requirements.txt format
- 不需要升級軟件包。
- 升級一些過期的軟件包。
- 同步更新PKG
- 異步更新PKG
我們可以看到,異步方法比同步方法快9秒(僅在這種測試情況下)。因此,現在可以支持以異步更新Python庫。 ?
- 支持可選的更新軟件包
- 支持使用SQLite DB文件的緩存結果。
這可以提高到期的到期,即我們在收集大量時列出它們的日期軟件包,然後還有一個CLI標誌--no-cache可以控制是否應該使用緩存。
- !