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

Norm path before compare #11719

Merged
merged 3 commits into from
Mar 27, 2023
Merged

Conversation

lorddavidiii
Copy link
Contributor

@lorddavidiii lorddavidiii commented Jan 10, 2023

This PR norms the paths before checking, if the installed scripts are on PATH. I got wrong warnings, when the PATH contains something like /a/./bin instead of /a/bin.

I also add a small test for this, contains all the cases from the os.path.normpath() docs. I am not sure, if this works also on windows and I am also not sure, if I should add a news fragment, as this is just a small change.

@uranusjr
Copy link
Member

Would you mind investigating using pathlib.Path for this block of code instead? It should allow more succinct code for the same logic.

@lorddavidiii
Copy link
Contributor Author

hm, the failing tests looks unrelated this PR to me, or?

@uranusjr
Copy link
Member

Looks like the CI stack had some (hopefully temporary) downtime.

@pradyunsg
Copy link
Member

@lorddavidiii Thanks for filing this PR and for exploring the migration of this function to pathlib! ^.^

I've rebased this PR on main and split it -- the commits that migrate this function to pathlib are in #11903, and this PR fixes specifically what it was originally changing.

I think the pathlib variant is harder to read and follow than the original function. We can discuss any "should this change to pathlib" related concerns there.

@pradyunsg pradyunsg merged commit d894759 into pypa:main Mar 27, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants