Skip to content

Conversation

@czgdp1807
Copy link

@czgdp1807 czgdp1807 commented Dec 25, 2025

Description

This PR enables cross-platform CI/CD support, adds Python 3.13 compatibility, and stabilizes the Bazel build environment with explicit configuration for consistent builds across all platforms.

Changes

CI/CD Infrastructure

  1. Cross-Platform Workflows: Enable macOS testing and wheel building

    • Updated test.yml to run on both ubuntu-latest and macos-latest (arm64)
    • Updated wheels.yml to build wheels on both Ubuntu and macOS platforms
    • Expanded test matrix to 10 configurations: 2 OS x 5 Python versions (3.9-3.13)
  2. Bazel Build System Stabilization

    • Downgrade Bazel from 7.6.1 to 6.5.0 for improved certificate handling stability
    • Add explicit Bazel pre-installation step in both workflows
    • Install Bazel to ~/.local/bin with --no-check-certificate flag for robustness
    • Create .bazelrc configuration file for consistent C++ compilation
      • Force C++17 standard for both target and host compilation (--cxxopt and --host_cxxopt)
      • Add -fno-strict-aliasing flag for compatibility
      • Disable bzlmod to use traditional WORKSPACE system
      • Add verbose failure logging for CI debugging

Python & Packaging

  1. Python 3.13 Support

    • Add Python 3.12 and 3.13 to test and wheel build matrices
    • Update setup.py classifiers for new Python versions
  2. Build System Configuration

    • Create pyproject.toml with PEP 517 build system specification
    • Pin setuptools<70 and build<2.0 in build dependencies to ensure Metadata 2.3 compatibility
    • Note: PyPI only supports Metadata 2.3 (rejects 2.4 generated by setuptools 70+)
  3. Zlib Dependency Upgrade

    • Upgrade zlib from 1.2.12 to 1.3.1 in WORKSPACE
    • Fixes macro conflicts and compilation issues on macOS with newer Clang versions
    • Resolves Apple Silicon compatibility issues (e.g., fdopen macro redefinition)

Repository Hygiene

  1. Add .gitignore File
    • Exclude Bazel-generated directories: bazel-bin, bazel-metadata, bazel-out, bazel-testlogs
    • Ignore generated protobuf Python files: tensorflow_metadata/proto/v0/*_pb2.py
    • Prevent build artifacts from tracking: build/, dist/, *.egg-info/

PyPI Integration

  1. Simplify PyPI Configuration
    • Remove explicit repository-url from publish step to use PyPI's default legacy endpoint
    • Maintain verify-metadata: false due to pkginfo/twine version constraints on runners

Motivation

  • Cross-Platform Support: Enable developers on macOS and Apple Silicon to contribute and test locally
  • Python Compatibility: Support current and upcoming Python versions (3.12, 3.13)
  • Build Reliability: Explicit Bazel installation and configuration ensures consistent builds across all CI runners
  • Clean Repository: Prevent generated and build artifacts from cluttering version control
  • PyPI Compatibility: Ensure wheels meet PyPI's metadata version requirements

Testing

  • CI will test on: Ubuntu (x86_64) and macOS (arm64)
  • Wheels built for: 2 OS x 5 Python versions = 10 configurations
  • Verify: All CI jobs pass on both platforms
  • Local testing: pip install -e . and pytest should work on both Ubuntu and macOS

Notes

- Upgrade zlib from 1.2.12 to 1.3.1 for Apple Silicon compatibility
- Add .gitignore for generated files and Bazel artifacts
- Add macOS runners to both test and wheel build workflows
- Update Python version matrix to include 3.13
Pin setuptools<70 and build<2.0 to ensure PyPI-compatible Metadata 2.3
generation. Consolidate build artifact patterns in .gitignore.
- Downgrade Bazel from 7.6.1 to 6.5.0 for certificate handling stability
- Add pre-build Bazel installation step with direct download (bypassing cert checks)
- Install Bazel to ~/.local/bin and update PATH for consistent CI environment
- Remove explicit PyPI repository URL (use default legacy endpoint)
- Add Python 3.12 and 3.13 classifier support

This ensures consistent Bazel availability across all CI runners (Linux/macOS)
and improves compatibility with current PyPI publishing practices.
@czgdp1807 czgdp1807 changed the title build: Enable macOS testing, upgrade zlib, add Python 3.13, and add .gitignore build: enable macOS CI, add Python 3.13, and stabilize Bazel configuration Dec 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant