Give precedence to --extra-search-dir paths when finding distribute/setuptools #193

Merged
merged 2 commits into from Nov 30, 2011

Conversation

Projects
None yet
2 participants
@ejucovy
Contributor

ejucovy commented Nov 30, 2011

Currently the first matching setuptools/distribute package is installed by virtualenv. Since --extra-search-dir paths are appended to the search_dirs list, this means that the default search_dirs (virtualenv_support etc) always have precedence over the user-provided search dirs.

The opposite seems like it would be more useful, since it would allow a user to circumvent the default installations without needing to dig through system files and delete virtualenv_support directories. See #181 for an example where someone tried to do exactly this, but failed because of the current behavior.

prefer the last setuptools/distribute distribution found in the avail…
…able search_dirs, so that --extra-search-dir paths will take precedence over packages found in the default search dirs
@carljm

This comment has been minimized.

Show comment
Hide comment
@carljm

carljm Nov 30, 2011

Contributor

Thanks for the analysis on this. Wouldn't the code be a bit more straightforward if you just iterated over reversed(dirs) and returned the first one found, rather than having to bother with the if len / negative index business?

Contributor

carljm commented Nov 30, 2011

Thanks for the analysis on this. Wouldn't the code be a bit more straightforward if you just iterated over reversed(dirs) and returned the first one found, rather than having to bother with the if len / negative index business?

@ejucovy

This comment has been minimized.

Show comment
Hide comment
@ejucovy

ejucovy Nov 30, 2011

Contributor

Heh. Whoops, yes, that would definitely be more straightforward. I made the change you suggest in 39b98cd (should be attached to this pull request now)

Contributor

ejucovy commented Nov 30, 2011

Heh. Whoops, yes, that would definitely be more straightforward. I made the change you suggest in 39b98cd (should be attached to this pull request now)

carljm added a commit that referenced this pull request Nov 30, 2011

Merge pull request #193 from ejucovy/develop
Give precedence to --extra-search-dir paths when finding distribute/setuptools

@carljm carljm merged commit f95e30b into pypa:develop Nov 30, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment