How can I know which commit was used when installing a pip package from git?

前端 未结 4 1782
一整个雨季
一整个雨季 2020-12-19 03:44

If I install a package from git using https://pip.pypa.io/en/stable/reference/pip_install/#git does the specific commit that was checked out logged somewhere?

4条回答
  •  南笙
    南笙 (楼主)
    2020-12-19 04:40

    One possible alternative is to use pip install --editable. In such case pip will clone the repo to $PREFIX/src/$egg_name (where $PREFIX is either your virtualenv directory or current working directory), and then just create and egg-link pointing to that path. This way, you will easily be able to check current revision for the cloned repo.

    On the other hand, package installed this way might have different file structure than the one installed in a regularl way. So in some cases this won't work.

提交回复
热议问题