dparse icon indicating copy to clipboard operation
dparse copied to clipboard

Parsing of poetry.lock generated with Poetry >= 1.5.0 fails

Open plaa opened this issue 2 years ago • 1 comments

  • Dependency Parser version: 0.6.3
  • Python version: 3.10.12
  • Operating System: MacOS Ventura

Description

Poetry has deprecated and in 1.5.0 removed writing of the category field into the poetry.lock file. dparse assumes this field to always be present. Thus dparse cannot parse poetry.lock files generated with a recent Poetry version and fails with the exception Malformed poetry lock file

https://github.com/pyupio/dparse/blob/eb917b3bb2087c178c62348181b1a486fa191828/dparse/parser.py#L461-L467

plaa avatar Aug 03 '23 09:08 plaa

What's the best choice here? Provide a default (section = dep.get('category'))? Or always ignore it (section = None)?

It looks like it was removed because it is unused "Do not write the unused package category into the lock file", I guess because of the introduction of groups in the pyproject.toml, which aren't referenced in the poetry.lock.

snorfalorpagus avatar Feb 29 '24 13:02 snorfalorpagus