From 250d97ec40c4bc9837db71987fd53f783eb72335 Mon Sep 17 00:00:00 2001 From: Maximilian Roos Date: Tue, 24 Jan 2023 00:15:18 -0800 Subject: [PATCH 1/4] build: Add wheel `task`, use in CI --- .github/workflows/test-python.yaml | 5 ++++- Taskfile.yml | 11 +++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-python.yaml b/.github/workflows/test-python.yaml index fd00d6c82242..f7c91abe11ad 100644 --- a/.github/workflows/test-python.yaml +++ b/.github/workflows/test-python.yaml @@ -19,8 +19,11 @@ jobs: steps: - name: 📂 Checkout code uses: actions/checkout@v3 + - uses: arduino/setup-task@v1 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" - name: Build wheel - uses: ./.github/actions/build-prql-python + run: task build-python-wheel - uses: actions/setup-python@v4 with: python-version: "3.7" diff --git a/Taskfile.yml b/Taskfile.yml index 29e085964af0..465ffd4f09d1 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -162,6 +162,17 @@ tasks: {{ end -}} - task: build-web + build-python-wheel: + dir: prql-python + cmds: + - cmd: maturin build --release + platforms: [windows, linux] + # I _think_ both of these are needed (at least the x86 seems to be needed on an ARM machine) + - cmd: rustup target add x86_64-apple-darwin aarch64-apple-darwin + platforms: [darwin] + - cmd: maturin build --release --universal2 + platforms: [darwin] + test-all: desc: Test everything, accepting snapshots. summary: | From 3458f5ac774ed11278167b95c0ded536ecd0c37f Mon Sep 17 00:00:00 2001 From: Maximilian Roos Date: Tue, 24 Jan 2023 00:18:30 -0800 Subject: [PATCH 2/4] --- Taskfile.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Taskfile.yml b/Taskfile.yml index 465ffd4f09d1..cd6748084e10 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -165,12 +165,12 @@ tasks: build-python-wheel: dir: prql-python cmds: - - cmd: maturin build --release + - cmd: maturin build --release ../dist platforms: [windows, linux] # I _think_ both of these are needed (at least the x86 seems to be needed on an ARM machine) - cmd: rustup target add x86_64-apple-darwin aarch64-apple-darwin platforms: [darwin] - - cmd: maturin build --release --universal2 + - cmd: maturin build --release --universal2 -o ../dist platforms: [darwin] test-all: From 1bcb5bb180f7f1207affe6ee8f5fd0ab374c3d21 Mon Sep 17 00:00:00 2001 From: Maximilian Roos Date: Tue, 24 Jan 2023 00:36:38 -0800 Subject: [PATCH 3/4] --- .github/workflows/test-python.yaml | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test-python.yaml b/.github/workflows/test-python.yaml index f7c91abe11ad..d14f8201a377 100644 --- a/.github/workflows/test-python.yaml +++ b/.github/workflows/test-python.yaml @@ -36,16 +36,17 @@ jobs: - uses: actions/setup-python@v4 with: python-version: "3.10" - - name: Install nox - run: pipx install nox - shell: bash - - name: Cache Nox - uses: actions/cache@v3 - with: - path: .nox - key: - nox-${{ hashFiles('prql-python/noxfile.py') }}-${{ - hashFiles('prql-python/requirements.txt') }} - - name: Run tests - shell: bash - run: nox -s tests -f prql-python/noxfile.py + - run: cd pip install . && pip install pytest && pytest . + # - name: Install nox + # run: pipx install nox + # shell: bash + # - name: Cache Nox + # uses: actions/cache@v3 + # with: + # path: .nox + # key: + # nox-${{ hashFiles('prql-python/noxfile.py') }}-${{ + # hashFiles('prql-python/requirements.txt') }} + # - name: Run tests + # shell: bash + # run: nox -s tests -f prql-python/noxfile.py From 0bafff9fb304bdde8d7023ccbe296a4aec9fed27 Mon Sep 17 00:00:00 2001 From: Maximilian Roos Date: Tue, 24 Jan 2023 03:08:16 -0800 Subject: [PATCH 4/4] --- .github/workflows/test-python.yaml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test-python.yaml b/.github/workflows/test-python.yaml index d14f8201a377..17e7d9b36eeb 100644 --- a/.github/workflows/test-python.yaml +++ b/.github/workflows/test-python.yaml @@ -22,20 +22,21 @@ jobs: - uses: arduino/setup-task@v1 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" - - name: Build wheel - run: task build-python-wheel - - uses: actions/setup-python@v4 - with: - python-version: "3.7" - uses: actions/setup-python@v4 with: python-version: "3.8" - - uses: actions/setup-python@v4 - with: - python-version: "3.9" - - uses: actions/setup-python@v4 - with: - python-version: "3.10" + - run: pip install maturin + - name: Build wheel + run: task build-python-wheel + # - uses: actions/setup-python@v4 + # with: + # python-version: "3.7" + # - uses: actions/setup-python@v4 + # with: + # python-version: "3.9" + # - uses: actions/setup-python@v4 + # with: + # python-version: "3.10" - run: cd pip install . && pip install pytest && pytest . # - name: Install nox # run: pipx install nox