生成显示依赖项影响项目的位置的报告
thaw的Python项目详细描述
解冻
thaw是一个命令行工具,可以精确地标识项目依赖项的使用位置。它旨在通过提供依赖项更新对项目产生影响的路线图来帮助CI和一般项目更新。在
默认情况下,thaw查看项目的requirements.txt
文件,还可以选择根据import语句搜索依赖项,或者只报告使用特定库的位置。在
See planned features and progress here.
需要Python 3。与Python 2不兼容。使用Python3.7/3.8进行测试
安装
您可以使用pip和PyPI安装thaw:
$ pip3 install thaw
使用
thaw接受一个位置参数,即项目目录的根/顶层。在
使用默认设置运行“解冻”将查看您的requirements.txt
文件,并打印它们用于标准输出的位置的报告:
您可以使用--out
标志将报告写入.txt文件。这将在指定的位置创建时间戳文件:
python3 -m thaw . ---out /put/report/here
默认情况下,报表将具有相对于项目根目录的文件路径以及每个受影响文件的行号。您可以使用--verbose
标志使报告包含行内容:
python3 -m thaw . --verbose
如果您没有requirements.txt
文件,或者如果您想获得关于所有依赖项的使用位置的报告,请使用--imports
标志:
python3 -m thaw . --imports
或者,如果要搜索一个或多个库,请使用--library
标志并输入用空格分隔的库的名称:
python3 -m thaw . --library pandas numpy
示例报告
*library1 | 2.9 >> 2.10 | 2 files affected
*library2 | 3.8 >> 4.0 | 1 files affected
library3 | 4.9.1, no update needed
library4 | no version number listed
2 total updates: 1 MAJOR updates, 1 MINOR updates, 0 MICRO updates
Major updates:
[ ]library2
file3.py
[19, 22, 23, 28, 47, 49]
file4.py
[6, 12, 13, 14, 110, 212, 213]
Minor updates:
[ ]library1
file1.py
[14, 15, 16, 22, 87, 88, 209, 211, 212]
file2.py
[16, 18, 21]
file3.py
[24, 89, 134, 137]
Micro updates:
none
错误/请求
请使用GitHub issue tracker提交错误或请求功能。(如果某个特定回购的解冻正在破裂,并且您能够公开共享回购,那么最好在报告中包含一个指向该回购的链接—如果没有,则无需担心。)
您可以在thaw的GitHub project board上查看计划的功能。在
背景
创建thaw是因为更新项目依赖项,然后在错误中玩“打鼹鼠”游戏非常令人沮丧。thaw生成的报告告诉您哪些库在何处使用,包括使用这些库生成的变量,因此您可以轻松地确定问题可能发生的位置,并为修复更新引起的错误制定路线图。在
- 项目
标签: