diff --git a/_posts/2024-06-06-poetry.md b/_posts/2024-06-06-poetry.md new file mode 100644 index 0000000..8684110 --- /dev/null +++ b/_posts/2024-06-06-poetry.md @@ -0,0 +1,62 @@ +--- +layout: post +title: "poetry 를 이용한 패키지 의존성 관리" +description: 파이썬 패키지 의존성 관리를 손쉽게 할 수 있는 poetry 사용법에 대하여 알아봅니다. +tags: [poetry] +comments: true +share: true +--- + +### Step 1. poetry 설치 + +다음의 명령어를 통하여 poetry 를 설치한다. + +```bash +curl -sSL https://install.python-poetry.org | python - +``` + +``` +Retrieving Poetry metadata + +# Welcome to Poetry! + +This will download and install the latest version of Poetry, +a dependency and package manager for Python. + +It will add the `poetry` command to Poetry's bin directory, located at: + +/home/ubuntu/.local/bin + +You can uninstall at any time by executing this script with the --uninstall option, +and these changes will be reverted. + +Installing Poetry (1.8.3): Done + +Poetry (1.8.3) is installed now. Great! + +You can test that everything is set up by executing: + +`poetry --version` +``` + +위의 안내에 따라 poetry 가 제대로 설치되었는지 버전을 한번 출력해 본다. + +```bash +poetry --version +``` + +poetry 1.8.3 버전이 설치되었음을 확인할 수 있다. + +``` +Poetry (version 1.8.3) +``` + + +### Step 2. 필요 패키지 설치 + +프로젝트 폴더에 `pyproject.toml` 및 `poetry.lock` 파일들이 잘 설정되어 있다면, +아래의 명령어를 통해 환경에 필요한 패키지들을 한꺼번에 설치할 수 있다. + +``` +poetry install --no-root --no-dev +```