-
-
Notifications
You must be signed in to change notification settings - Fork 154
Paths to repositories and clones can be any PathLike
#319
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
base: master
Are you sure you want to change the base?
Conversation
TestPulse reportTest execution
Files without coverage
Coverage informationNo changes in coverage, nice! 🎉 |
|
The only test that failed is |
| if isinstance(path_to_repo, list): | ||
| path_to_repos = [os.fspath(path) for path in path_to_repo] | ||
| else: | ||
| path_to_repos = [os.fspath(path_to_repo)] |
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.
Why don't we just transform everything in Path here instead of leaving it as strings? We could just transform it to string later when we need it, like in _is_remote. Wdyt?
I feel like it would be much easier to read and play with just Path, rather than a mix. But let me know since you worked on it 😄
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.
Yeah, I think this was the first change that I coded, when I thought I will just keep using strings internally. Then I realised to used PathLike also internally. So I can make it that Repository always converts init parameters to Path objects, and all internal functions assume they are handling Path objects as well.
|
Yeah the test is not your fault. I fixed it now, can you please rebase your branch to master? Also, can you please add a couple of tests to cover all the changes? Thanks! |
Yes, I will use the fixed tests and also duplicate some existing tests which load the repo so that they use |
Fixes #315
Do not force paths to be strings. Most functions now manipulate PathLike objects. Forced conversions to string are removed.
Conversion to string is only done when checking URL.
Since the user will only interact directly with
Repository, the check thatpath_to_repois of appropriate type is moved there fromConf.Minimum Python version is now 3.6 to support
os.PathLike