Skip to content

Commit

Permalink
chore: unify build system into pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
jansegre committed Feb 26, 2025
1 parent f177510 commit 1588725
Show file tree
Hide file tree
Showing 12 changed files with 379 additions and 365 deletions.
104 changes: 0 additions & 104 deletions .github/workflows/build.yml

This file was deleted.

43 changes: 0 additions & 43 deletions .github/workflows/debian.yml

This file was deleted.

97 changes: 52 additions & 45 deletions .github/workflows/dist.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,72 @@
# vim:ts=2:sw=2:et:ai:sts=2
name: 'Build distribution'
# yamllint disable rule:line-length
name: Build distribution

on:
# Only run when pushing to main/merging PRs.
on: # yamllint disable-line rule:truthy
workflow_dispatch:
push:
branches:
- master
- main
- dev
- release*
tags:
- v*

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build_wheels:
sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: astral-sh/setup-uv@v5

- name: Build sdist
run: |
uv build --sdist
- uses: actions/upload-artifact@v4
name: Upload build artifacts
with:
name: sdist
path: 'dist/*.tar.gz'

manylinux:
needs: [sdist]
name: 'Build wheels'
runs-on: ${{ matrix.os }}
env:
LIBROCKSDB_PATH: /opt/rocksdb-${{ matrix.rocksdb_ver }}
strategy:
matrix:
os: [ubuntu-latest]
rocksdb_ver: ['v6.14.6']
rocksdb_ver: ['8.11.fb']

steps:
- uses: actions/checkout@v2
name: 'Checkout source repository'
- uses: actions/checkout@v4
name: Checkout source repository

- uses: actions/setup-python@v2
name: 'Set up Python 3.9'
- uses: actions/setup-python@v5
name: Set up Python 3.12
with:
python-version: '3.9'
python-version: 3.12

- name: 'Install cibuildwheel'
- name: Install cibuildwheel
run: |
python3 -m pip install cibuildwheel==1.7.1
- name: 'Build wheels'
- name: Build wheels
run: |
python3 -m cibuildwheel --output-dir dist
env:
CIBW_MANYLINUX_X86_64_IMAGE: 'manylinux2014'
CIBW_BUILD: 'cp3*'
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_BUILD: 'cp31*'
CIBW_SKIP: '*-manylinux_i686'
# Install python package and test-deps.
CIBW_TEST_REQUIRES: '.[test] pytest'
Expand All @@ -49,8 +79,7 @@ jobs:
# Avoid re-building the C library in every iteration by testing for
# the build directory.
CIBW_BEFORE_BUILD: >
yum install -y python3-pkgconfig bzip2-devel lz4-devel snappy-devel zlib-devel
python3-Cython &&
yum install -y snappy snappy-devel zlib zlib-devel bzip2 bzip2-devel lz4-devel libzstd-devel &&
test -d ${{ env.LIBROCKSDB_PATH }} || (
git clone https://github.com/facebook/rocksdb --depth 1
--branch ${{ matrix.rocksdb_ver }} ${{ env.LIBROCKSDB_PATH }} &&
Expand All @@ -62,40 +91,18 @@ jobs:
ldconfig &&
popd
- uses: actions/upload-artifact@v2
name: 'Upload build artifacts'
- uses: actions/upload-artifact@v4
name: Upload build artifacts
with:
path: 'dist/*.whl'

build_sdist:
name: 'Build source distribution'
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v2
name: 'Checkout source repository'

- uses: actions/setup-python@v2
name: 'Set up Python 3.9'
with:
python-version: '3.9'

- name: 'Build sdist'
run: |
python3 setup.py sdist
- uses: actions/upload-artifact@v2
name: 'Upload build artifacts'
with:
path: 'dist/*.tar.gz'


# upload_pypi:
# name: 'Upload packages'
# needs: ['build_wheels', 'build_sdist']
# publish:
# name: Upload packages
# needs: [manylinux, sdist]
# runs-on: 'ubuntu-latest'
# if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
# steps:
# - uses: actions/download-artifact@v2
# - uses: actions/download-artifact@v4
# name: 'Download artifacts'
# with:
# name: 'artifact'
Expand Down
Loading

0 comments on commit 1588725

Please sign in to comment.