Skip to content

Commit 3b07c3c

Browse files
committed
support setups with all modules in src-directory
1 parent e445047 commit 3b07c3c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tools/preprocess_frozen_modules.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,13 @@ def version_string(path=None, *, valid_semver=False):
4242
return version
4343

4444

45-
# Visit all the .py files in topdir. Replace any __version__ = "0.0.0-auto.0" type of info
45+
# Visit all the .py files in topdir or src. Replace any __version__ = "0.0.0-auto.0" type of info
4646
# with actual version info derived from git.
4747
def copy_and_process(in_dir, out_dir):
48+
# setuptools default: use modules from 'src' if the directory exists
49+
src_dir = in_dir + os.path.sep + "src"
50+
if os.path.exists(src_dir) and os.path.isdir(src_dir):
51+
in_dir = src_dir
4852
for root, subdirs, files in os.walk(in_dir):
4953
# Skip library examples directory and subfolders.
5054
relative_path_parts = Path(root).relative_to(in_dir).parts

0 commit comments

Comments
 (0)