Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1806 #1808

Merged
merged 26 commits into from
Jul 20, 2024
Merged

#1806 #1808

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
193 changes: 24 additions & 169 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,167 +8,37 @@ on:

jobs:

build-linux-not-manylinux:
manylinux-build:
strategy:
fail-fast: false
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
runs-on: ubuntu-latest
steps:

- name: Checkout code
- name: Check out repository
uses: actions/[email protected]

- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Set up Python ${{ matrix.python-version }} x64
uses: actions/setup-python@v5
path: io

- name: Set permissions for build-wheels.sh
run: chmod +x io/build-wheels.sh

- name: Build Wheels
run: >-
docker run --rm
-e PLAT=manylinux2014_x86_64
-e PACKAGE_NAME=opteryx
-e PYTHON_VERSION=${{ matrix.python-version }}
-v `pwd`:/io
--workdir /io
quay.io/pypa/manylinux2014_x86_64
io/build-wheels.sh

- name: Archive Wheels
uses: actions/upload-artifact@v2
with:
python-version: ${{ matrix.python-version }}
architecture: x64

- name: Install Requirements
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade numpy cython wheel numpy setuptools_rust auditwheel
python -m pip install --upgrade -r $GITHUB_WORKSPACE/requirements.txt
python -m pip install --upgrade -r $GITHUB_WORKSPACE/tests/requirements.txt

- name: Build binary wheel
run: python setup.py bdist_wheel

- name: Archive dist artifacts
uses: actions/upload-artifact@v1
with:
name: dist-linux-${{ matrix.python-version }}
path: dist

build-linux-cp39:
runs-on: ubuntu-latest
container: quay.io/pypa/manylinux2014_x86_64@sha256:7faa424c478d774a3ac17baacb5fa6b59e7c75dae47a6cb84f23df757d83469e

steps:
- uses: actions/checkout@v4

- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Install Python package dependencies
run: /opt/python/cp39-cp39/bin/python -m pip install --upgrade cython wheel numpy setuptools_rust

- name: Build binary wheel
run: /opt/python/cp39-cp39/bin/python setup.py bdist_wheel

