poetry-plugin-export icon indicating copy to clipboard operation
poetry-plugin-export copied to clipboard

Option to include our project itself in generated requirements.txt

Open mthuurne opened this issue 4 years ago • 0 comments

  • [x] I have searched the issues of this repo and believe that this is not a duplicate.
  • [x] 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.

mthuurne avatar Jun 01 '21 12:06 mthuurne