We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 86e2f65 commit f9351a4Copy full SHA for f9351a4
nipype2pydra/package.py
@@ -14,7 +14,6 @@
14
import black.parsing
15
import black.report
16
from tqdm import tqdm
17
-import attrs
18
import yaml
19
from . import interface
20
from .utils import (
@@ -1025,6 +1024,12 @@ def write_pkg_inits(
1025
1024
The names to import in the __init__.py files
1026
"""
1027
parts = module_name.split(".")
+ # 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__")
1033
for i, part in enumerate(reversed(parts[depth:]), start=1):
1034
mod_parts = parts[:-i]
1035
parent_mod = ".".join(mod_parts)
0 commit comments