Skip to content

Commit

Permalink
Add type hints, support for v2 pixel data interface (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
scaramallion authored Jan 6, 2024
1 parent 31c10f8 commit 84ba50f
Show file tree
Hide file tree
Showing 22 changed files with 861 additions and 818 deletions.
3 changes: 1 addition & 2 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ comment:
require_base: yes # [yes :: must have a base report to post]
require_head: yes # [yes :: must have a head report to post]
branches: # branch names that can post comment
- "master"
- "main"

coverage:
status:
Expand All @@ -20,5 +20,4 @@ coverage:

ignore:
- "rle/tests"
- "rle/src"
- "rle/benchmarks"
8 changes: 4 additions & 4 deletions .github/workflows/pytest-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
Expand All @@ -25,9 +25,9 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Install Rust (stable)
run:
curl https://sh.rustup.rs -sSf | sh -s -- -y

- name: Install dependencies
run: |
Expand Down
78 changes: 45 additions & 33 deletions .github/workflows/release-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: release-deploy
on:
release:
types: [ published ]
# push:
# branches: [ main ]
# pull_request:

jobs:
build-sdist:
Expand All @@ -14,9 +17,9 @@ jobs:
with:
submodules: true

- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Install Rust (stable)
run:
curl https://sh.rustup.rs -sSf | sh -s -- -y

- uses: actions/setup-python@v5
name: Install Python
Expand All @@ -26,14 +29,13 @@ jobs:
- name: Build sdist
run: |
python -m pip install -U pip
python -m pip install -U setuptools-rust
python -m pip install .
python setup.py sdist
python -m pip install -U maturin build
python -m build --sdist -o dist
- name: Store artifacts
uses: actions/upload-artifact@v4
with:
name: wheels
name: sdist
path: ./dist

build-wheels:
Expand All @@ -44,9 +46,6 @@ jobs:
matrix:
include:
# Windows 32 bit
- os: windows-latest
python: 37
platform_id: win32
- os: windows-latest
python: 38
platform_id: win32
Expand All @@ -64,9 +63,6 @@ jobs:
platform_id: win32

# Windows 64 bit
- os: windows-latest
python: 37
platform_id: win_amd64
- os: windows-latest
python: 38
platform_id: win_amd64
Expand All @@ -84,10 +80,6 @@ jobs:
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 @@ -109,10 +101,24 @@ jobs:
platform_id: manylinux_x86_64
manylinux_image: manylinux2014

# Linux aarch64
- os: ubuntu-latest
python: 38
platform_id: manylinux_aarch64
- os: ubuntu-latest
python: 39
platform_id: manylinux_aarch64
- os: ubuntu-latest
python: 310
platform_id: manylinux_aarch64
- 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 Down Expand Up @@ -151,9 +157,15 @@ jobs:
with:
submodules: true

- uses: actions-rs/toolchain@v1
- name: Set up QEMU
if: ${{ matrix.platform_id == 'manylinux_aarch64' }}
uses: docker/setup-qemu-action@v3
with:
toolchain: stable
platforms: arm64

- name: Install Rust (stable)
run:
curl https://sh.rustup.rs -sSf | sh -s -- -y

- uses: actions/setup-python@v5
name: Install Python
Expand Down Expand Up @@ -183,7 +195,7 @@ jobs:
- name: Store artifacts
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheel-${{ matrix.python }}-${{ matrix.platform_id }}
path: ./dist

test-package:
Expand All @@ -194,12 +206,12 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Install Rust (stable)
run:
curl https://sh.rustup.rs -sSf | sh -s -- -y

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
Expand All @@ -209,8 +221,8 @@ jobs:
- name: Download the wheels
uses: actions/download-artifact@v4
with:
name: wheels
path: dist/
merge-multiple: true

- name: Install from package wheels and test
run: |
Expand All @@ -220,8 +232,8 @@ jobs:
python -m pip install -U pytest pydicom pylibjpeg
python -m pip uninstall -y pylibjpeg-rle
python -m pip install git+https://github.com/pydicom/pylibjpeg-data
python -m pip install -U --find-links dist/ pylibjpeg-rle
python -c "import pytest; pytest.main(['--pyargs', 'rle.tests'])"
python -m pip install -U --pre --find-links dist/ pylibjpeg-rle
python -m pytest --pyargs rle.tests
deactivate
- name: Install from package tarball and test
Expand All @@ -233,8 +245,8 @@ jobs:
python -m pip uninstall -y pylibjpeg-rle
python -m pip install git+https://github.com/pydicom/pylibjpeg-data
export PATH="$PATH:$HOME/.cargo/bin"
python -m pip install -U dist/pylibjpeg-rle-*.tar.gz
python -c "import pytest; pytest.main(['--pyargs', 'rle.tests'])"
python -m pip install -U dist/pylibjpeg*rle-*.tar.gz
python -m pytest --pyargs rle.tests
deactivate
# The pypi upload fails with non-linux containers, so grab the uploaded
Expand All @@ -249,8 +261,8 @@ jobs:
- name: Download the wheels
uses: actions/download-artifact@v4
with:
name: wheels
path: dist/
merge-multiple: true

- name: Publish package to PyPi
uses: pypa/gh-action-pypi-publish@master
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ venv/
ENV/
env.bak/
venv.bak/
env*/

# Spyder project settings
.spyderproject
Expand Down
Loading

0 comments on commit 84ba50f

Please sign in to comment.