MonkeyCanCode commented on code in PR #2557: URL: https://github.com/apache/polaris/pull/2557#discussion_r2347616086
########## client/python/generate_clients.py: ########## @@ -83,6 +83,8 @@ Path("generate_clients.py"), Path(".venv"), Path("dist/"), + Path("templates/"), + Path("PKG-INFO"), ] Review Comment: Good call. Resolved now. ########## client/python/generate_clients.py: ########## @@ -266,7 +272,30 @@ def prepend_licenses() -> None: logger.info("License fix complete.") +def prepare_spec_dir(): + logger.info("Preparing spec directory...") + spec_dir = Path(SPEC_DIR) + + if spec_dir.exists(): + logger.info("Spec directory already exists.") + return + + # Create the spec directory if it doesn't exist + spec_source_dir = CLIENT_DIR.parent.parent / "spec" + if spec_source_dir.exists(): + logger.info(f"Copying spec directory from {spec_source_dir} to {spec_dir}") + shutil.copytree(spec_source_dir, spec_dir) + logger.info("Spec directory copied.") + else: + # This will be hit during an sdist build if spec directory wasn't in the package. + logger.error( + "Fatal: spec directory is missing and the source to copy it from was not found." + ) + sys.exit(1) Review Comment: I likes the second option with blindly copy to keep things simple as the files we need to copy is really small and only few of them. However, the purpose change on check spec_source_dir may not be good as this won't exist in sdist. I had pushed the needed change out. Please take another look. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@polaris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org