Skip to content

Commit f9351a4

Browse files
committed
added __version__ import to base init
1 parent 86e2f65 commit f9351a4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

nipype2pydra/package.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import black.parsing
1515
import black.report
1616
from tqdm import tqdm
17-
import attrs
1817
import yaml
1918
from . import interface
2019
from .utils import (
@@ -1025,6 +1024,12 @@ def write_pkg_inits(
10251024
The names to import in the __init__.py files
10261025
"""
10271026
parts = module_name.split(".")
1027+
# Write base init path that imports __version__ from the auto-generated _version
1028+
# file
1029+
base_init_fspath = package_root.joinpath(*parts, "__init__.py")
1030+
if not base_init_fspath.exists():
1031+
with open(base_init_fspath, "w") as f:
1032+
f.write("from ._version import __version__")
10281033
for i, part in enumerate(reversed(parts[depth:]), start=1):
10291034
mod_parts = parts[:-i]
10301035
parent_mod = ".".join(mod_parts)

0 commit comments

Comments
 (0)