Skip to content

Commit 4ce5d47

Browse files
committed
more wheels, bump libunwind
1 parent 155d4ba commit 4ce5d47

File tree

3 files changed

+66
-61
lines changed

3 files changed

+66
-61
lines changed

.github/workflows/build.yml

Lines changed: 59 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -228,51 +228,68 @@ jobs:
228228
run: |
229229
docker buildx imagetools inspect ghcr.io/${{ github.repository }}:${{ steps.meta.outputs.version }}
230230
231-
pip-build:
232-
name: Build distribution 📦
233-
runs-on: ubuntu-latest
231+
build_wheels:
232+
name: Build wheels on ${{ matrix.os }}
233+
runs-on: ${{ matrix.os }}
234+
strategy:
235+
matrix:
236+
os: [ubuntu-latest, ubuntu-24.04-arm, macos-14]
234237

235238
steps:
236-
- uses: actions/checkout@v4
237-
with:
238-
persist-credentials: false
239-
- name: Set up Python
240-
uses: actions/setup-python@v5
241-
with:
242-
python-version: "3.10"
243-
- name: Install pypa/build
244-
run: >-
245-
python3 -m
246-
pip install
247-
build
248-
--user
249-
- name: Build a binary wheel and a source tarball
250-
run: python3 -m build
251-
- name: Store the distribution packages
252-
uses: actions/upload-artifact@v4
253-
with:
254-
name: python-package-distributions
255-
path: dist/
256-
257-
publish-to-pypi:
258-
name: >-
259-
Publish Python 🐍 distribution 📦 to PyPI
260-
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
261-
needs:
262-
- pip-build
239+
- uses: actions/checkout@v4
240+
241+
# Used to host cibuildwheel
242+
- uses: actions/setup-python@v5
243+
244+
- name: Install cibuildwheel
245+
run: python -m pip install cibuildwheel==3.0.0b1
246+
247+
- name: Install deps
248+
if: runner.os == 'Linux'
249+
run: apt install -y wget
250+
251+
- name: Build wheels
252+
run: python -m cibuildwheel --output-dir wheelhouse
253+
env:
254+
CIBW_BUILD: "cp310-*"
255+
CIBW_REPAIR_WHEEL_COMMAND_MACOS: ""
256+
257+
- uses: actions/upload-artifact@v4
258+
with:
259+
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
260+
path: ./wheelhouse/*.whl
261+
262+
build_sdist:
263+
name: Build source distribution
263264
runs-on: ubuntu-latest
264-
environment:
265-
name: pypi
266-
url: https://pypi.org/p/pyda-dbi # Replace <package-name> with your PyPI project name
267-
permissions:
268-
id-token: write # IMPORTANT: mandatory for trusted publishing
269265
steps:
270-
- name: Download all the dists
271-
uses: actions/download-artifact@v4
272-
with:
273-
name: python-package-distributions
274-
path: dist/
275-
- name: Publish distribution 📦 to PyPI
276-
uses: pypa/gh-action-pypi-publish@release/v1
266+
- uses: actions/checkout@v4
267+
268+
- name: Build sdist
269+
run: pipx run build --sdist
270+
271+
- uses: actions/upload-artifact@v4
272+
with:
273+
name: cibw-sdist
274+
path: dist/*.tar.gz
277275

276+
upload_pypi:
277+
needs: [build_wheels, build_sdist]
278+
runs-on: ubuntu-latest
279+
environment: pypi
280+
permissions:
281+
id-token: write
282+
if: github.event_name == 'release' && github.event.action == 'published'
283+
# or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this)
284+
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
285+
steps:
286+
- uses: actions/download-artifact@v4
287+
with:
288+
# unpacks all CIBW artifacts into dist/
289+
pattern: cibw-*
290+
path: dist
291+
merge-multiple: true
278292

293+
- uses: pypa/gh-action-pypi-publish@release/v1
294+
with:
295+
repository-url: https://test.pypi.org/legacy/

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[project]
2-
requires-python = "== 3.10"
2+
requires-python = ">=3.10,<3.11"
33
dynamic = ["version"]
44
name = "pyda-dbi"
55

@@ -8,6 +8,7 @@ requires = [
88
"setuptools>=64",
99
"cmake>=3.18",
1010
"setuptools-scm>=8",
11+
"wget"
1112
]
1213
build-backend = "setuptools.build_meta"
1314

setup.py

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,7 @@ def download_and_extract(url, extract_dir):
3636

3737
os.remove(filename)
3838

39-
class CustomBuildCommand(Command):
40-
description = "Build Pyda"
41-
user_options = []
42-
43-
def initialize_options(self):
44-
self.build_temp = None
45-
self.build_lib = None
46-
47-
def finalize_options(self):
48-
self.set_undefined_options('build',
49-
('build_temp', 'build_temp'),
50-
('build_lib', 'build_lib'))
51-
39+
class CustomBuildCommand(build_ext):
5240
def run(self):
5341
# Create temporary build directory
5442
build_temp_dir = tempfile.TemporaryDirectory()
@@ -68,10 +56,10 @@ def run(self):
6856
libunwind_dir = os.path.join(build_temp, 'libunwind')
6957
os.makedirs(libunwind_dir, exist_ok=True)
7058
download_and_extract(
71-
'https://github.com/libunwind/libunwind/releases/download/v1.6.2/libunwind-1.6.2.tar.gz',
59+
'https://github.com/libunwind/libunwind/releases/download/v1.8.1/libunwind-1.8.1.tar.gz',
7260
libunwind_dir
7361
)
74-
libunwind_build_dir = os.path.join(libunwind_dir, 'libunwind-1.6.2')
62+
libunwind_build_dir = os.path.join(libunwind_dir, 'libunwind-1.8.1')
7563
run_command(['./configure', f'--prefix={os.path.abspath(libunwind_install_dir)}'], cwd=libunwind_build_dir)
7664
run_command(['make', f'-j{multiprocessing.cpu_count()}'], cwd=libunwind_build_dir)
7765
run_command(['make', 'install'], cwd=libunwind_build_dir)
@@ -184,7 +172,6 @@ def run(self):
184172
# Custom install command that runs our build command first
185173
class CustomInstallCommand(install):
186174
def run(self):
187-
self.run_command('build_pyda')
188175
install.run(self)
189176
prepend_env = f"""
190177
BASE=$(python3 -c "from importlib.resources import files; print(files('pyda'))" 2>/dev/null)
@@ -232,7 +219,6 @@ def run(self):
232219
# Custom develop command that runs our build command first
233220
class CustomDevelopCommand(develop):
234221
def run(self):
235-
self.run_command('build_pyda')
236222
develop.run(self)
237223

238224
setup(
@@ -241,7 +227,7 @@ def run(self):
241227
author='Andrew Haberlandt',
242228
author_email='[email protected]',
243229
cmdclass={
244-
'build_pyda': CustomBuildCommand,
230+
'build_ext': CustomBuildCommand,
245231
'install': CustomInstallCommand,
246232
'develop': CustomDevelopCommand,
247233
},
@@ -260,5 +246,6 @@ def run(self):
260246
# Add your Python package dependencies here
261247
],
262248
scripts=[],
249+
ext_modules=[Extension("dummy", sources=[])],
263250
)
264251

0 commit comments

Comments
 (0)