Skip to content

Commit

Permalink
Add wheels for Python 3.12 (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
scaramallion authored Jan 18, 2024
1 parent 24f8ed2 commit 727e56d
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 31 deletions.
100 changes: 74 additions & 26 deletions .github/workflows/release-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,35 @@ name: release-deploy
on:
release:
types: [ published ]
# push:
# branches: [ main ]
# pull_request:

jobs:
build-sdist:
name: Build source distribution
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.10'

- name: Build sdist
run: |
python -m pip install -U pip
python -m pip install numpy cython
python setup.py sdist
python -m pip install build
python -m build --sdist
- name: Store artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wheels
name: sdist
path: ./dist

build-wheels:
Expand All @@ -39,9 +42,6 @@ jobs:
matrix:
include:
# Windows 64 bit
- os: windows-latest
python: 37
platform_id: win_amd64
- os: windows-latest
python: 38
platform_id: win_amd64
Expand All @@ -54,12 +54,11 @@ jobs:
- os: windows-latest
python: 311
platform_id: win_amd64
- os: windows-latest
python: 312
platform_id: win_amd64

# Linux 64 bit manylinux2014
- os: ubuntu-latest
python: 37
platform_id: manylinux_x86_64
manylinux_image: manylinux2014
- os: ubuntu-latest
python: 38
platform_id: manylinux_x86_64
Expand All @@ -76,11 +75,12 @@ jobs:
python: 311
platform_id: manylinux_x86_64
manylinux_image: manylinux2014
- os: ubuntu-latest
python: 312
platform_id: manylinux_x86_64
manylinux_image: manylinux2014

# Linux aarch64
- os: ubuntu-latest
python: 37
platform_id: manylinux_aarch64
- os: ubuntu-latest
python: 38
platform_id: manylinux_aarch64
Expand All @@ -93,11 +93,11 @@ jobs:
- os: ubuntu-latest
python: 311
platform_id: manylinux_aarch64
- os: ubuntu-latest
python: 312
platform_id: manylinux_aarch64

# MacOS x86_64
- os: macos-latest
python: 37
platform_id: macosx_x86_64
- os: macos-latest
python: 38
platform_id: macosx_x86_64
Expand All @@ -110,6 +110,9 @@ jobs:
- os: macos-latest
python: 311
platform_id: macosx_x86_64
- os: macos-latest
python: 312
platform_id: macosx_x86_64

# MacOS arm64
- os: macos-latest
Expand All @@ -124,9 +127,14 @@ jobs:
- os: macos-latest
python: 311
platform_id: macosx_arm64
- os: macos-latest
python: 312
platform_id: macosx_arm64

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true

- name: Set up QEMU
if: ${{ matrix.platform_id == 'manylinux_aarch64' }}
Expand All @@ -142,7 +150,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install cibuildwheel==2.12.0
python -m pip install cibuildwheel>=2.16
- name: Build wheels
env:
Expand All @@ -157,12 +165,52 @@ jobs:
python -m cibuildwheel --output-dir dist
- name: Store artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheel-${{ matrix.python }}-${{ matrix.platform_id }}
path: ./dist

# Todo: download and test the packages after we have working tests
test-package:
name: Test built package
needs: [ build-wheels, build-sdist ]
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Download the wheels
uses: actions/download-artifact@v4
with:
path: dist/
merge-multiple: true

- name: Install from package wheels and test
run: |
python -m venv testwhl
source testwhl/bin/activate
python -m pip install -U pip
python -m pip install pytest numpy
python -m pip install -U --pre --find-links dist/ pyjpegls
python -m pytest --pyargs jpeg_ls.tests
deactivate
- name: Install from package tarball and test
run: |
python -m venv testsrc
source testsrc/bin/activate
python -m pip install -U pip
python -m pip install pytest numpy
python -m pip install -U dist/pyjpegls*.tar.gz
python -m pytest --pyargs jpeg_ls.tests
deactivate
# See: https://github.com/pypa/gh-action-pypi-publish/discussions/15
deploy:
Expand All @@ -178,10 +226,10 @@ jobs:

steps:
- name: Download the wheels
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: wheels
path: dist/
merge-multiple: true

- name: Publish package to PyPi
uses: pypa/gh-action-pypi-publish@release/v1
7 changes: 7 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
include lib/charls/src/*
include lib/charls/include/charls/*
include lib/charls/README.md
include jpeg_ls/tests/jlsimV100/*
include jpeg_ls/*.cpp
include jpeg_ls/*.h
include jpeg_ls/*.pyx
2 changes: 1 addition & 1 deletion jpeg_ls/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from _CharLS import encode_to_buffer, decode_from_buffer # noqa: F401


__version__ = "1.1.0.dev0"
__version__ = "1.1.0"


# Setup default logging
Expand Down
Empty file added jpeg_ls/tests/__init__.py
Empty file.
9 changes: 5 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ authors = [

classifiers = [
"License :: OSI Approved :: MIT License",
"Development Status :: 4 - Beta",
"Development Status :: 5 - Production/Stable",
"Natural Language :: English",
"Programming Language :: Python",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
Expand All @@ -32,13 +33,13 @@ license = {text = "MIT"}
name = "pyjpegls"
readme = "readme.md"
requires-python = ">=3.8"
version = "1.1.0.dev0"
version = "1.1.0"

[project.urls]
documentation = "https://pydicom.github.io/pydicom"
download = "https://github.com/pydicom/pyjpegls/archive/master.zip"
homepage = "https://github.com/pydicom/pyjpegls"
repository = "https://github.com/pydicom/pyjpegls"

[tool.setuptools.packages]
find = {}
[tool.setuptools.packages.find]
include = ["jpeg_ls*"]

0 comments on commit 727e56d

Please sign in to comment.