open:poetry

Poetry

curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -

프로젝트 폴더에 가상환경을 추가하기 위한 설정

poetry config virtualenvs.in-project true

pip upgrade 실행

pip install --upgrade pip

cat requirements.txt|xargs poetry add

poetry config experimental.new-installer false

poetry add [package name]

% poetry init
% poetry add `cat requirements.txt`
 
 
apt-get install python3-venv
 
poetry self:update --preview
poetry env use python3.7
 
https://www.itsupportwale.com/blog/how-to-upgrade-to-python-3-7-on-ubuntu-18-10/
 
sudo apt-get install python3.7-venv

For apt (Ubuntu, Debian…):

sudo apt-get install python-dev   # for python2.x installs
sudo apt-get install python3-dev  # for python3.x installs

[ValueError]
Setting virtualenvs.in-project does not exist

해결

poetry config settings.virtualenvs.in-project true

FROM python:3.6.6-alpine3.7
 
ARG YOUR_ENV
 
ENV YOUR_ENV=${YOUR_ENV} \
  PYTHONFAULTHANDLER=1 \
  PYTHONUNBUFFERED=1 \
  PYTHONHASHSEED=random \
  PIP_NO_CACHE_DIR=off \
  PIP_DISABLE_PIP_VERSION_CHECK=on \
  PIP_DEFAULT_TIMEOUT=100 \
  POETRY_VERSION=0.12.11
 
# System deps:
RUN pip install "poetry==$POETRY_VERSION"
 
# Copy only requirements to cache them in docker layer
WORKDIR /code
COPY poetry.lock pyproject.toml /code/
 
# Project initialization:
RUN poetry config settings.virtualenvs.create false \
  && poetry install $(test "$YOUR_ENV" == production && echo "--no-dev") --no-interaction --no-ansi
 
# Creating folders, and files for a project:
COPY . /code

  • open/poetry.txt
  • 마지막으로 수정됨: 2022/07/18 12:16
  • 저자 127.0.0.1