Skip to content

Repository constructor should accept Path objects #315

@denilsonsa

Description

@denilsonsa

Consider this short piece of code:

from pathlib import Path
from pydriller import Repository

REPO_DIR = Path('~/foo/bar/').expanduser()
repo = Repository(REPO_DIR)

It breaks:

Exception: The path to the repo has to be of type 'string' or 'list of strings'!

It's worth noting that GitPython's Repo supports any PathLike object.

Workaround

Yes, I can manually convert the Path to a string. But PyDriller should support Path objects natively.

Metadata

Metadata

Assignees

No one assigned

    Labels

    PR welcomeIssue is confirmed, but not fixed yetenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions