[GiitHub Actions] Poetry 프로젝트에서 종료합니다.txt 생성 및 자동 제출
배경.
Heroku 공식 Python Buidpack Poetry(2021/10 기준)는 지원되지 않습니다.
현재 Poetry 프로젝트를 Heroku로 설계할 때 다음과 같은 두 가지 방법이 있다고 생각합니다.
requirements.txt
이번에는 후자를 쉽게 진행할 수 있는 방법을 소개한다.보태다
히로쿠 공식은 Poetry에 대응하는 절차에 따라 진행되기 때문에 조만간 대응할 것으로 생각한다.
참조: Support for Poetry #796
해본 일
pyproject.toml
에 변경 사항을 추가하여 제출할 경우 GiitHub Actions를 사용하여 자동으로 업데이트requirements.txt
하고 제출합니다.Poetry가 생성
requirements.txt
기능을 준비했기 때문에 우리는 poetry 명령을 실행하는 동작과GiitHub에 자동 제출된 작업를 조합하여workflow를 만들었다.여기.의 창고를 통해 집행례를 확인할 수 있습니다.
![](https://s1.md5.ltd/image/bc4681f4dcc22a7258789653a2de23f4.png)
name: generate requirements.txt
on: push
jobs:
ci:
strategy:
fail-fast: false
matrix:
python-version: [3.9]
poetry-version: [1.0]
os: [ubuntu-18.04]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Run image
uses: abatilo/actions-[email protected]
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Export requirements.txt
run: poetry export -f requirements.txt --output requirements.txt
- name: Update requirements.txt
uses: stefanzweifel/git-auto-commit-[email protected]
with:
commit_message: update requirements.txt
commit_user_name: GitHub Actions
commit_user_email: [email protected]
actions-poetry에서는 파이톤의 버전 지정, git-auto-commit-action에서 제출한 사용자와 제출한 메시지의 사용자 정의 등 다양한 옵션을 설정할 수 있다.자세한 내용은 각 Action의 문서를 참조하십시오.
끝말
뭔가 이상하다고 느껴지지만 Poetry보다는 사용
requirements.txt
이 더 많았다.히로쿠를 기반으로 이야기를 나눴고, 자신이 만든 포에트리 프로젝트를 다른 사람도 이용할 수 있도록 위와 같은 방법
requirements.txt
을 사용해 준비한 용법도 있죠.Reference
이 문제에 관하여([GiitHub Actions] Poetry 프로젝트에서 종료합니다.txt 생성 및 자동 제출), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://zenn.dev/peperoncicicino/articles/ab71fc801ceeee텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)