Skip to content
Open
Show file tree
Hide file tree
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
22 changes: 22 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Bazel configuration for C++ standard and build options

# Enforce C++17 standard for both target and host (tools) compilation
build --cxxopt=-std=gnu++17
build --host_cxxopt=-std=gnu++17
build --cxxopt=-fno-strict-aliasing
build --host_cxxopt=-fno-strict-aliasing

# Disable bzlmod (new module system) to use traditional WORKSPACE
common --noenable_bzlmod

# Don't keep state after build to prevent cache issues
common --nokeep_state_after_build

# Verbose logging for CI debugging
build --verbose_failures

# macOS specific settings
build:macos --cxxopt=-std=gnu++17
build:macos --host_cxxopt=-std=gnu++17
build:macos --cxxopt=-fno-strict-aliasing
build:macos --host_cxxopt=-fno-strict-aliasing
21 changes: 16 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,15 @@ on:
workflow_dispatch:

env:
USE_BAZEL_VERSION: "7.6.1"
USE_BAZEL_VERSION: "6.5.0"

jobs:
tests:
runs-on: ubuntu-latest


runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
os: [ubuntu-latest, macos-latest]
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']

steps:
- uses: actions/checkout@v4
Expand All @@ -31,6 +30,18 @@ jobs:
cache-dependency-path: |
setup.py

- name: Install Bazel
run: |
mkdir -p ~/.local/bin
if [[ "${{ runner.os }}" == "Linux" ]]; then
wget --no-check-certificate -q https://github.com/bazelbuild/bazel/releases/download/${{ env.USE_BAZEL_VERSION }}/bazel-${{ env.USE_BAZEL_VERSION }}-linux-x86_64 -O ~/.local/bin/bazel
elif [[ "${{ runner.os }}" == "macOS" ]]; then
wget --no-check-certificate -q https://github.com/bazelbuild/bazel/releases/download/${{ env.USE_BAZEL_VERSION }}/bazel-${{ env.USE_BAZEL_VERSION }}-darwin-arm64 -O ~/.local/bin/bazel
fi
chmod +x ~/.local/bin/bazel
echo "$HOME/.local/bin" >> $GITHUB_PATH
bazel --version

- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
21 changes: 16 additions & 5 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
types: [published]

env:
USE_BAZEL_VERSION: "7.6.1"
USE_BAZEL_VERSION: "6.5.0"


jobs:
Expand All @@ -18,8 +18,8 @@ jobs:
strategy:
# fail-fast: true
matrix:
os: [ubuntu]
python-version: ['3.9', '3.10', '3.11', '3.12']
os: [ubuntu, macos]
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']


runs-on: ${{ format('{0}-latest', matrix.os) }}
Expand All @@ -34,7 +34,19 @@ jobs:

- name: Install python build dependencies
run: |
python -m pip install --upgrade pip build
python -m pip install --upgrade pip "setuptools<70" "build<2.0" wheel

- name: Install Bazel
run: |
mkdir -p ~/.local/bin
if [[ "${{ runner.os }}" == "Linux" ]]; then
wget --no-check-certificate -q https://github.com/bazelbuild/bazel/releases/download/${{ env.USE_BAZEL_VERSION }}/bazel-${{ env.USE_BAZEL_VERSION }}-linux-x86_64 -O ~/.local/bin/bazel
elif [[ "${{ runner.os }}" == "macOS" ]]; then
wget --no-check-certificate -q https://github.com/bazelbuild/bazel/releases/download/${{ env.USE_BAZEL_VERSION }}/bazel-${{ env.USE_BAZEL_VERSION }}-darwin-arm64 -O ~/.local/bin/bazel
fi
chmod +x ~/.local/bin/bazel
echo "$HOME/.local/bin" >> $GITHUB_PATH
bazel --version

- name: Build wheels
run: |
Expand Down Expand Up @@ -79,7 +91,6 @@ jobs:
uses: pypa/gh-action-pypi-publish@release/v1.12
with:
packages-dir: wheels/
repository-url: https://pypi.org/legacy/
# already checked, and the pkginfo/twine versions on this runner causes check to fail
verify-metadata: false
verbose: true
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
bazel-bin
bazel-metadata
bazel-out
bazel-testlogs
tensorflow_metadata/proto/v0/anomalies_pb2.py
tensorflow_metadata/proto/v0/derived_feature_pb2.py
tensorflow_metadata/proto/v0/metric_pb2.py
tensorflow_metadata/proto/v0/path_pb2.py
tensorflow_metadata/proto/v0/problem_statement_pb2.py
tensorflow_metadata/proto/v0/schema_pb2.py
tensorflow_metadata/proto/v0/statistics_pb2.py
build/
dist/
*.egg-info/
6 changes: 3 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ http_archive(
http_archive(
name = "zlib",
build_file = "@com_google_protobuf//:third_party/zlib.BUILD",
sha256 = "d8688496ea40fb61787500e863cc63c9afcbc524468cedeb478068924eb54932",
strip_prefix = "zlib-1.2.12",
urls = ["https://github.com/madler/zlib/archive/v1.2.12.tar.gz"],
sha256 = "17e88863f3600672ab49182f217281b6fc4d3c762bde361935e436a95214d05c",
strip_prefix = "zlib-1.3.1",
urls = ["https://github.com/madler/zlib/archive/v1.3.1.tar.gz"],
)

# Needed by com_google_protobuf.
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools<70", "wheel"]
build-backend = "setuptools.build_meta"
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ def run(self):
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Mathematics",
Expand Down