-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-pipelines-macos-steps.yml
51 lines (44 loc) · 1.67 KB
/
azure-pipelines-macos-steps.yml
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
steps:
- task: UsePythonVersion@0
- bash: |
set -o errexit
python3 -m pip install --upgrade pip
pip3 install cibuildwheel cython numpy pandas setuptools twine wheel
brew install --force armadillo cereal gcc cmake ensmallen
displayName: Install dependencies
- bash: |
git clone https://github.com/mlpack/mlpack
cd mlpack
git checkout $(MLPACK_VERSION)
displayName: Clone mlpack
- bash: |
mkdir -p mlpack/build
cd mlpack/build
# We download dependencies so that we get STB automatically.
cmake -DBUILD_PYTHON_BINDINGS=ON -DDOWNLOAD_DEPENDENCIES=ON ../
make python_configured
displayName: Generate setup.py
- bash: |
cd mlpack/build
make -j4 python
mkdir ../py-old/
cp src/mlpack/bindings/python/mlpack/*.pyx ../py-old/
cp src/mlpack/bindings/python/mlpack/*.py ../py-old/
condition: eq(variables['CIBW_ARCHS_MACOS'], 'arm64')
displayName: Build .pyx files before entering build environment
- bash: |
brew uninstall --force armadillo cereal ensmallen arpack hdf5 open-mpi r superlu cmake gcc openblas
displayName: Remove dependencies before entering build environment
- bash: |
export CIBW_BEFORE_BUILD="./$(BUILD_SCRIPT)"
cibuildwheel --output-dir wheelhouse mlpack/build/src/mlpack/bindings/python/
displayName: Build wheels
- task: PublishBuildArtifacts@1
inputs: {pathtoPublish: 'wheelhouse'}
- bash: |
echo "[pypi]" > ~/.pypirc
echo "username = __token__" >> ~/.pypirc
echo "password = $(TWINE_PYPI_TOKEN)" >> ~/.pypirc
twine upload wheelhouse/*.whl
rm -f ~/.pypirc
displayName: Push wheels to PyPI