From af6c602214716e8be77b6e82a5e5ec4dca5306fb Mon Sep 17 00:00:00 2001 From: Elijah Ben Izzy Date: Sat, 18 Apr 2026 20:35:16 -0700 Subject: [PATCH] fix: clean wheel contents and update .rat-excludes for release Wheel cleanup: - Remove .terraform.lock.hcl and .gitignore from wheel (not runtime deps) - Remove source maps from UI build (debug artifacts, saves ~15MB) RAT excludes: - Add .github/ templates (YAML/MD with frontmatter, can't take headers) - Add image file extensions (.png, .gif, .ico, .jpg) - Add ASF header to examples/deployment/aws/terraform/tutorial.md --- .rat-excludes | 9 +++++++++ examples/deployment/aws/terraform/tutorial.md | 19 +++++++++++++++++++ scripts/apache_release.py | 18 ++++++++++++++++++ 3 files changed, 46 insertions(+) diff --git a/.rat-excludes b/.rat-excludes index 5347d2139..73b974ea6 100644 --- a/.rat-excludes +++ b/.rat-excludes @@ -33,5 +33,14 @@ website/src/components/ui/.*\.tsx # SVG files (third-party logos and graphics, headers impractical) .*\.svg +# GitHub templates and config (YAML/MD with frontmatter, headers impractical) +\.github/.* + +# Image files (binary, cannot contain headers) +.*\.png +.*\.gif +.*\.ico +.*\.jpg + # Examples pattern (legacy - keeping for compatibility) apache_burr-.*/burr/examples diff --git a/examples/deployment/aws/terraform/tutorial.md b/examples/deployment/aws/terraform/tutorial.md index 93883f90d..11a033466 100644 --- a/examples/deployment/aws/terraform/tutorial.md +++ b/examples/deployment/aws/terraform/tutorial.md @@ -1,3 +1,22 @@ + + # Apache Burr AWS Tracking Infrastructure Tutorial This tutorial explains how to deploy Apache Burr tracking infrastructure on AWS using Terraform. All Terraform code lives in `examples/deployment/aws/terraform/`. It covers deployment with S3 only (polling mode), with S3 and SQS (event-driven mode), and local development without AWS. diff --git a/scripts/apache_release.py b/scripts/apache_release.py index 0c355ba62..8927bece3 100644 --- a/scripts/apache_release.py +++ b/scripts/apache_release.py @@ -477,11 +477,28 @@ def _build_ui_artifacts() -> None: except Exception as e: _fail(f"Failed to copy build artifacts: {e}") + # Remove source maps (debug artifacts, not needed in wheel) + for map_file in glob.glob(os.path.join(ui_build_dir, "**", "*.map"), recursive=True): + os.remove(map_file) + print(f" ✓ Removed source map: {os.path.basename(map_file)}") + # Verify if not os.path.exists(ui_build_dir) or not os.listdir(ui_build_dir): _fail(f"UI build directory is empty: {ui_build_dir}") +def _clean_wheel_excludes() -> None: + """Remove files that should not be in the wheel distribution.""" + excludes = [ + "burr/tracking/server/s3/deployment/terraform/.terraform.lock.hcl", + "burr/tracking/server/s3/deployment/terraform/.gitignore", + ] + for filepath in excludes: + if os.path.exists(filepath): + os.remove(filepath) + print(f" ✓ Removed from wheel: {filepath}") + + def _prepare_wheel_contents() -> tuple[bool, bool, Optional[str]]: """Handle burr/examples symlink: replace with real files for wheel.""" burr_examples_dir = "burr/examples" @@ -550,6 +567,7 @@ def _build_wheel_from_current_dir(version: str, output_dir: str = "dist") -> str _build_ui_artifacts() _print_step(2, 3, "Preparing wheel contents") + _clean_wheel_excludes() copied, was_symlink, symlink_target = _prepare_wheel_contents() _print_step(3, 3, "Building wheel with flit")