在git私有回帖上更新了版本,现在安装需求失败了。

问题描述 投票:0回答:1

我可以访问一个git repo,它实现了我在项目中使用的一个依赖关系。当然,这个依赖关系在我的requirements.txt中是这样的。

git+https://[email protected]/repowner/[email protected]

它一直都很好用,但最近我需要对依赖关系做一些修改,所以我打开了一个pull请求,并在合并之前让我的老师(repo所有者)进行了审查。在这个PR中,我也对版本进行了颠覆,就像之前的PR(来自另一个作者)一样。我所改的只是一个纯文本的changelog文件和那个 setup.py:

setup.py

from setuptools import setup, find_packages

setup(
    name="dependency_name",
    version='0.1.5', #<<< Only changed this from 0.1.4 to 0.1.5
    description="Desc",
    license='...',
    platforms=['OS Independent'],
    keywords='...',
    author='...',
    url="https://github.com/repoowner/dependency_name",
    packages=find_packages()
)

我以为这样就够了(因为以前也是这样做的)。我已经更新了我的 requirements.txt 到。

git+https://[email protected]/repowner/[email protected]  

但现在,当我试图 pip install -r requirements.txt 我明白了。

Collecting git+https://****@github.com/repoowner/[email protected] (from -r requirements.txt (line 3))
  Cloning https://****@github.com/repoowner/dependency_name.git (to revision v0.1.5) to /tmp/pip-req-build-fvq5k_04
  Running command git clone -q 'https://****@github.com/repoowner/dependency_name.git' /tmp/pip-req-build-fvq5k_04
  WARNING: Did not find branch or tag 'v0.1.5', assuming revision or ref.
  Running command git checkout -q v0.1.5
  error: pathspec 'v0.1.5' did not match any file(s) known to git
ERROR: Command errored out with exit status 1: git checkout -q v0.1.5 Check the logs for full command output.

我在尝试升级版本时是不是漏掉了什么?

另外:如果我尝试0.1.4版本,它的安装没有我最近的改动。

python git setuptools setup.py distutils
1个回答
2
投票

你忘了给 PRmerge 提交的内容打上标签。v0.1.5 标记,正如错误信息所提示的那样。

WARNING: Did not find branch or tag 'v0.1.5', assuming revision or ref.

您可以使用命令 "列出现有的标记 "来确认这一点。git tag.

要创建并推送标签。

  • 使用命令 git log (您可以添加 --pretty=oneline 以获得一个更容易阅读的输出),并找到您最近一次提交的哈希值,您希望将其包含在 v0.1.5 标签版本

  • 使用以下命令创建新标签 git tag -a v0.1.5 <hash_of_your_commit>

  • 推送新标签与 git push --tags

请看 git docs 关于标签的基本用法

请看 git docs for git tag 子命令

© www.soinside.com 2019 - 2024. All rights reserved.