prezi / snakebasket

A smarter, recursive pip.
84 stars 4 forks source link

Conflicting editables should test for equality before attempting to do a git version comparison #12

Open stanhu opened 10 years ago

stanhu commented 10 years ago

Here's my situation:

1) I have an editable package that had some .pyc files that were not ignored by .gitignore 2) I ran snakebasket once. Installation went fine. 3) I ran snakebasket again. It failed with: "Cannot be upgraded due to uncommitted git modifications."

I checked the source directory and found the problem there, but in looking at the snakebasket code, I see that there is no attempt to do a simple equality comparison between (package A, version X) and (package A, version X), which would have avoided this expensive (and errorneous) git comparison in the first place.

To fix, I propose in versions.py.get_available_substitute() using the set() operator on the packages. For set() to detect duplicates, PackageData needs the hash operator, which is simple to implement. Will submit a pull request shortly.