Skip to content

Commit 2cedffa

Browse files
committed
added version imports to fileformats packages
1 parent 0b2ed9d commit 2cedffa

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

nipype2pydra/pkg_gen/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ def copy_ignore(_, names):
689689
continue
690690
with open(fspath) as f:
691691
contents = f.read()
692-
contents = re.sub(r"(?<![0-9a-zA-Z])CHANGEME(?![0-9a-zA-Z])", pkg, contents)
692+
contents = re.sub(r"\bCHANGEME\b", pkg, contents)
693693
with open(fspath, "w") as f:
694694
f.write(contents)
695695

@@ -790,7 +790,7 @@ def extract_doctest_inputs(
790790

791791

792792
def gen_fileformats_module(pkg_formats: ty.Set[str]):
793-
code_str = "from fileformats.generic import File"
793+
code_str = "from ._version import __version__ # noqa: F401\nfrom fileformats.generic import File"
794794
for ext in pkg_formats:
795795
frmt = ext2format_name(ext)
796796
code_str += f"""
@@ -803,7 +803,8 @@ class {frmt}(File):
803803

804804

805805
def gen_fileformats_extras_module(pkg: str, pkg_formats: ty.Set[str]):
806-
code_str = """from pathlib import Path
806+
code_str = """from ._version import __version__ # noqa: F401
807+
from pathlib import Path
807808
import typing as ty
808809
from random import Random
809810
from fileformats.core import FileSet

0 commit comments

Comments
 (0)