Skip to content

Commit 535e37f

Browse files
authored
Prepare for release (#60)
1 parent 0045738 commit 535e37f

File tree

14 files changed

+278
-300
lines changed

14 files changed

+278
-300
lines changed

.github/workflows/pytest-builds.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,5 +124,5 @@ jobs:
124124
pytest --cov=libjpeg --cov-append libjpeg/tests
125125
126126
- name: Send coverage results
127-
if: ${{ success() && matrix.coverage == 'coverage' }}
127+
if: ${{ success() }}
128128
uses: codecov/codecov-action@v3

.github/workflows/release-wheels.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -243,17 +243,18 @@ jobs:
243243
name: Upload wheels to PyPI
244244
needs: [ test-package ]
245245
runs-on: ubuntu-latest
246-
timeout-minutes: 10
246+
environment:
247+
name: pypi
248+
url: https://pypi.org/project/pylibjpeg-libjpeg/
249+
permissions:
250+
id-token: write
247251

248252
steps:
249253
- name: Download the wheels
250254
uses: actions/download-artifact@v4
251255
with:
252-
name: wheels
253256
path: dist/
257+
merge-multiple: true
254258

255259
- name: Publish package to PyPi
256-
uses: pypa/gh-action-pypi-publish@master
257-
with:
258-
user: __token__
259-
password: ${{ secrets.PYPI_PASSWORD }}
260+
uses: pypa/gh-action-pypi-publish@release/v1

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ celerybeat.pid
103103
# Environments
104104
.env
105105
.venv
106-
env/
106+
env*/
107107
venv/
108108
ENV/
109109
env.bak/

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
[submodule "libjpeg/src/libjpeg"]
1+
[submodule "lib/libjpeg"]
22
path = lib/libjpeg
33
url = https://github.com/thorfdbg/libjpeg.git

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
[![Build Status](https://github.com/pydicom/pylibjpeg-libjpeg/workflows/unit-tests/badge.svg)](https://github.com/pydicom/pylibjpeg-libjpeg/actions?query=workflow%3Aunit-tests)
2-
[![codecov](https://codecov.io/gh/pydicom/pylibjpeg-libjpeg/branch/master/graph/badge.svg)](https://codecov.io/gh/pydicom/pylibjpeg-libjpeg)
3-
[![PyPI version](https://badge.fury.io/py/pylibjpeg-libjpeg.svg)](https://badge.fury.io/py/pylibjpeg-libjpeg)
4-
[![Python versions](https://img.shields.io/pypi/pyversions/pylibjpeg-libjpeg.svg)](https://img.shields.io/pypi/pyversions/pylibjpeg-libjpeg.svg)
1+
<p align="center">
2+
<a href="https://github.com/pydicom/pylibjpeg-libjpeg/actions?query=workflow%3Aunit-tests"><img alt="Build status" src="https://github.com/pydicom/pylibjpeg-libjpeg/workflows/unit-tests/badge.svg"></a>
3+
<a href="https://codecov.io/gh/pydicom/pylibjpeg-libjpeg"><img alt="Test coverage" src="https://codecov.io/gh/pydicom/pylibjpeg-libjpeg/branch/main/graph/badge.svg"></a>
4+
<a href="https://pypi.org/project/pylibjpeg-libjpeg/"><img alt="PyPI versions" src="https://img.shields.io/pypi/v/pylibjpeg-libjpeg"></a>
5+
<a href="https://www.python.org/"><img alt="Python versions" src="https://img.shields.io/pypi/pyversions/pylibjpeg-libjpeg"></a>
6+
<a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
7+
</p>
58

69
## pylibjpeg-libjpeg
710

docs/changes/v2.0.0.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
Changes
77
.......
88

9-
* Supports Python 3.8-3.12
10-
* Switched build to ``pyproject.toml``
9+
* Drop support for Python 3.7
10+
* Add supports for Python 3.11 and 3.12
11+
* Switched packaging and build to ``pyproject.toml``
1112
* Added type hints
12-
* Added support for returning a bytearray containing the decoded image data
13+
* Added support for version 2 of the pixel data decoding interface

libjpeg/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
"""Set package shortcuts."""
22

3-
from ._version import __version__
4-
from .utils import decode, decode_pixel_data, get_parameters
3+
from ._version import __version__ # noqa: F401
4+
from .utils import decode, decode_pixel_data, get_parameters # noqa: F401

libjpeg/_libjpeg.cpp

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

libjpeg/tests/test_decode.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
"""Tests for pylibjpeg.decode()."""
22

3-
from io import BytesIO
43
import os
54
from pathlib import Path
65
import pytest
7-
import warnings
86

97
import numpy as np
108

119
try:
12-
import pydicom
1310
from pydicom.encaps import generate_pixel_data_frame
1411
from pydicom.pixel_data_handlers.util import reshape_pixel_array
1512

@@ -215,7 +212,7 @@ def test_lossless_sv1(self, fname, info):
215212
assert arr.dtype == "uint16"
216213

217214
@pytest.mark.parametrize("fname, info", REF_DCM["1.2.840.10008.1.2.4.80"])
218-
def test_extended(self, fname, info):
215+
def test_jls_lossless(self, fname, info):
219216
"""Test get_parameters() for the LS lossless datasets."""
220217
# info: (rows, columns, spp, bps)
221218
index = get_indexed_datasets("1.2.840.10008.1.2.4.80")
@@ -235,7 +232,7 @@ def test_extended(self, fname, info):
235232
assert arr.dtype == "uint16"
236233

237234
@pytest.mark.parametrize("fname, info", REF_DCM["1.2.840.10008.1.2.4.81"])
238-
def test_extended(self, fname, info):
235+
def test_jls(self, fname, info):
239236
"""Test get_parameters() for the LS lossy datasets."""
240237
# info: (rows, columns, spp, bps)
241238
index = get_indexed_datasets("1.2.840.10008.1.2.4.81")

libjpeg/tests/test_handler.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
"""Tests for the pylibjpeg pixel data handler."""
22

33
import pytest
4-
import warnings
5-
6-
import numpy as np
74

85
try:
9-
import pydicom
10-
import pydicom.config
116
from pydicom.pixel_data_handlers.util import convert_color_space
127
from pydicom.encaps import defragment_data
138

@@ -1010,7 +1005,7 @@ def test_1s_1f_i_16_16(self):
10101005
r"plugin is not installed"
10111006
)
10121007
with pytest.raises(RuntimeError, match=msg):
1013-
arr = ds.pixel_array
1008+
ds.pixel_array
10141009

10151010

10161011
@pytest.mark.skipif(not HAS_PYDICOM, reason="No dependencies")
@@ -1038,4 +1033,4 @@ def test_1s_1f_i_16_16(self):
10381033
r"plugin is not installed"
10391034
)
10401035
with pytest.raises(RuntimeError, match=msg):
1041-
arr = ds.pixel_array
1036+
ds.pixel_array

0 commit comments

Comments
 (0)