Skip to content

Commit f92701a

Browse files
committed
chore: unify build system into pyproject.toml
1 parent f177510 commit f92701a

12 files changed

Lines changed: 381 additions & 365 deletions

File tree

.github/workflows/build.yml

Lines changed: 0 additions & 104 deletions
This file was deleted.

.github/workflows/debian.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

.github/workflows/dist.yml

Lines changed: 52 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,72 @@
1-
# vim:ts=2:sw=2:et:ai:sts=2
2-
name: 'Build distribution'
1+
# yamllint disable rule:line-length
2+
name: Build distribution
33

4-
on:
5-
# Only run when pushing to main/merging PRs.
4+
on: # yamllint disable-line rule:truthy
5+
workflow_dispatch:
66
push:
77
branches:
8+
- master
89
- main
10+
- dev
11+
- release*
12+
tags:
13+
- v*
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
918

1019
jobs:
11-
build_wheels:
20+
sdist:
21+
name: Build source distribution
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
- uses: actions/setup-python@v5
26+
with:
27+
python-version: "3.12"
28+
- uses: astral-sh/setup-uv@v5
29+
30+
- name: Build sdist
31+
run: |
32+
uv build --sdist
33+
34+
- uses: actions/upload-artifact@v4
35+
name: Upload build artifacts
36+
with:
37+
name: sdist
38+
path: 'dist/*.tar.gz'
39+
40+
manylinux:
41+
needs: [sdist]
1242
name: 'Build wheels'
1343
runs-on: ${{ matrix.os }}
1444
env:
1545
LIBROCKSDB_PATH: /opt/rocksdb-${{ matrix.rocksdb_ver }}
1646
strategy:
1747
matrix:
1848
os: [ubuntu-latest]
19-
rocksdb_ver: ['v6.14.6']
49+
rocksdb_ver: ['8.11.fb']
2050

2151
steps:
22-
- uses: actions/checkout@v2
23-
name: 'Checkout source repository'
52+
- uses: actions/checkout@v4
53+
name: Checkout source repository
2454

25-
- uses: actions/setup-python@v2
26-
name: 'Set up Python 3.9'
55+
- uses: actions/setup-python@v5
56+
name: Set up Python 3.12
2757
with:
28-
python-version: '3.9'
58+
python-version: 3.12
2959

30-
- name: 'Install cibuildwheel'
60+
- name: Install cibuildwheel
3161
run: |
3262
python3 -m pip install cibuildwheel==1.7.1
3363
34-
- name: 'Build wheels'
64+
- name: Build wheels
3565
run: |
3666
python3 -m cibuildwheel --output-dir dist
3767
env:
38-
CIBW_MANYLINUX_X86_64_IMAGE: 'manylinux2014'
39-
CIBW_BUILD: 'cp3*'
68+
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
69+
CIBW_BUILD: 'cp31*'
4070
CIBW_SKIP: '*-manylinux_i686'
4171
# Install python package and test-deps.
4272
CIBW_TEST_REQUIRES: '.[test] pytest'
@@ -49,8 +79,7 @@ jobs:
4979
# Avoid re-building the C library in every iteration by testing for
5080
# the build directory.
5181
CIBW_BEFORE_BUILD: >
52-
yum install -y python3-pkgconfig bzip2-devel lz4-devel snappy-devel zlib-devel
53-
python3-Cython &&
82+
yum install -y snappy snappy-devel zlib zlib-devel bzip2 bzip2-devel lz4-devel libzstd-devel &&
5483
test -d ${{ env.LIBROCKSDB_PATH }} || (
5584
git clone https://github.com/facebook/rocksdb --depth 1
5685
--branch ${{ matrix.rocksdb_ver }} ${{ env.LIBROCKSDB_PATH }} &&
@@ -62,40 +91,18 @@ jobs:
6291
ldconfig &&
6392
popd
6493
65-
- uses: actions/upload-artifact@v2
66-
name: 'Upload build artifacts'
94+
- uses: actions/upload-artifact@v4
95+
name: Upload build artifacts
6796
with:
6897
path: 'dist/*.whl'
6998

70-
build_sdist:
71-
name: 'Build source distribution'
72-
runs-on: 'ubuntu-latest'
73-
steps:
74-
- uses: actions/checkout@v2
75-
name: 'Checkout source repository'
76-
77-
- uses: actions/setup-python@v2
78-
name: 'Set up Python 3.9'
79-
with:
80-
python-version: '3.9'
81-
82-
- name: 'Build sdist'
83-
run: |
84-
python3 setup.py sdist
85-
86-
- uses: actions/upload-artifact@v2
87-
name: 'Upload build artifacts'
88-
with:
89-
path: 'dist/*.tar.gz'
90-
91-
92-
# upload_pypi:
93-
# name: 'Upload packages'
94-
# needs: ['build_wheels', 'build_sdist']
99+
# publish:
100+
# name: Upload packages
101+
# needs: [manylinux, sdist]
95102
# runs-on: 'ubuntu-latest'
96103
# if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
97104
# steps:
98-
# - uses: actions/download-artifact@v2
105+
# - uses: actions/download-artifact@v4
99106
# name: 'Download artifacts'
100107
# with:
101108
# name: 'artifact'

0 commit comments

Comments
 (0)