Skip to content
Merged
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
46 changes: 34 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,39 @@
# Build from source.
name: build
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
push:
permissions: read-all
permissions:
contents: read
jobs:
build_macos:
runs-on: macos-latest
timeout-minutes: 15
strategy:
matrix:
include:
- python-version: '3.14'
toxenv: 'py314'
- python-version: '3.14t'
toxenv: 'py314t'
- python-version: '3.15'
toxenv: 'py315'
- python-version: '3.15t'
toxenv: 'py315t'
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install build dependencies
run: |
brew update -q
brew install -q autoconf automake gettext gnu-sed libtool pkgconfig tox || true
# There currently is no brew formula for free-threaded Python, but setup-python will install it if necessary.
# shellcheck disable=SC2193
if [[ "${{ matrix.python-version }}" != *t ]]; then
brew install -q python@${{ matrix.python-version }}
fi
Expand All @@ -35,6 +45,7 @@ jobs:
tox -e ${{ matrix.toxenv }}
build_ubuntu:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
Expand All @@ -51,12 +62,19 @@ jobs:
toxenv: 'py314'
- python-version: '3.14t'
toxenv: 'py314t'
- python-version: '3.15'
toxenv: 'py315'
- python-version: '3.15t'
toxenv: 'py315t'
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install build dependencies
run: |
sudo apt-get update
Expand All @@ -70,15 +88,19 @@ jobs:
tox -e ${{ matrix.toxenv }}
build_windows:
runs-on: windows-latest
timeout-minutes: 15
strategy:
matrix:
python-version: ['3.14', '3.14t']
python-version: ['3.15', '3.15t']
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install build dependencies
run: |
python3 -m pip install build setuptools wheel
Expand Down
17 changes: 12 additions & 5 deletions .github/workflows/build_package.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# Build packages from source.
name: build_package
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
push:
permissions: read-all
permissions:
contents: read
jobs:
build_dpkg:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
matrix:
version: ['26.04']
Expand All @@ -25,17 +30,19 @@ jobs:
run: |
apt update -q
apt install -y autoconf automake autopoint autotools-dev build-essential debhelper dh-autoreconf dh-python fakeroot git libtool pkg-config python3 python3-build python3-dev python3-setuptools python3-venv pybuild-plugin-pyproject
- uses: actions/checkout@v6
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Build from source
run: |
git config --global --add safe.directory '*'
python3 utils/update_source.py
python3 -m build --sdist
- name: Build dpkg
run: |
PACKAGE=`ls -1 dist/*.tar.gz | head -n1`
PACKAGE=`basename "${PACKAGE}"`
PACKAGE_ORIG=`echo "${PACKAGE%.tar.gz}.orig.tar.gz" | tr '-' '_'`
PACKAGE=$(find dist -maxdepth 1 -name "*.tar.gz" | head -n 1)
PACKAGE=$(basename "${PACKAGE}")
PACKAGE_ORIG=$(echo "${PACKAGE%.tar.gz}.orig.tar.gz" | tr '-' '_')
mv "dist/${PACKAGE}" "../${PACKAGE_ORIG}"
cp -rf dpkg debian
dpkg-buildpackage -rfakeroot
55 changes: 38 additions & 17 deletions .github/workflows/build_wheel.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Build Python wheels from source using cibuildwheel.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
name: build_wheels
on:
pull_request:
Expand All @@ -7,13 +10,17 @@ on:
types: [published]
# Allow trigger via API
workflow_dispatch:
permissions: read-all
permissions:
contents: read
jobs:
build_sdist:
name: Build sdist
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install build dependencies
run: |
sudo apt-get update
Expand All @@ -22,50 +29,58 @@ jobs:
run: |
python utils/update_source.py
python -m build --sdist
- uses: actions/upload-artifact@v7
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: cibw-sdist
path: dist/*.tar.gz
retention-days: 14
build_wheels_linux:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
matrix:
include:
- os: ubuntu-24.04
- os: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install build dependencies
run: |
sudo apt-get -y install autoconf automake autopoint autotools-dev build-essential git libtool pkg-config
- name: Prepare build
run: |
python utils/update_source.py
- name: Build Python wheels
uses: pypa/cibuildwheel@v4.0.0
uses: pypa/cibuildwheel@f9b966cfadf4109556cadc5bb39ddb72d0ce664e # v4.3.5
env:
CIBW_BEFORE_BUILD_LINUX: python utils/update_source.py
CIBW_ENABLE: ${{ github.event_name == 'release' && github.event.action == 'published' && '' || 'cpython-prerelease' }}
CIBW_ENABLE: ${{ !(github.event_name == 'release' && github.event.action == 'published') && 'cpython-prerelease' || '' }}
CIBW_TEST_COMMAND: python run_tests.py
CIBW_TEST_SOURCES: run_tests.py test_data tests
with:
package-dir: .
output-dir: dist
- uses: actions/upload-artifact@v7
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: dist/*.whl
retention-days: 14
build_wheels_macos:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
matrix:
include:
- os: macos-26
- os: macos-26-intel
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install build dependencies
run: |
brew update -q
Expand All @@ -75,55 +90,61 @@ jobs:
run: |
python utils/update_source.py
- name: Build Python wheels
uses: pypa/cibuildwheel@v4.0.0
uses: pypa/cibuildwheel@f9b966cfadf4109556cadc5bb39ddb72d0ce664e # v4.3.5
env:
CIBW_ENABLE: ${{ github.event_name == 'release' && github.event.action == 'published' && '' || 'cpython-prerelease' }}
CIBW_ENABLE: ${{ !(github.event_name == 'release' && github.event.action == 'published') && 'cpython-prerelease' || '' }}
CIBW_TEST_COMMAND: python run_tests.py
CIBW_TEST_SOURCES: run_tests.py test_data tests
with:
package-dir: .
output-dir: dist
- uses: actions/upload-artifact@v7
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: dist/*.whl
retention-days: 14
build_wheels_windows:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
matrix:
include:
- os: windows-11-arm
- os: windows-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Prepare build
run: |
python utils/update_source.py
- name: Build Python wheels
uses: pypa/cibuildwheel@v4.0.0
uses: pypa/cibuildwheel@f9b966cfadf4109556cadc5bb39ddb72d0ce664e # v4.3.5
env:
CIBW_ENABLE: ${{ github.event_name == 'release' && github.event.action == 'published' && '' || 'cpython-prerelease' }}
CIBW_ENABLE: ${{ !(github.event_name == 'release' && github.event.action == 'published') && 'cpython-prerelease' || '' }}
CIBW_TEST_COMMAND: python run_tests.py
CIBW_TEST_SOURCES: run_tests.py test_data tests
with:
package-dir: .
output-dir: dist
- uses: actions/upload-artifact@v7
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: dist/*.whl
retention-days: 14
upload_pypi:
needs: [build_sdist, build_wheels_linux, build_wheels_macos, build_wheels_windows]
runs-on: ubuntu-latest
timeout-minutes: 60
environment: pypi
permissions:
id-token: write
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v8
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
pattern: cibw-*
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
- uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
25 changes: 19 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,38 @@
# Check source.
name: lint
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
push:
permissions: read-all
permissions:
contents: read
jobs:
black:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Check format of Python code
uses: psf/black@stable
uses: psf/black@258e7dbf348bc23cb70b8cdf693481c04634ebcc # v26.10.1
with:
options: "--check"
src: "."
pylint:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: '3.14'
cache: 'pip'
- name: Install tox
run: |
python -m pip install tox
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py3{10,11,12,13,14,14t},black,pylint
envlist = py3{10,11,12,13,14,14t,15,15t},black,pylint

[testenv]
pip_pre = True
Expand Down
Loading