pipdeptree icon indicating copy to clipboard operation
pipdeptree copied to clipboard

Suggest change `project_name` to lower case

Open zufuliu opened this issue 6 years ago • 5 comments

Suggest change project_name to lower case, since pip package name is case insensitive. Packages like Pillow, Pygments and PyYAML often has different spellings in other package's dependency list. This will reduce isolated packages / dependencies produced by pipdeptree.

This change only need to add four lines in build_dist_index:

    for p in pkgs:
        p.project_name = p.project_name.lower()
        for r in p.requires():
            r.project_name = r.project_name.lower()
    return dict((p.key, DistPackage(p)) for p in pkgs)

zufuliu avatar May 11 '18 15:05 zufuliu

Can you please open a PR with both this one and #100? Will be easier to test and merge that way.

naiquevin avatar May 14 '18 05:05 naiquevin

It's PR #102, but 092503b1abfbcf9a58c5238864708b2ef800ec91 test failed.

zufuliu avatar May 14 '18 10:05 zufuliu

This sound like a duplicate of issue https://github.com/naiquevin/pipdeptree/issues/77.

sschuberth avatar Jul 03 '19 07:07 sschuberth

@sschuberth It's a duplicate, do you have any idea to fix these failed tests in PR #102?

zufuliu avatar Jul 03 '19 07:07 zufuliu

Tests could have failed for completely different reason. The tests have become complicated and messy and I am trying to sort it out. Will test this PR and merge it. Thanks.

naiquevin avatar Jul 04 '19 17:07 naiquevin

I think we should leave the package name normalization up to pip.

gaborbernat avatar Sep 06 '22 07:09 gaborbernat