Skip to content

Commit 0c63b98

Browse files
committed
bug fix for issue #352
1 parent 81ad8d4 commit 0c63b98

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

pypet2bids/pypet2bids/dcm2niix4pet.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,14 @@
8787
pass
8888
else:
8989
try:
90+
# Ensure the parent directory exists before copying
91+
Path(default_metadata_json).parent.mkdir(parents=True, exist_ok=True)
9092
shutil.copy(
9193
Path(metadata_folder) / "template_json.json", default_metadata_json
9294
)
9395
except FileNotFoundError:
96+
# Ensure the parent directory exists before copying
97+
Path(default_metadata_json).parent.mkdir(parents=True, exist_ok=True)
9498
shutil.copy(module_folder / "template_json.json", default_metadata_json)
9599
else:
96100
# if it doesn't exist use the default one included in this library

pypet2bids/pyproject.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,19 @@ Repository = "https://github.com/openneuropet/pet2bids/"
7373

7474
[tool.hatch.build.targets.wheel]
7575
packages = ["pypet2bids"]
76+
include = [
77+
"pypet2bids/template_json.json",
78+
"pypet2bids/ecat_headers.json",
79+
"pypet2bids/template.env",
80+
]
7681

7782
[tool.hatch.build.targets.sdist]
7883
include = [
7984
"/pypet2bids",
8085
"/README.md",
86+
"pypet2bids/template_json.json",
87+
"pypet2bids/ecat_headers.json",
88+
"pypet2bids/template.env",
8189
]
8290

8391
[tool.black]

0 commit comments

Comments
 (0)