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可以控制是否应该使用缓存。
- !