Skip to content

Commit bdb3e65

Browse files
reckless: fix installation from local directories with subpaths
This could previously copy the parent directory of a plugin into the installed reckless directory, which was unnecessary.
1 parent a899dea commit bdb3e65

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

tests/test_reckless.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ def test_poetry_install(node_factory):
231231

232232

233233
@unittest.skipIf(VALGRIND, "virtual environment triggers memleak detection")
234-
@unittest.skip("Broken")
235234
def test_local_dir_install(node_factory):
236235
"""Test search and install from local directory source."""
237236
n = get_reckless_node(node_factory)

tools/reckless

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,10 +1175,13 @@ def _install_plugin(src: InstInfo) -> Union[InstInfo, None]:
11751175
log.debug(f'{clone_path} already exists - deleting')
11761176
shutil.rmtree(clone_path)
11771177
if src.srctype == Source.DIRECTORY:
1178+
full_source_path = Path(src.source_loc)
1179+
if src.subdir:
1180+
full_source_path /= src.subdir
11781181
log.debug(("copying local directory contents from"
1179-
f" {src.source_loc}"))
1182+
f" {full_source_path}"))
11801183
create_dir(clone_path)
1181-
shutil.copytree(src.source_loc, plugin_path)
1184+
shutil.copytree(full_source_path, plugin_path)
11821185
elif src.srctype in [Source.LOCAL_REPO, Source.GITHUB_REPO,
11831186
Source.OTHER_URL, Source.GIT_LOCAL_CLONE]:
11841187
# clone git repository to /tmp/reckless-...

0 commit comments

Comments
 (0)