-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
Bug: common_base
not found on Windows
#15
Comments
Hey @hectormz ! Thanks so much for such a thorough bug report, it's very helpful. I'd welcome any contribution :) LMK if I can help at all. |
@econchick sure thing. I'll make a PR and see what you think! Another thing that I found was that I had I can include that version requirement in |
Ah good catch - yea feel free to through that in the same PR (separate commit if possible though). I appreciate it! |
So instead of fixing all the paths, I tried to keep the bug fix very narrow. Unfortunately I don't have an easy way to test on a windows machine. Would you mind checking out #18 for me? In the mean time, I'm going to try and get github actions to work w windows, but it's not as easy as I thought... |
@hectormz aha! I got windows testing to work on github! and found lots of test failures :D I am working through them :) |
Yes, let me get to my computer and test this out for you. |
@econchick awesome! When I was working through this I found it easier to test on a Linux VM then figure out the Windows test failures 😁. I assumed they might be due to the posix-style path patterns in the tests? |
First of all, I really like the intent of this package! 👍
Is this a BUG REPORT or FEATURE REQUEST?:
Description of Bug or Feature
Environment
interrogate
version: 1.14What happened
utils.get_common_base()
does not find the common base for files on Windows.This happens because path levels are split by
\\
in Python on Windows. As a result, thecommon_base
is an empty string (""
). This has a downstream effect when generating the summary tables.Specifically, in
_get_filename()
, since thecommon_base
is an empty string, a filepath:C:\path\to\project_root\src\file.py
becomes
:\path\to\project_root\src\file.py
instead of:
\src\file.py
Suggestion
Since this is a python 3.5+ project, I think that this could be fixed in a flexible way by handling filepaths with
pathlib
instead.For example this in
utils.py
:could be replaced with:
(if file names had not already been converted to
Path
objects)Using
pathlib
here would help make this feature work across systems, but I think it could also replace just about all path manipulationinterrogate
usesos
for.If you'd like I could work contributing to any of these proposed changes.
The text was updated successfully, but these errors were encountered: