Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support setups with all modules in src-directory #9673

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion tools/preprocess_frozen_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,13 @@ def version_string(path=None, *, valid_semver=False):
return version


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