Skip to content

Commit 5dbf9bd

Browse files
authored
Merge pull request #60 from czgdp1807/mtd-dev-upd
build: enable macOS CI, add Python 3.13, and stabilize Bazel configuration
2 parents 89db61c + c179d3a commit 5dbf9bd

File tree

7 files changed

+76
-13
lines changed

7 files changed

+76
-13
lines changed

.bazelrc

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Bazel configuration for C++ standard and build options
2+
3+
# Enforce C++17 standard for both target and host (tools) compilation
4+
build --cxxopt=-std=gnu++17
5+
build --host_cxxopt=-std=gnu++17
6+
build --cxxopt=-fno-strict-aliasing
7+
build --host_cxxopt=-fno-strict-aliasing
8+
9+
# Disable bzlmod (new module system) to use traditional WORKSPACE
10+
common --noenable_bzlmod
11+
12+
# Don't keep state after build to prevent cache issues
13+
common --nokeep_state_after_build
14+
15+
# Verbose logging for CI debugging
16+
build --verbose_failures
17+
18+
# macOS specific settings
19+
build:macos --cxxopt=-std=gnu++17
20+
build:macos --host_cxxopt=-std=gnu++17
21+
build:macos --cxxopt=-fno-strict-aliasing
22+
build:macos --host_cxxopt=-fno-strict-aliasing

.github/workflows/test.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,15 @@ on:
99
workflow_dispatch:
1010

1111
env:
12-
USE_BAZEL_VERSION: "7.6.1"
12+
USE_BAZEL_VERSION: "6.5.0"
1313

1414
jobs:
1515
tests:
16-
runs-on: ubuntu-latest
17-
18-
16+
runs-on: ${{ matrix.os }}
1917
strategy:
2018
matrix:
21-
python-version: ['3.9', '3.10', '3.11', '3.12']
19+
os: [ubuntu-latest, macos-latest]
20+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
2221

2322
steps:
2423
- uses: actions/checkout@v4
@@ -31,6 +30,18 @@ jobs:
3130
cache-dependency-path: |
3231
setup.py
3332
33+
- name: Install Bazel
34+
run: |
35+
mkdir -p ~/.local/bin
36+
if [[ "${{ runner.os }}" == "Linux" ]]; then
37+
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
38+
elif [[ "${{ runner.os }}" == "macOS" ]]; then
39+
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
40+
fi
41+
chmod +x ~/.local/bin/bazel
42+
echo "$HOME/.local/bin" >> $GITHUB_PATH
43+
bazel --version
44+
3445
- name: Install dependencies
3546
run: |
3647
python -m pip install --upgrade pip

.github/workflows/wheels.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
types: [published]
88

99
env:
10-
USE_BAZEL_VERSION: "7.6.1"
10+
USE_BAZEL_VERSION: "6.5.0"
1111

1212

1313
jobs:
@@ -18,8 +18,8 @@ jobs:
1818
strategy:
1919
# fail-fast: true
2020
matrix:
21-
os: [ubuntu]
22-
python-version: ['3.9', '3.10', '3.11', '3.12']
21+
os: [ubuntu, macos]
22+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
2323

2424

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

3535
- name: Install python build dependencies
3636
run: |
37-
python -m pip install --upgrade pip build
37+
python -m pip install --upgrade pip "setuptools<70" "build<2.0" wheel
38+
39+
- name: Install Bazel
40+
run: |
41+
mkdir -p ~/.local/bin
42+
if [[ "${{ runner.os }}" == "Linux" ]]; then
43+
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
44+
elif [[ "${{ runner.os }}" == "macOS" ]]; then
45+
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
46+
fi
47+
chmod +x ~/.local/bin/bazel
48+
echo "$HOME/.local/bin" >> $GITHUB_PATH
49+
bazel --version
3850
3951
- name: Build wheels
4052
run: |
@@ -79,7 +91,6 @@ jobs:
7991
uses: pypa/gh-action-pypi-publish@release/v1.12
8092
with:
8193
packages-dir: wheels/
82-
repository-url: https://pypi.org/legacy/
8394
# already checked, and the pkginfo/twine versions on this runner causes check to fail
8495
verify-metadata: false
8596
verbose: true

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
bazel-bin
2+
bazel-metadata
3+
bazel-out
4+
bazel-testlogs
5+
tensorflow_metadata/proto/v0/anomalies_pb2.py
6+
tensorflow_metadata/proto/v0/derived_feature_pb2.py
7+
tensorflow_metadata/proto/v0/metric_pb2.py
8+
tensorflow_metadata/proto/v0/path_pb2.py
9+
tensorflow_metadata/proto/v0/problem_statement_pb2.py
10+
tensorflow_metadata/proto/v0/schema_pb2.py
11+
tensorflow_metadata/proto/v0/statistics_pb2.py
12+
build/
13+
dist/
14+
*.egg-info/

WORKSPACE

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ http_archive(
2626
http_archive(
2727
name = "zlib",
2828
build_file = "@com_google_protobuf//:third_party/zlib.BUILD",
29-
sha256 = "d8688496ea40fb61787500e863cc63c9afcbc524468cedeb478068924eb54932",
30-
strip_prefix = "zlib-1.2.12",
31-
urls = ["https://github.com/madler/zlib/archive/v1.2.12.tar.gz"],
29+
sha256 = "17e88863f3600672ab49182f217281b6fc4d3c762bde361935e436a95214d05c",
30+
strip_prefix = "zlib-1.3.1",
31+
urls = ["https://github.com/madler/zlib/archive/v1.3.1.tar.gz"],
3232
)
3333

3434
# Needed by com_google_protobuf.

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["setuptools<70", "wheel"]
3+
build-backend = "setuptools.build_meta"

setup.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ def run(self):
124124
"Programming Language :: Python :: 3.9",
125125
"Programming Language :: Python :: 3.10",
126126
"Programming Language :: Python :: 3.11",
127+
"Programming Language :: Python :: 3.12",
128+
"Programming Language :: Python :: 3.13",
127129
"Programming Language :: Python :: 3 :: Only",
128130
"Topic :: Scientific/Engineering :: Artificial Intelligence",
129131
"Topic :: Scientific/Engineering :: Mathematics",

0 commit comments

Comments
 (0)