Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

strip trailing slash from package_dir before counting slashes #913

Merged
merged 1 commit into from Jan 24, 2017

Conversation

davidszotten
Copy link
Contributor

No description provided.

@jaraco
Copy link
Member

jaraco commented Jan 7, 2017

What's the purpose of this change? What issue does it solve? Should it have a test (what would prevent someone from optimizing this change away)? Are there conditions where this change will cause problems?

@davidszotten
Copy link
Contributor Author

Hi! Apologies, wasn't sure of your process so figured i'd just throw this over the wall and see what response, if any it provoked.

I was getting Can't get a consistent path to setup script from installation directory when trying to pip install -e a package the other day, and eventually tracked it down to a trailing slash in package_dir. The docs i've seen don't use trailing slashes in the examples, but also don't mention that they aren't allowed.

It looks like the edited code is using slashes as a heuristic for how far up the tree to walk, and i guessed that it might be getting confused by the trailing slash

unfortunately i'm new to this codebase, so was hoping for some guidance from yourself or some other core dev as to other (potentially bad) implications of this change, as well as how to best test it

Thanks!

@jaraco
Copy link
Member

jaraco commented Jan 15, 2017

I figured it was something like that. Thanks for providing the background. It sure would be nice to have a test for this - I'm not sure where it would go, if it should be a test for the develop command, or for the package_dir values. The fix also should consider non-Unix paths. Perhaps the whole routine should be written to use os.path.relpath or similar in order to avoid re-inventing the wheel.

@jaraco jaraco merged commit 3f806c1 into pypa:master Jan 24, 2017
jaraco added a commit that referenced this pull request Jan 24, 2017
jaraco added a commit that referenced this pull request Jan 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants