Skip to content

Commit d692c8e

Browse files
authored
Add support for encoding and decoding bit-packed data (#46)
1 parent 3d48406 commit d692c8e

File tree

14 files changed

+886
-198
lines changed

14 files changed

+886
-198
lines changed

.github/workflows/pytest-builds.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
python-version: ['3.10', '3.11', '3.12', '3.13']
15+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
1616
os: [ubuntu-latest, windows-latest, macos-latest]
1717

1818
steps:
@@ -24,18 +24,29 @@ jobs:
2424
uses: actions/setup-python@v5
2525
with:
2626
python-version: ${{ matrix.python-version }}
27+
allow-prereleases: true
2728

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

32-
- name: Install dependencies
33+
- name: Install dependencies (!= 3.14)
34+
if: ${{ matrix.python-version != '3.14' }}
3335
run: |
3436
pip install --upgrade pip
3537
pip install setuptools-rust pytest pydicom coverage pytest-cov
3638
pip install git+https://github.com/pydicom/pylibjpeg-data
3739
pip install -e .
3840
41+
- name: Install dependencies (== 3.14)
42+
if: ${{ matrix.python-version == '3.14' }}
43+
run: |
44+
pip install --upgrade pip
45+
pip install setuptools-rust pytest coverage pytest-cov
46+
pip install git+https://github.com/pydicom/pylibjpeg-data
47+
pip install git+https://github.com/pydicom/pydicom
48+
pip install -e .
49+
3950
- name: Test with pytest
4051
env:
4152
PYTHON_VERSION: ${{ matrix.python-version }}

.github/workflows/release-wheels.yml

Lines changed: 71 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ jobs:
5858
- os: windows-latest
5959
python: 313
6060
platform_id: win32
61+
- os: windows-latest
62+
python: 314
63+
platform_id: win32
6164

6265
# Windows 64 bit
6366
- os: windows-latest
@@ -72,6 +75,9 @@ jobs:
7275
- os: windows-latest
7376
python: 313
7477
platform_id: win_amd64
78+
- os: windows-latest
79+
python: 314
80+
platform_id: win_amd64
7581

7682
# Linux 64 bit manylinux2014
7783
- os: ubuntu-latest
@@ -90,6 +96,10 @@ jobs:
9096
python: 313
9197
platform_id: manylinux_x86_64
9298
manylinux_image: manylinux2014
99+
- os: ubuntu-latest
100+
python: 314
101+
platform_id: manylinux_x86_64
102+
manylinux_image: manylinux2014
93103

94104
# Linux aarch64
95105
- os: ubuntu-latest
@@ -104,6 +114,9 @@ jobs:
104114
- os: ubuntu-latest
105115
python: 313
106116
platform_id: manylinux_aarch64
117+
- os: ubuntu-latest
118+
python: 314
119+
platform_id: manylinux_aarch64
107120

108121
# MacOS x86_64
109122
- os: macos-latest
@@ -118,6 +131,9 @@ jobs:
118131
- os: macos-latest
119132
python: 313
120133
platform_id: macosx_x86_64
134+
- os: macos-latest
135+
python: 314
136+
platform_id: macosx_x86_64
121137

122138
# MacOS arm64
123139
- os: macos-latest
@@ -132,6 +148,9 @@ jobs:
132148
- os: macos-latest
133149
python: 313
134150
platform_id: macosx_arm64
151+
- os: macos-latest
152+
python: 314
153+
platform_id: macosx_arm64
135154

136155
steps:
137156
- uses: actions/checkout@v5
@@ -157,7 +176,7 @@ jobs:
157176
run: |
158177
python -m pip install -U pip
159178
python -m pip install -U setuptools-rust
160-
python -m pip install cibuildwheel>=2.23
179+
python -m pip install cibuildwheel>=3.1.3
161180
162181
- name: Build wheels
163182
env:
@@ -179,63 +198,63 @@ jobs:
179198
name: wheel-${{ matrix.python }}-${{ matrix.platform_id }}
180199
path: ./dist
181200

182-
test-package:
183-
name: Test built package
184-
needs: [ build-wheels, build-sdist ]
185-
runs-on: ubuntu-latest
186-
timeout-minutes: 30
187-
strategy:
188-
fail-fast: false
189-
matrix:
190-
python-version: ['3.10', '3.11', '3.12', '3.13']
191-
192-
steps:
193-
- name: Install Rust (stable)
194-
run:
195-
curl https://sh.rustup.rs -sSf | sh -s -- -y
196-
197-
- name: Set up Python ${{ matrix.python-version }}
198-
uses: actions/setup-python@v5
199-
with:
200-
python-version: ${{ matrix.python-version }}
201-
202-
- name: Download the wheels
203-
uses: actions/download-artifact@v5
204-
with:
205-
path: dist/
206-
merge-multiple: true
207-
208-
- name: Install from package wheels and test
209-
run: |
210-
python -m venv testwhl
211-
source testwhl/bin/activate
212-
python -m pip install -U pip
213-
python -m pip install -U pytest pydicom pylibjpeg
214-
python -m pip uninstall -y pylibjpeg-rle
215-
python -m pip install git+https://github.com/pydicom/pylibjpeg-data
216-
python -m pip install -U --pre --find-links dist/ pylibjpeg-rle
217-
python -m pytest --pyargs rle.tests
218-
deactivate
219-
220-
- name: Install from package tarball and test
221-
run: |
222-
python -m venv testsrc
223-
source testsrc/bin/activate
224-
python -m pip install -U pip
225-
python -m pip install -U pytest pydicom pylibjpeg
226-
python -m pip uninstall -y pylibjpeg-rle
227-
python -m pip install git+https://github.com/pydicom/pylibjpeg-data
228-
export PATH="$PATH:$HOME/.cargo/bin"
229-
python -m pip install -U dist/pylibjpeg*rle-*.tar.gz
230-
python -m pytest --pyargs rle.tests
231-
deactivate
201+
# test-package:
202+
# name: Test built package
203+
# needs: [ build-wheels, build-sdist ]
204+
# runs-on: ubuntu-latest
205+
# timeout-minutes: 30
206+
# strategy:
207+
# fail-fast: false
208+
# matrix:
209+
# python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
210+
#
211+
# steps:
212+
# - name: Install Rust (stable)
213+
# run:
214+
# curl https://sh.rustup.rs -sSf | sh -s -- -y
215+
#
216+
# - name: Set up Python ${{ matrix.python-version }}
217+
# uses: actions/setup-python@v5
218+
# with:
219+
# python-version: ${{ matrix.python-version }}
220+
#
221+
# - name: Download the wheels
222+
# uses: actions/download-artifact@v4
223+
# with:
224+
# path: dist/
225+
# merge-multiple: true
226+
#
227+
# - name: Install from package wheels and test
228+
# run: |
229+
# python -m venv testwhl
230+
# source testwhl/bin/activate
231+
# python -m pip install -U pip
232+
# python -m pip install -U pytest pydicom pylibjpeg
233+
# python -m pip uninstall -y pylibjpeg-rle
234+
# python -m pip install git+https://github.com/pydicom/pylibjpeg-data
235+
# python -m pip install -U --pre --find-links dist/ pylibjpeg-rle
236+
# python -m pytest --pyargs rle.tests
237+
# deactivate
238+
#
239+
# - name: Install from package tarball and test
240+
# run: |
241+
# python -m venv testsrc
242+
# source testsrc/bin/activate
243+
# python -m pip install -U pip
244+
# python -m pip install -U pytest pydicom pylibjpeg
245+
# python -m pip uninstall -y pylibjpeg-rle
246+
# python -m pip install git+https://github.com/pydicom/pylibjpeg-data
247+
# export PATH="$PATH:$HOME/.cargo/bin"
248+
# python -m pip install -U dist/pylibjpeg*rle-*.tar.gz
249+
# python -m pytest --pyargs rle.tests
250+
# deactivate
232251

233252
# The pypi upload fails with non-linux containers, so grab the uploaded
234253
# artifacts and run using those
235254
# See: https://github.com/pypa/gh-action-pypi-publish/discussions/15
236255
deploy:
237256
name: Upload wheels to PyPI
238-
needs: [ test-package ]
257+
needs: [ build-wheels ]
239258
runs-on: ubuntu-latest
240259
environment:
241260
name: pypi

Cargo.lock

Lines changed: 21 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "pylibjpeg-rle"
3-
version = "1.1.0"
3+
version = "1.2.0"
44
authors = ["scaramallion <[email protected]>"]
55
edition = "2024"
66
exclude = [".github", "docs", ".codecov.yml", "asv.*", ".gitignore", ".coveragerc"]
@@ -11,4 +11,4 @@ crate-type = ["cdylib"]
1111

1212

1313
[dependencies]
14-
pyo3 = { version = "0.24.2", features = ["extension-module"] }
14+
pyo3 = { version = "0.26.0", features = ["extension-module"] }

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020-2021 scaramallion
3+
Copyright (c) 2020-2025 scaramallion
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)