Poetry

Install

1
// Some code
Copied!

Usage

1
# Create new project with command: poetry new [project_name]
2
poetry new poetry-demo
3
​
4
# Example directory structure
5
poetry-demo
6
β”œβ”€β”€ pyproject.toml
7
β”œβ”€β”€ README.rst
8
β”œβ”€β”€ poetry_demo
9
β”‚ └── __init__.py
10
└── tests
11
β”œβ”€β”€ __init__.py
12
└── test_poetry_demo.py
13
14
# or you can create folder then go inside and initialise poetry which will create pyproject.toml
15
poetry init
16
​
17
# Go to directory
18
cd poetry-demo
19
​
20
# now you can add dependency, for example:
21
poetry add alembic
22
​
23
#this will add dependency in pyproject.toml file
24
​
25
# new shell
26
poetry shell
27
exit
28
​
29
# manual activation
30
source {path_to_venv}/bin/activate
31
deactivate
32
​
33
source`poetry env info --path`/bin/activate
34
​
35
installing dependency
36
poetry install
37
​
Copied!
Copy link
Contents
Install
Usage