比较开发环境

diffenv的Python项目详细描述


Build Status

差异

概述

diffenv收集并比较运行时环境。它定义了一个简单的标准来存储开发环境的完整图片。

output

简化示例

$ diffenvpython:python-version:Python 3.7.3shell:envvars:EDITOR:sublwGIT_EDITOR:subl -wAPI_ENDPOINT:http://api.lvh.me:4000PRISMA_ENDPOINT:http://prisma:4466os:timezone:0200version:Darwin 18.7.0 x86_64

Full example output

简化差异

git:
  git-user-name:
-    <<-: Stan James+    +>>: Gabriel Pickard
  version:
-    <<-: git version 2.22.0+    +>>: git version 2.11.0
os:
  version:
-    <<-: Darwin 18.7.0 x86_64+    +>>: Linux 4.19.34-04457-g5b63d4390e96 x86_64
python:
  python-version:
-    <<-: Python 3.7.3+    +>>: Python 2.7.13
  python3-version:
-    <<-: Python 3.7.3+    +>>: Python 3.5.3
  which-python:
-    <<-: /usr/local/opt/python/libexec/bin/python+    +>>: /usr/bin/python

用例

  • 将环境数据添加到错误报告中,甚至自动添加。Example
  • 诊断环境中的细微差别是什么使你同事的机器出故障。
  • 将您当前的环境与过去工作时的提交进行比较。

选项

usage: diffenv [-h] [-o OUTPUT] [-c COMPARE] [--add-hooks] [--share] [--issue]
               [--post POST] [--config CONFIG] [--ignore-config] [--no-color]
               [--no-paging] [--version]

Diff your total environment. Run without any params to simply output current
environment state as YAML.

optional arguments:
  -h, --help            show this help message and exit
  -o OUTPUT, --output OUTPUT
                        output to file instead of stdout
  -c COMPARE, --compare COMPARE
                        file or URL to compare against the current env
  --add-hooks           install git hooks in current repo and exit
  --share               store current env and return URL that can be shared
  --issue               create github issue
  --post POST           POST env to specific URL when sharing; must be used
                        with --share
  --config CONFIG       load config from specific file
  --ignore-config       ignore configs and run all facets
  --no-color            don't color diff output
  --no-paging           don't use less for paging output
  --version             display version and exit

安装

python3 -m pip install diffenv

目前diffenv只支持python 3。

使用

要将当前的开发环境输出到stderr:

diffenv

将您的环境与@werg进行比较:

diffenv -c https://raw.githubusercontent.com/error-central/diffenv/master/examples/gabe_env.yaml

与同事分享您的环境以进行比较:

diffenv --share

有关命令行选项的完整列表,请运行:

diffenv --help

定制

diffenv可以为用户或repo定制。自定义设置放在用户主目录或git repos top目录中名为.diffenv的目录中。

自定义面

Git回购的自定义方面应保存在.diffenv/facets/<yourfacet>

方面文件本身需要是可执行的(chmod +x <yourfacet>)。

配置

您可以限制使用保存在.diffenv/config.yaml

中的yaml文件运行哪些facet。

有关详细信息,请参见example_config.yaml

导致差异

开发安装

如果您是在本地开发,请不要像上面那样安装not,而是在repo根目录中运行以下命令:

# depending on your setup you may have to prefix sudo to this command
pip3 install --editable .

现在diffenv将始终指向本地回购,包括任何更改。

对于Docker容器的测试:

docker pull python
docker run -it python bash
# Now e.g. `pip install diffenv`

测试

python3 -m unittest tests/tests.py

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java Jboss LinkageError:加载程序约束冲突:解析重写的方法时   java Struts 1:如何使用表单bean设置<html:multibox/>值?   使用Fortify将字段设置为Null时的Java Null取消引用   用java对连接字符的图像进行分割   java无法使用Quarkus模拟,NullPointer异常,无法找到相关导入   html试图使iframe垫片与Java小程序上的CSS下拉菜单一起工作   java无法获取Base64。decodeBase64正常工作(Commons编解码器)   java为什么我不能通过点击打开jar文件?   java当用户第一次使用预先填充的sqlite数据库时,安卓应用程序如何添加新的列或表?   在tomcat中安装java GoDaddy SSL证书。。。没有与私钥匹配的证书   java试图实现一些伪代码、算法   java如何读取其他按钮id,避免所有转到第一个按钮   java使用单个   oop为什么Java Map不扩展集合?