File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 14
14
import black .parsing
15
15
import black .report
16
16
from tqdm import tqdm
17
- import attrs
18
17
import yaml
19
18
from . import interface
20
19
from .utils import (
@@ -1025,6 +1024,12 @@ def write_pkg_inits(
1025
1024
The names to import in the __init__.py files
1026
1025
"""
1027
1026
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__" )
1028
1033
for i , part in enumerate (reversed (parts [depth :]), start = 1 ):
1029
1034
mod_parts = parts [:- i ]
1030
1035
parent_mod = "." .join (mod_parts )
You can’t perform that action at this time.
0 commit comments