检查pypi的更新
pipdated的Python项目详细描述
如果给定模块过时,则对pypi进行pipdated检查。可用于 升级通知。
使用pipdated非常容易。只需运行
importpipdatedmsg=pipdated.check('matplotlib','0.4.5')print(msg)
这将打印
Upgrade to matplotlib 2.0.0 available! (installed: 0.4.5) matplotlib's API changes in this upgrade. Changes to your code may be necessary. To upgrade matplotlib with pip, type pip install -U matplotlib To upgrade _all_ pip-installed packages, use pipdate/pipdate3 To disable these checks, set SecondsBetweenChecks in /home/jdoe/.config/pipdated/config.ini
如果您使用
ifpipdated.needs_checking('matplotlib'):print(pipdated.check('matplotlib','0.4.5'))
然后最多每k秒执行一次,其中k是 在配置文件$HOME/.config/pipdated/config.ini中指定, 例如,每天一次
[DEFAULT] secondsbetweenchecks = 86400
例如,模块作者可以使用它来通知用户 升级自己的模块。
另外,pipdated提供了一个小的命令行助手工具 pipdate和pipdate3用于升级allpip/pip3已安装 包装。
测试
要运行pipdated单元测试,请签出此存储库并键入
pytest
分布
创建新版本
撞上__version__号码,
发布到pypi和github:
$ make publish
许可证
pipdate在MIT license下发布。