Skip to content

Commit 1b6f3e0

Browse files
authored
Merge pull request #100 from ArcanaFramework/relative-copy-check
Checks if a directory is being copied into itself
2 parents 5c57f8b + 2906c68 commit 1b6f3e0

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

extras/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ requires-python = ">=3.8"
1010
dependencies = [
1111
"fileformats",
1212
"imageio >=2.24.0",
13-
"pydra >= 0.23.0a",
13+
"pydra",
1414
"PyYAML>=6.0",
1515
"pydicom >=2.3",
1616
"medimages4tests",

fileformats/core/fileset.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,6 +1544,10 @@ def hardlink_dir(src: Path, dest: Path) -> None:
15441544
for fspath, new_path in src_dest:
15451545
new_path.parent.mkdir(parents=True, exist_ok=True)
15461546
if fspath.is_dir():
1547+
if new_path.is_relative_to(fspath): # type: ignore[attr-defined]
1548+
raise ValueError(
1549+
f"Cannot copy directory {fspath} into itself at {new_path}"
1550+
)
15471551
copy_dir(fspath, new_path)
15481552
else:
15491553
try:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ test = [
5151
"pytest >=6.2.5",
5252
"pytest-env>=0.6.2",
5353
"pytest-cov>=2.12.1",
54-
"pydra >0.24",
54+
"pydra",
5555
"fileformats-extras",
5656
]
5757
docs = [

0 commit comments

Comments
 (0)