- name: Apply auditwheel for manylinux wheel
run: auditwheel repair -w dist dist/*

- name: Remove linux wheel
run: rm dist/*-linux_x86_64.whl

- name: Archive dist artifacts
uses: actions/upload-artifact@v1
with:
name: dist-mlinux-3.9
path: dist

build-linux-cp310:
runs-on: ubuntu-latest
container: quay.io/pypa/manylinux2014_x86_64@sha256:7faa424c478d774a3ac17baacb5fa6b59e7c75dae47a6cb84f23df757d83469e

steps:
- uses: actions/checkout@v4

- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Install Python package dependencies
run: /opt/python/cp310-cp310/bin/python -m pip install --upgrade cython wheel numpy setuptools_rust

- name: Build binary wheel
run: /opt/python/cp310-cp310/bin/python setup.py bdist_wheel

- name: Apply auditwheel for manylinux wheel
run: auditwheel repair -w dist dist/*

- name: Remove linux wheel
run: rm dist/*-linux_x86_64.whl

- name: Archive dist artifacts
uses: actions/upload-artifact@v1
with:
name: dist-mlinux-3.10
path: dist

build-linux-cp311:
runs-on: ubuntu-latest
container: quay.io/pypa/manylinux2014_x86_64@sha256:7faa424c478d774a3ac17baacb5fa6b59e7c75dae47a6cb84f23df757d83469e

steps:
- uses: actions/checkout@v4

- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Install Python package dependencies
run: /opt/python/cp311-cp311/bin/python -m pip install --upgrade cython wheel numpy setuptools_rust

- name: Build binary wheel
run: /opt/python/cp311-cp311/bin/python setup.py bdist_wheel

- name: Apply auditwheel for manylinux wheel
run: auditwheel repair -w dist dist/*

- name: Remove linux wheel
run: rm dist/*-linux_x86_64.whl

- name: Archive dist artifacts
uses: actions/upload-artifact@v1
with:
name: dist-mlinux-3.11
path: dist

build-linux-cp312:
runs-on: ubuntu-latest
container: quay.io/pypa/manylinux2014_x86_64@sha256:7faa424c478d774a3ac17baacb5fa6b59e7c75dae47a6cb84f23df757d83469e

steps:
- uses: actions/checkout@v4

- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Install Python package dependencies
run: /opt/python/cp312-cp312/bin/python -m pip install --upgrade cython wheel numpy setuptools_rust

- name: Build binary wheel
run: /opt/python/cp312-cp312/bin/python setup.py bdist_wheel

- name: Apply auditwheel for manylinux wheel
run: auditwheel repair -w dist dist/*

- name: Remove linux wheel
run: rm dist/*-linux_x86_64.whl

- name: Archive dist artifacts
uses: actions/upload-artifact@v1
with:
name: dist-mlinux-3.12
path: dist
name: wheels
path: io/dist/*manylinux2014_x86_64.whl

build-macos:
runs-on: macos-latest
Expand Down Expand Up @@ -251,24 +121,9 @@ jobs:
path: dist

upload:
# build-linux-cp39, build-linux-cp310, build-linux-cp311, build-linux-cp312
needs: [build-linux-not-manylinux, build-macos, build-windows]
needs: [manylinux-build, build-macos, build-windows]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade cython wheel numpy setuptools_rust
python -m pip install --upgrade -r requirements.txt

- name: Create source dist
run: python setup.py sdist

Expand Down
22 changes: 22 additions & 0 deletions build-wheels.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
set -ex

curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable -y
export PATH="$HOME/.cargo/bin:$PATH"

cd $GITHUB_WORKSPACE/io
cd io

# Only build for the specified Python version
PYBIN="/opt/python/cp${PYTHON_VERSION//.}-cp${PYTHON_VERSION//.}/bin"

# Install necessary packages
"${PYBIN}/python" -m pip install -U setuptools wheel setuptools-rust numpy==1.* cython

# Build the wheel
"${PYBIN}/python" setup.py bdist_wheel

# Repair the wheel using auditwheel
for whl in dist/*.whl; do
auditwheel repair "$whl" -w dist/
done
2 changes: 1 addition & 1 deletion opteryx/__version__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__build__ = 650
__build__ = 663

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 2 additions & 0 deletions tests/sql_battery/test_shapes_and_errors_battery.py
Original file line number Diff line number Diff line change
Expand Up @@ -1364,6 +1364,8 @@
("SELECT group, nn FROM (SELECT group, ARRAY_AGG(name) as n FROM $astronauts GROUP BY group) AS alma CROSS JOIN UNNEST(n) AS nn", 357, 2, None),
("SELECT * FROM (SELECT ARRAY_AGG(CASE WHEN LENGTH(alma_mater) > 10 THEN alma_mater ELSE NULL END) as alma_mater_arr FROM $astronauts GROUP BY group) AS alma CROSS JOIN UNNEST(alma_mater_arr) AS alma", 357, 2, None),
("SELECT * FROM (SELECT ARRAY_AGG(1) as num_arr FROM $astronauts GROUP BY group) AS numbers CROSS JOIN UNNEST(num_arr) AS number", 357, 2, None),
("SELECT * FROM $astronauts INNER JOIN UNNEST(alma_mater) AS n ON name = n", 0, 20, None),
("SELECT * FROM $astronauts INNER JOIN UNNEST(alma_mater) AS n ON name = n WHERE group = 10", 0, 20, None),

# PUSHDOWN (the result should be the same without pushdown)
("SELECT p.name, s.name FROM $planets p, $satellites s WHERE p.id = s.planetId AND p.mass > 1000 AND s.gm < 500;", 63, 2, None),
Expand Down
Loading