diff --git a/.bazelrc b/.bazelrc new file mode 100644 index 0000000..1a61f35 --- /dev/null +++ b/.bazelrc @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b8d3d7a..657d1f8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 @@ -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 diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index efc166c..bde8fc4 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -7,7 +7,7 @@ on: types: [published] env: - USE_BAZEL_VERSION: "7.6.1" + USE_BAZEL_VERSION: "6.5.0" jobs: @@ -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) }} @@ -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: | @@ -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 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..62a1c5d --- /dev/null +++ b/.gitignore @@ -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/ diff --git a/WORKSPACE b/WORKSPACE index a81eef7..1f20477 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -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. diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..366fd7c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools<70", "wheel"] +build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py index 3c3bf72..5b6b372 100644 --- a/setup.py +++ b/setup.py @@ -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",