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

前端 未结 4 1775
一整个雨季
一整个雨季 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:45

    I can easily find the commit hash for a package of mine.

    I've used Cookie Cutter tool to generate my python package structure. When I install my package from a GitLab repository, a directory named -.dist-info is generated inside my Python Lib directory.

    There's a file direct_url.json that records the commit_id of the repository: Install info

    I don't really know if this a general solution when a install from a git repo is made, or an artifact generated by the Cookie Cutter setup.

提交回复
热议问题