Skip to content

Commit 82f5a5e

Browse files
committed
refactor!(Base class): Make repo_name into property
1 parent 80ea73e commit 82f5a5e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

libvcs/projects/base.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,6 @@ def __init__(self, *, url: str, dir: StrPath, progress_callback=None, **kwargs):
9191
#: Parent directory
9292
self.parent_dir = self.dir.parent
9393

94-
#: Base name of checkout
95-
self.repo_name = self.dir.stem
96-
9794
if "rev" in kwargs:
9895
self.rev = kwargs["rev"]
9996

@@ -110,6 +107,10 @@ def __init__(self, *, url: str, dir: StrPath, progress_callback=None, **kwargs):
110107
bin_name=self.bin_name, keyword=self.repo_name, logger=logger, extra={}
111108
)
112109

110+
@property
111+
def repo_name(self) -> str:
112+
return self.dir.stem
113+
113114
@classmethod
114115
def from_pip_url(cls, pip_url, **kwargs):
115116
url, rev = convert_pip_url(pip_url)

0 commit comments

Comments
 (0)