由于没有“setup.py”,pip 安装失败也不是“pyproject.toml”成立
我有一个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.
项目失败了,我没有设置。使用-e
安装Python项目?
I have a sh script line (as part of a Jenkinsfile groovy script) which does
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"
However, above fails with
ERROR: file:///home/jenkins/workspace/XXXXXXXXXXX does not appear to be a Python project: neither 'setup.py' nor 'pyproject.toml' found.
The project I have has no setup.py or requirements.txt file at the top level - how can I do this without adding the current python project for installation using -e
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您在 Dockerfile 中添加
pip install
命令,而该 Dockerfile 没有将 setup.py 复制到其上下文(例如 VSCode 开发容器)中,则可能会发生这种情况。将 pip 调用放在postCreateCommand
中。This can happen if you add a
pip install
command in a Dockerfile that doesn't have setup.py copied into its context, such as a VSCode dev container. Put the pip call in thepostCreateCommand
instead.