Install poetry #
pip install poetryCreate a new project #
# in work directory
poetry new name_of_projectManage dependencies #
1. modify pyproject.toml #
[tool.poetry.dependencies]
scikit-learn = "*"2. CLI #
poetry add pytestbest practice for testing dependencies #
[tool.poetry.group.dev.dependencies]
pytest = "^7.2.1"
pytest-mock = "*"Activate environment in terminal #
# activate
poetry shell
# deactivate
exitInstall dependencies specified in pyproject.toml file, or .lock file #
poetry installRun with Poetry-configured Env via CLI #
poetry run python xxx.pyBuilding a library #
poetry buildPublish to PyPI #
poetry publish –r private-repository-location