$pip install poetry
$poetry new sample-project
This will create the following files and folders:
sample-project
├── README.rst
├── pyproject.toml
├── sample_project
│ └── __init__.py
└── tests
├── __init__.py
└── test_sample_project.py
$cd sample-project
$poetry add [--dev] <package name>
This downloads and install a dependency inside the virtual environment managed by Poetry,
and adds or updates poetry.lock
file, and updates pyproject.toml
.
$poetry remove <package name>
This is very simple :)
# not active
$poetry run python -m pytest
# active
$poetry shell
$poetry install [--no-dev]
Poetry - Python dependency management and packaging made easy.
GitHub - python-poetry/poetry: Python dependency management and packaging made easy.
Modern Python Environments - dependency and workspace management | TestDriven.io
Pipenvなんかにはないスマートな依存関係の解決ができるよって言ってる
確かにpipenv uninstall
は依存関係を見てないし、言われてみればinstallでコケることも割とあるので、
poetry remove
とそのスマートさがよしなにしてくれるなら嬉しいなーという感じ