我有一个sh脚本行(作为Jenkinsfile groovy脚本的一部分),它
sh "python3 -m venv venv"
sh "source venv/bin/activate"
withCredentials([usernamePassword(credentialsId: XXXXXXX,
usernameVariable: 'XXXXXXX',
passwordVariable: 'XXXXXXX')]) {
sh "pip install --extra-index-url 'https://${XXXXXXX}:${XXXXXX}@atifactory-url-base/artifactory/api/pypi/pypi-release-local/simple' -e ."
}
sh "pip freeze >> requirements.txt"
但是,上述失败的原因是
ERROR: file:///home/jenkins/workspace/XXXXXXXXXXX does not appear to be a Python project: neither 'setup.py' nor 'pyproject.toml' found.
我拥有的项目在顶层没有setup.py或requirements.txt文件-如果不添加当前的python项目以使用-e
进行安装,我怎么能做到这一点?
1条答案
按热度按时间xdnvmnnf1#
如果您在Dockerfile中添加
pip install
命令,而该文件没有将setup.py复制到其上下文(如VSCode开发容器)中,则会发生这种情况。