rehandalal / sort-requirements

A simple script to sort python dependencies in requirement text files.
Mozilla Public License 2.0
17 stars 4 forks source link

[DRAFT] Remove duplicated lines #7

Closed alete89 closed 3 years ago

alete89 commented 3 years ago

Naive approach that closes #6

alete89 commented 3 years ago

:thinking: image

rehandalal commented 3 years ago

i'm not sure this naive approach will work without mangling the file in more complex situations. i think the correct approach is to dedupe in the sort_requirements function before it reassembles the file. i think this problem is less trivial to solve than it seems on the surface. portions of the original script may need to change to accommodate this behaviour. it should also definitely be behind a flag perhaps something like --remove-duplicates.

alete89 commented 3 years ago

I agree. I'll give it a new try later. Thanks.

rehandalal commented 3 years ago

thanks for attempting this! ill think about it some more and see if i can provide some better guidance on the original issue for an approach.