backend/python

poetry usage

seul chan 2020. 1. 14. 18:54

Poetry usage

Install

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

  • Enable tab completion


# Bash

poetry completions bash > /etc/bash_completion.d/poetry.bash-completion



# Bash (macOS/Homebrew)

poetry completions bash > $(brew --prefix)/etc/bash_completion.d/poetry.bash-completion



# Fish

poetry completions fish > ~/.config/fish/completions/poetry.fish



# Zsh

poetry completions zsh > ~/.zfunc/_poetry



# Oh-My-Zsh

mkdir $ZSH/plugins/poetry

poetry completions zsh > $ZSH/plugins/poetry/_poetry

For oh-my-zsh, enable plugin


plugins(

  poetry

  ...

)

Start project


# will create directory and env

poetry new



# create env in current dir

poetry init
  • You can install packages during installing env

Add and install packages


# Add package

poetry add <package_name>

# Add package to dev

poetry add <package_name> -D



# Install package

poetry install <package_name>



# Remove package

poetry remove <package_name>

'backend > python' 카테고리의 다른 글

kafka-python 사용법  (0) 2020.12.31
Check execution time in jupyter notebook  (0) 2020.03.06
Install celery and daemonize  (0) 2020.01.07
Installing jupyterhub  (0) 2019.02.14
IPython (Jupyter) notebook에서 unittest 하기  (0) 2019.02.08