Skip to content

Commit

Permalink
Migrate CI to cibuildwheel, bump minimum Python
Browse files Browse the repository at this point in the history
  • Loading branch information
mark9064 committed Oct 11, 2023
1 parent b109c5f commit f92b708
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 82 deletions.
42 changes: 8 additions & 34 deletions .github/workflows/python-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
Expand All @@ -22,44 +22,18 @@ jobs:
run: |
python setup.py sdist
build-manylinux:
build-wheels:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
pip install -r dev-requirements.txt
- name: Build manylinux Python wheels
uses: RalfG/[email protected]_x86_64
with:
python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311'
system-packages: 'libdrm-devel'
build-requirements: 'cython'

build-musllinux:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
pip install -r dev-requirements.txt
- name: Build musllinux Python wheels
uses: RalfG/[email protected]_1_1_x86_64
with:
python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311'
pre-build-command: 'apk add libdrm-dev'
build-requirements: 'cython'
pip install cibuildwheel==2.16.2
- name: Build Python wheels
run: python -m cibuildwheel --output-dir wheelhouse
57 changes: 11 additions & 46 deletions .github/workflows/python-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
Expand All @@ -27,70 +27,35 @@ jobs:
mkdir output
cp dist/*.tar.gz output
- name: Publish
uses: pypa/[email protected].6
uses: pypa/[email protected].10
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages-dir: output/

deploy-manylinux:
deploy-wheels:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install -r dev-requirements.txt
- name: Build manylinux Python wheels
uses: RalfG/[email protected]_x86_64
with:
python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311'
system-packages: 'libdrm-devel'
build-requirements: 'cython'
pip install cibuildwheel==2.16.2
- name: Build Python wheels
run: python -m cibuildwheel --output-dir wheelhouse
- name: Copy files
run: |
mkdir output
cp dist/*-manylinux*.whl output
cp wheelhouse/*.whl output
- name: Publish
uses: pypa/[email protected].6
uses: pypa/[email protected].10
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages-dir: output/

deploy-musllinux:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install -r dev-requirements.txt
- name: Build musllinux Python wheels
uses: RalfG/[email protected]_1_1_x86_64
with:
python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311'
pre-build-command: 'apk add libdrm-dev'
build-requirements: 'cython'
- name: Copy files
run: |
mkdir output
cp dist/*-musllinux*.whl output
- name: Publish
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages-dir: output/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Only Linux is supported, using the AMDGPU driver.

The library is written using Cython, meaning that Cython and and a C compiler are needed to build and install from source. Additionally, libdrm development headers are required.

Precompiled wheels for Python 3.7-3.11 are the default method of install. This means that you don't need Cython or any other dependencies to install it normally.
Precompiled wheels for Python 3.8-3.12 are the default method of install. This means that you don't need Cython or any other dependencies to install it normally.

## Usage

Expand Down
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[build-system]
requires = ["setuptools", "wheel", "cython>=3"]
build-backend = "setuptools.build_meta"

[tool.cibuildwheel.linux]
archs = ["x86_64"]
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
long_description_content_type="text/markdown",
url="https://github.com/mark9064/pyamdgpuinfo",
packages=setuptools.find_packages(),
python_requires=">=3.7",
python_requires=">=3.8",
ext_modules=cythonize(EXTENSIONS, language_level="3str"),
zip_safe=False,
classifiers=[
Expand Down

0 comments on commit f92b708

Please sign in to comment.