Option to include our project itself in generated requirements.txt

Đang mở
#63 0 bình luận 1 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
build-system, tooling

Hướng nghiên cứu

Bắt đầu bằng việc xem xét workflow poetry export hiện có và cách poetry build tạo ra wheel cùng các bản lưu trữ mã nguồn. So sánh hai phương pháp được đề xuất và giải pháp thay thế bằng script đã được báo cáo. Hoàn thành khi một workflow được hỗ trợ tạo ra một tệp requirements chứa phiên bản ứng dụng, các phiên bản dependency được ghim và các hash của các artifact build của ứng dụng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Python
Star
336
Fork
59
Merge trung bình
10 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của python-poetry/poetry-plugin-export

Tất cả issue của python-poetry/poetry-plugin-export

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.