Why Poetry?

Poetry

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

PiPENV

  • We already have pipenv
  • https://github.com/sdispater/poetry#what-about-pipenv

Pip+ 

  • I use pip + requirements.txt + virtualenv + setup.cfg + MANIFEST.in

Pip

  • Repeatability?
    •   
  • Dependency tree?
    •  
pip freeze > requirements.txt
pip install boto3
pip install jmespath==0.7.0

Deps of Deps

  • jmespath >=0.7.1
  • Attempt to add 0.7.0
    • lock
  • Resolution Fails!
poetry show --tree
boto3 1.9.119 The AWS SDK for Python
├── botocore >=1.12.119,<1.13.0
│   ├── docutils >=0.10
│   ├── jmespath >=0.7.1,<1.0.0
│   ├── python-dateutil >=2.1,<3.0.0
│   │   └── six >=1.5
│   └── urllib3 >=1.20,<1.25
├── jmespath >=0.7.1,<1.0.0
└── s3transfer >=0.2.0,<0.3.0
    └── botocore >=1.12.36,<2.0.0
        ├── docutils >=0.10
        ├── jmespath >=0.7.1,<1.0.0
        ├── python-dateutil >=2.1,<3.0.0
        │   └── six >=1.5
        └── urllib3 >=1.20,<1.25

Now let's add 
    jmespath = "0.7" 
to pyproject.toml and try to lock

$ poetry lock
Updating dependencies
Resolving dependencies... (109.0s)
...(eventually)...
[SolverProblemError]
And because boto3 (1.9.121) 
    depends on jmespath (>=0.7.1,<1.0.0)
     and boto3 (1.9.122) 
        depends on jmespath (>=0.7.1,<1.0.0), 
    boto3 (>=1.9,<2.0) requires jmespath (>=0.7.1,<1.0.0).

So, because cron-csv depends on both boto3
 (^1.9) and jmespath (0.7), 
    version solving failed.

Showtime

$ poetry show

boto3           1.9.119  The AWS SDK for Python
botocore        1.12.119 Low-level, data-driven core of boto 3.
...
$ poetry show boto3 --tree

boto3 1.9.119 The AWS SDK for Python
├── botocore >=1.12.119,<1.13.0
│   ├── docutils >=0.10
│   ├── jmespath >=0.7.1,<1.0.0
│   ├── python-dateutil >=2.1,<3.0.0
│   │   └── six >=1.5
│   └── urllib3 >=1.20,<1.25
├── jmespath >=0.7.1,<1.0.0
└── s3transfer >=0.2.0,<0.3.0
    └── botocore >=1.12.36,<2.0.0
        ├── docutils >=0.10
        ├── jmespath >=0.7.1,<1.0.0
        ├── python-dateutil >=2.1,<3.0.0
        │   └── six >=1.5
        └── urllib3 >=1.20,<1.25

Libraries

  • setup.py
  • setup.cfg
  • MANIFEST.in

Pip or it didn't happen

Why Poetry?

By dlindema

Why Poetry?

  • 350