Manage python with pyenv and poetry
Update pyenv version
cd ~/.pyenv
git pull
Use new version
pyenv install 3.9.0
pyenv global 3.9.0
pyenv local 3.9.0
eval "$(pyenv init -)"
pyenv shell 3.9.0
poetry init
poetry install
poetry env use 3.9.0
poetry shell
poetry add <dependencies> <dependencies>
poetry add -D <dependencies> <dependencies>
// existing project :
$ for item in $(cat requirements.txt); do poetry add "${item}"; done
poetry shell
code .
https://www.pythoncheatsheet.org/blog/python-projects-with-poetry-and-vscode-part-2/
https://www.pythoncheatsheet.org/blog/python-projects-with-poetry-and-vscode-part-3/
https://aber.sh/articles/python-poetry/
install poetry
install python from official site, DO NOT add python to PATH, user have to be in venv to use python.
poetry init - Create pyproject.toml
poetry env use PYTHONPATH - Create virtual env, PYTHONPATH is where python.exe
poetry install & update, install and update
poetry add & remove: add&remove dep. from pyproject.toml, more switch to use, such as --dev, -- no-dev
poetry shell
poetry run
poetry build & publish
poetry config
dephell tranlate pyproject.toml to setup.py
Comments
Post a Comment