python通过pip安装时从标记设置包版本

2024-04-25 22:05:56 发布

您现在位置:Python中文网/ 问答频道 /正文

我们正在为我们的团队构建一个python包,其结构类似于以下内容

pkg_dir
├── setup.py  # setup.py for package "pkg"
└── some_module.py
other_dir
└── some_file
some_other_file

并且正在使用以下命令通过所述的pip安装它here

$ pip install -e "git+https://git.example.com/MyProject.git#egg=MyProject"

有一个选项可以从这样的标签安装它

$ pip install -e "git+https://git.example.com/MyProject.git@v1.0#egg=MyProject"

软件包版本在setup.py文件中按照说明提供here

现在,我的问题是,有没有办法在安装时直接从标记名设置版本? 这样,我们就不必手动更改setup.py文件中的版本,版本控制将变得像创建新标记一样简单

谢谢


Tags: installpippyhttpsgit版本hereexample