-
Notifications
You must be signed in to change notification settings - Fork 137
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
flit_core: refactor path handling to use pathlib #516
base: main
Are you sure you want to change the base?
Conversation
c932b0b
to
aa616bf
Compare
@@ -201,18 +231,18 @@ def _check_glob_patterns(pats, clude): | |||
.format(clude, p) | |||
) | |||
|
|||
normp = osp.normpath(p) | |||
normp = posix_normpath(PurePosixPath(p)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a behaviour change on Windows -- since it's switching from Windows paths to POSIX paths.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The path handling seemed buggy/inconsistent here since os.path.normpath is filesystem/os specific and these validations I think need to be consistent across platforms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests already expect these paths to always be posix style at the moment, as this path is not an absolute path on windows:
flit/flit_core/flit_core/tests/test_config.py
Line 109 in 6982fae
('/home', 'absolute path'), |
I'm not sure that it is particularly useful to make such a migration, but I'll leave the merits of thinking about those to others. |
77ce6ab
to
6b44347
Compare
6b44347
to
c0372ae
Compare
This should make path handling easier/cleaner compared with using
os.path
.