-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Build platform specific python packages with ci-build-wheel (#2555)
* ci build wheel Signed-off-by: pyalex <[email protected]> * compile go only with env var Signed-off-by: pyalex <[email protected]> * filter go extensions Signed-off-by: pyalex <[email protected]> * copy full directory on inplace build_ext Signed-off-by: pyalex <[email protected]> * copytree from distutils Signed-off-by: pyalex <[email protected]>
- Loading branch information
Showing
3 changed files
with
158 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,95 +126,121 @@ jobs: | |
run: ./infra/scripts/helm/push-helm-charts.sh $VERSION_WITHOUT_PREFIX | ||
|
||
publish-python-sdk: | ||
runs-on: ubuntu-latest | ||
needs: [build-python-sdk, build-python-sdk-no-telemetry, build-python-sdk-macos-py310] | ||
steps: | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: wheels | ||
path: dist | ||
- uses: pypa/[email protected] | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_PASSWORD }} | ||
|
||
|
||
build-python-sdk: | ||
name: Build wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [ "3.7", "3.8", "3.9", "3.10" ] | ||
os: [ ubuntu-latest, macOS-latest ] | ||
compile-go: [ True ] | ||
include: | ||
- python-version: "3.7" | ||
os: ubuntu-latest | ||
compile-go: False | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
COMPILE_GO: ${{ matrix.compile-go }} | ||
os: [ ubuntu-latest, macos-10.15 ] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup Python | ||
id: setup-python | ||
uses: actions/setup-python@v2 | ||
|
||
- name: Build wheels | ||
uses: pypa/cibuildwheel@v2.4.0 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
architecture: x64 | ||
- name: Setup Go | ||
id: setup-go | ||
uses: actions/setup-go@v2 | ||
package-dir: sdk/python | ||
env: | ||
CIBW_BUILD: "cp3*_x86_64" | ||
CIBW_SKIP: "cp36-* *-musllinux_x86_64 cp310-macosx_x86_64" | ||
CIBW_ARCHS: "native" | ||
CIBW_ENVIRONMENT: > | ||
COMPILE_GO=True | ||
CIBW_BEFORE_ALL_LINUX: | | ||
yum install -y golang | ||
CIBW_BEFORE_ALL_MACOS: | | ||
curl -o python.pkg https://www.python.org/ftp/python/3.9.12/python-3.9.12-macosx10.9.pkg | ||
sudo installer -pkg python.pkg -target / | ||
CIBW_BEFORE_BUILD: | | ||
make install-protoc-dependencies | ||
make install-go-proto-dependencies | ||
make install-go-ci-dependencies | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
go-version: 1.17.7 | ||
- name: Upgrade pip version | ||
run: | | ||
pip install --upgrade "pip>=21.3.1" | ||
- name: Install pip-tools | ||
run: pip install pip-tools | ||
- name: Install dependencies | ||
run: make install-python-ci-dependencies PYTHON=${{ matrix.python-version }} | ||
- name: Publish Python Package | ||
run: | | ||
cd sdk/python | ||
python3 -m pip install --user --upgrade setuptools wheel twine | ||
python3 setup.py sdist bdist_wheel | ||
python3 -m twine upload --verbose dist/*.whl | ||
name: wheels | ||
path: ./wheelhouse/*.whl | ||
|
||
|
||
publish-python-sdk-no-telemetry: | ||
build-python-sdk-no-telemetry: | ||
name: Build no telemetry wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [ "3.7", "3.8", "3.9", "3.10" ] | ||
os: [ ubuntu-latest, macOS-latest ] | ||
compile-go: [ True ] | ||
include: | ||
- python-version: "3.7" | ||
os: ubuntu-latest | ||
compile-go: False | ||
os: [ ubuntu-latest, macos-10.15 ] | ||
needs: get-version | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: | | ||
cd sdk/python | ||
sed -i.bak 's/DEFAULT_FEAST_USAGE_VALUE = "True"/DEFAULT_FEAST_USAGE_VALUE = "False"/g' feast/constants.py | ||
sed -i.bak 's/NAME = "feast"/NAME = "feast-no-telemetry"/g' setup.py | ||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
with: | ||
package-dir: sdk/python | ||
env: | ||
CIBW_BUILD: "cp3*_x86_64" | ||
CIBW_SKIP: "cp36-* *-musllinux_x86_64 cp310-macosx_x86_64" | ||
CIBW_ARCHS: "native" | ||
CIBW_ENVIRONMENT: > | ||
COMPILE_GO=True SETUPTOOLS_SCM_PRETEND_VERSION="${{ needs.get-version.outputs.version_without_prefix }}" | ||
CIBW_BEFORE_ALL_LINUX: | | ||
yum install -y golang | ||
CIBW_BEFORE_ALL_MACOS: | | ||
curl -o python.pkg https://www.python.org/ftp/python/3.9.12/python-3.9.12-macosx10.9.pkg | ||
sudo installer -pkg python.pkg -target / | ||
CIBW_BEFORE_BUILD: | | ||
make install-protoc-dependencies | ||
make install-go-proto-dependencies | ||
make install-go-ci-dependencies | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: wheels | ||
path: ./wheelhouse/*.whl | ||
|
||
build-python-sdk-macos-py310: | ||
runs-on: macos-10.15 | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
COMPILE_GO: ${{ matrix.compile-go }} | ||
COMPILE_GO: True | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup Python | ||
id: setup-python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
python-version: "3.10" | ||
architecture: x64 | ||
- name: Setup Go | ||
id: setup-go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17.7 | ||
- name: Upgrade pip version | ||
run: | | ||
pip install --upgrade "pip>=21.3.1" | ||
- name: Install pip-tools | ||
run: pip install pip-tools | ||
- name: Install dependencies | ||
run: make install-python-ci-dependencies PYTHON=${{ matrix.python-version }} | ||
- name: Publish Python Package | ||
env: | ||
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ needs.get-version.outputs.version_without_prefix }} | ||
run: | | ||
pip install -U pip setuptools wheel twine | ||
make install-protoc-dependencies | ||
make install-go-proto-dependencies | ||
make install-go-ci-dependencies | ||
- name: Build | ||
run: | | ||
cd sdk/python | ||
sed -i 's/DEFAULT_FEAST_USAGE_VALUE = "True"/DEFAULT_FEAST_USAGE_VALUE = "False"/g' feast/constants.py | ||
sed -i 's/NAME = "feast"/NAME = "feast-no-telemetry"/g' setup.py | ||
python3 -m pip install --user --upgrade setuptools wheel twine | ||
python3 setup.py sdist bdist_wheel | ||
python3 -m twine upload --verbose dist/*.whl | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: wheels | ||
path: sdk/python/dist/* | ||
|
||
|
||
publish-java-sdk: | ||
container: maven:3.6-jdk-11 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters