Why #egg=foo when pip-installing from git repo

前端 未结 4 658
伪装坚强ぢ
伪装坚强ぢ 2021-01-30 10:09

When I do a \"pip install -e ...\" to install from a git repo, I have to specify #egg=somename or pip complains. For example:

pip install -e git://github.com/hii         


        
4条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-30 10:41

    https://pip.pypa.io/en/stable/reference/pip_install/#vcs-support says:

    The "project name" component of the url suffix "egg=-" is used by pip in its dependency logic to identify the project prior to pip downloading and analyzing the metadata. The optional "version" component of the egg name is not functionally important. It merely provides a human-readable clue as to what version is in use. For projects where setup.py is not in the root of project, "subdirectory" component is used. Value of "subdirectory" component should be a path starting from root of the project to where setup.py is located.

    From this I deduce that the egg value is only used for dependency checks and therefore I think, by convention, the package name (i.e. some-pypi-package-name) should be used, not any contained folder (i.e. some_pypi_package_name)

提交回复
热议问题