Skip to content
Open
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
96 changes: 96 additions & 0 deletions .github/workflows/wheels.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Build Python distributions

on:
push:
pull_request:
schedule:
- cron: "0 6 * * *" # Daily 6AM UTC build

jobs:
build-wheels:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
fail-fast: true

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade setuptools wheel fastimport paramiko urllib3 cibuildwheel setuptools-rust
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
if: "matrix.os == 'ubuntu-latest'"
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

build-sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Install dependencies (apt)
run: |
sudo apt update
sudo apt install libapr1-dev libaprutil1-dev libdb5.3-dev liblz4-dev libsasl2-dev libperl-dev libserf-dev libsqlite3-dev libtool python-all-dev libneon27-gnutls-dev libutf8proc-dev libsvn-dev
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build sdist
run: python -m build --sdist
- name: Upload sdist
uses: actions/upload-artifact@v3
with:
path: ./dist/*.tar.gz

test-sdist:
needs:
- build-sdist
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v5
- name: Install dependencies (apt)
run: |
sudo apt update
sudo apt install libapr1-dev libaprutil1-dev libdb5.3-dev liblz4-dev libsasl2-dev libperl-dev libserf-dev libsqlite3-dev libtool python-all-dev libneon27-gnutls-dev libutf8proc-dev libsvn-dev
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install twine
- name: Download sdist
uses: actions/download-artifact@v2
with:
name: artifact
path: dist
- name: Test sdist
run: twine check dist/*
- name: Test installation from sdist
run: pip install dist/*.tar.gz

publish:
runs-on: ubuntu-latest
needs:
- build-wheels
- build-sdist
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/subvertpy-')
permissions:
id-token: write
environment:
name: pypi
url: https://pypi.org/p/subvertpy
steps:
- name: Download distributions
uses: actions/download-artifact@v2
with:
name: artifact
path: dist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ include README.md
include Makefile
include subvertpy.cfg
include man/*.1
recursive-include subr Cargo.toml *.rs
include Cargo.lock Cargo.toml
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools>=61.2", "setuptools_rust"]
requires = ["setuptools", "setuptools_rust"]
build-backend = "setuptools.build_meta"

[project.optional-dependencies]
Expand All @@ -9,6 +9,9 @@ dev = ["ruff==0.4.3"]
environment = {PATH="$HOME/.cargo/bin:$PATH"}
before-build = "pip install -U setuptools-rust && curl https://sh.rustup.rs -sSf | sh -s -- --profile=minimal -y && rustup show"

[tool.cibuildwheel.linux]
before-build = "pip install -U setuptools-rust && curl https://sh.rustup.rs -sSf | sh -s -- --profile=minimal -y && yum install -y apr-devel apr-util-devel lz4-devel sqlite-devel zlib-devel cyrus-sasl-devel neon-devel utf8proc-devel subversion-devel clang clang-devel"

[tool.ruff.lint]
select = [
"ANN",
Expand Down Expand Up @@ -76,6 +79,7 @@ classifiers = [
]
urls = {Homepage = "https://github.com/jelmer/subvertpy"}
dynamic = ["version"]
requires-python = ">=3.8"

[tool.setuptools]
include-package-data = false
Expand Down