Option to include our project itself in generated requirements.txt

未关闭
#63 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
python

调研方向

首先检查现有的 poetry export 工作流,以及 poetry build 生成 wheel 和源代码归档文件的方式。比较提出的两种方法和报告中的脚本变通方案。当受支持的工作流能够生成一个包含应用程序版本、固定的依赖项版本以及应用程序构建工件哈希的 requirements 文件时,即视为完成。

由索引模型根据 Issue 内容生成。

描述

enhancement
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have searched the documentation and believe that my question is not covered.

Feature Request

I'm developing an application with Poetry, which I would like to deploy on a different system. I am building and publishing a wheel for the application. I would like to deploy the exact same version of all dependencies that the application was tested with.

To do this, I'm using poetry export to generate a requirements.txt file which contains pinned versions + hashes for all dependencies. On the target machine, this is then deployed using pip install -r requirements.txt. This all works fine.

What is missing from requirements.txt though is the application itself. So I have to issue a separate command to install the application. And if there are multiple versions to choose from, I have to be careful to use pip install application==1.2.3 and use the requirements.txt file for version 1.2.3. This seems like extra work that shouldn't be needed and can lead to mistakes.

What I'd like to have is a requirements.txt file that includes the application itself as well, including the hashes for the build artifacts (wheels + source tarball). That way, a single pip install -r can install both the application and its dependencies and we know for sure that the application version and dependency versions will match.

I managed to produce such a requirements.txt file using some scripting, but it would be nicer if Poetry supported this out of the box. One approach would be to have an extra option to poetry export to include the build results in the output. A different approach would be to have an extra option to poetry build which appends the application version + hashes to an existing requirements file. Either solution would be fine for me, but maybe one is better than the other in different scenarios.

主要语言
Python
星标
336
派生
60
平均合并
10 分钟
30 天内合并 PR
1

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

python-poetry/poetry-plugin-export 的其他 Issue

查看 python-poetry/poetry-plugin-export 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。