-
Notifications
You must be signed in to change notification settings - Fork 182
139 lines (124 loc) · 4.75 KB
/
conda-build.yml
File metadata and controls
139 lines (124 loc) · 4.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: Build data-validation with Conda
on:
push:
branches:
- master
pull_request:
branches:
- master
release:
types: [published]
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-name: tfdv-build
cache-environment: true
create-args: >-
python=${{ matrix.python-version }}
- name: Display environment info
shell: bash -l {0}
run: |
micromamba info
micromamba list
- name: Install Bazel
shell: bash -l {0}
run: |
# Install Bazelisk (manages Bazel versions)
if [ "$RUNNER_OS" == "Linux" ]; then
curl -Lo /tmp/bazelisk https://github.com/bazelbuild/bazelisk/releases/download/v1.20.0/bazelisk-linux-amd64
elif [ "$RUNNER_OS" == "macOS" ]; then
curl -Lo /tmp/bazelisk https://github.com/bazelbuild/bazelisk/releases/download/v1.20.0/bazelisk-darwin-amd64
fi
chmod +x /tmp/bazelisk
sudo mv /tmp/bazelisk /usr/local/bin/bazel
bazel --version
# Needed for Xcode 26.x in some CI environments; without this patch,
# Bazel Apple toolchain may fail with an "LC_UUID missing" linker error.
# Currently CI is passing, so keep this disabled. Uncomment if CI starts
# failing with an "LC_UUID missing" error.
# - name: Patch Apple CC toolchain (macOS only)
# if: runner.os == 'macOS'
# shell: bash -l {0}
# run: bazel build //:patch_local_config_apple_cc
- name: Install build tooling
shell: bash -l {0}
run: |
python -m pip install numpy>=1.22.0
python -m pip install --upgrade pip build wheel "setuptools<69.3"
- name: Build the package
shell: bash -l {0}
run: |
python -m build --wheel --no-isolation
- name: Install wheel and dependencies
shell: bash -l {0}
run: |
export TFX_DEPENDENCY_SELECTOR=GIT_MASTER
export USE_BAZEL_VERSION=7.7.0
python -m pip install "apache-beam[gcp]>=2.53,<3" "pandas>=1.0,<3" "numpy>=1.22.0"
python -m pip install git+https://github.com/tensorflow/metadata.git@master --no-deps
# Bypasses PyPI lack of uncompiled prebuilt wheels over modern setups stably
python -m pip install git+https://github.com/tensorflow/tfx-bsl.git@master --no-deps
python -m pip install "tensorflow>=2.21,<2.22"
python -m pip install "absl-py>=0.9,<2.0.0" "joblib>=1.2.0" "pyarrow>=14" "pyfarmhash>=0.2.2,<0.4" "six>=1.12,<2" "dill" "scipy" "scikit-learn"
python -m pip install "protobuf==6.31.1" --force-reinstall
python -m pip install dist/*.whl --no-deps
python -m pip install pytest
- name: Run tests
shell: bash -l {0}
run: |
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
SITE_DIR=$(python -c "import site; print(site.getsitepackages()[0])")
RV_PATH="${SITE_DIR}/google/protobuf/runtime_version.py"
if [ -f "$RV_PATH" ]; then
echo "" >> "$RV_PATH"
echo "def ValidateProtobufRuntimeVersion(*args, **kwargs):" >> "$RV_PATH"
echo " pass" >> "$RV_PATH"
fi
mv tensorflow_data_validation tensorflow_data_validation_bak
SITE_DIR=$(python -c "import site; print(site.getsitepackages()[0])")
cp -r tensorflow_data_validation_bak/statistics/generators/testdata $SITE_DIR/tensorflow_data_validation/statistics/generators/
mkdir -p /tmp/test_dir
cd /tmp/test_dir
python -m pytest --pyargs tensorflow_data_validation
cd -
mv tensorflow_data_validation_bak tensorflow_data_validation
- name: Upload wheel artifact
uses: actions/upload-artifact@v4.4.0
with:
name: data-validation-wheel-${{ matrix.os }}-py${{ matrix.python-version }}
path: dist/*.whl
upload_to_pypi:
name: Upload to PyPI
runs-on: ubuntu-latest
if: (github.event_name == 'release' && startsWith(github.ref, 'refs/tags')) || (github.event_name == 'workflow_dispatch')
needs: [build]
environment:
name: pypi
url: https://pypi.org/p/tensorflow-data-validation/
permissions:
id-token: write
steps:
- name: Retrieve wheels
uses: actions/download-artifact@v4.1.8
with:
merge-multiple: true
path: wheels
- name: List the build artifacts
run: |
ls -lAs wheels/
- name: Upload to PyPI
uses: pypa/gh-action-pypi-publish@release/v1.9
with:
packages_dir: wheels/