-
Notifications
You must be signed in to change notification settings - Fork 70
95 lines (85 loc) · 2.99 KB
/
packaging_sdist.yml
File metadata and controls
95 lines (85 loc) · 2.99 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
name: Sdist packaging
on:
workflow_call:
inputs:
testsuite:
type: string
description: Testsuite to run (none, fast, all)
required: true
default: all
duckdb-python-sha:
type: string
description: The commit or ref to build against (defaults to current ref)
required: false
duckdb-sha:
type: string
description: Override the DuckDB submodule commit or ref to build against
required: false
set-version:
description: Force version (vX.Y.Z-((rc|post)N))
required: false
type: string
outputs:
package-version:
description: The version of the DuckDB Python package
value: ${{ jobs.build_sdist.outputs.pkg_version }}
duckdb-version:
description: The version of DuckDB that was packaged
value: ${{ jobs.build_sdist.outputs.duckdb_version }}
jobs:
build_sdist:
name: Build sdist
runs-on: ubuntu-24.04
outputs:
pkg_version: ${{ steps.versioning.outputs.pkg_version }}
duckdb_version: ${{ steps.versioning.outputs.duckdb_version }}
steps:
- name: Checkout DuckDB Python
uses: actions/checkout@v4
with:
ref: ${{ inputs.duckdb-python-sha }}
fetch-depth: 0
submodules: true
- name: Checkout DuckDB
shell: bash
if: ${{ inputs.duckdb-sha }}
run: |
cd external/duckdb
git fetch origin
git checkout ${{ inputs.duckdb-sha }}
- name: Set OVERRIDE_GIT_DESCRIBE
if: ${{ inputs.set-version != '' }}
run: echo "OVERRIDE_GIT_DESCRIBE=${{ inputs.set-version }}" >> $GITHUB_ENV
- name: Install Astral UV
uses: astral-sh/setup-uv@v7
with:
version: "0.9.0"
python-version: 3.12
- name: Build sdist
run: uv build --sdist
- name: Install sdist
run: |
cd ${{ runner.temp }}
uv venv
uv pip install ${{ github.workspace }}/dist/duckdb-*.tar.gz
- name: Test sdist
if: ${{ inputs.testsuite != 'none' }}
run: |
# install the test requirements
uv export --only-group test --no-emit-project --output-file ${{ runner.temp }}/pylock.toml --quiet
cd ${{ runner.temp }}
uv pip install -r pylock.toml
# run tests
tests_root="${{ github.workspace }}/tests"
tests_dir="${tests_root}${{ inputs.testsuite == 'fast' && '/fast' || '/' }}"
uv run --verbose pytest -c ${{ github.workspace }}/pyproject.toml $tests_dir
- id: versioning
run: |
cd ${{ runner.temp }}
echo "pkg_version=$( .venv/bin/python -c 'import duckdb; print(duckdb.__version__)' )" >> $GITHUB_OUTPUT
echo "duckdb_version=$( .venv/bin/python -c 'import duckdb; print(duckdb.duckdb_version)' )" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
compression-level: 0