Skip to content

Commit bc205ea

Browse files
authored
Deprecate pydicom module, prep for release (#59)
1 parent fdc6e98 commit bc205ea

15 files changed

+123
-389
lines changed

.github/workflows/pytest-builds.yml

+2-1
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.6, 3.7, 3.8]
15+
python-version: [3.6, 3.7, 3.8, 3.9]
1616

1717
steps:
1818
- uses: actions/checkout@v2
@@ -25,6 +25,7 @@ jobs:
2525
- name: Install package and dependencies
2626
run: |
2727
python -m pip install -U pip
28+
python -m pip install wheel
2829
python -m pip install .
2930
python -m pip uninstall -y pylibjpeg-openjpeg
3031
python -m pip install git+https://github.com/pydicom/pylibjpeg-data

.github/workflows/release-deploy.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Build package and deploy to PyPI
2+
3+
on:
4+
release:
5+
types: [ published ]
6+
7+
jobs:
8+
build_deploy:
9+
name: Build and deploy
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
with:
15+
submodules: true
16+
17+
- uses: actions/setup-python@v2
18+
name: Install Python
19+
with:
20+
python-version: 3.9
21+
22+
- name: Install requirements
23+
24+
run: |
25+
python -m pip install -U pip
26+
python -m pip install twine wheel
27+
28+
- name: Build wheels and sdist
29+
run: |
30+
python setup.py sdist bdist_wheel
31+
32+
- uses: actions/upload-artifact@v2
33+
with:
34+
name: wheels
35+
path: ./dist
36+
37+
- name: Publish package to PyPi
38+
uses: pypa/gh-action-pypi-publish@master
39+
with:
40+
user: __token__
41+
password: ${{ secrets.PYPI_PASSWORD }}

README.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,12 @@ determined with:
6464

6565
### Usage
6666
#### With pydicom
67-
Assuming you already have *pydicom* v1.4+ and suitable plugins installed:
67+
Assuming you already have *pydicom* v2.1+ and suitable plugins installed:
6868

6969
```python
7070
from pydicom import dcmread
7171
from pydicom.data import get_testdata_file
7272

73-
# Importing the package adds the pixel data handler to pydicom
74-
import pylibjpeg
75-
7673
# With the pylibjpeg-libjpeg plugin
7774
ds = dcmread(get_testdata_file('JPEG-LL.dcm'))
7875
jpg_arr = ds.pixel_array
@@ -88,8 +85,7 @@ function:
8885
```python
8986
from pydicom import dcmread
9087
from pydicom.data import get_testdata_file
91-
92-
from pylibjpeg import generate_frames
88+
from pydicom.pixel_data_handlers.pylibjpeg_handler import generate_frames
9389

9490
ds = dcmread(get_testdata_file('color3d_jpeg_baseline.dcm'))
9591
frames = generate_frames(ds)
File renamed without changes.
File renamed without changes.

docs/changes/v1.2.0.rst

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.. _v1.2.0:
2+
3+
1.2.0
4+
=====
5+
6+
* Added support for Python 3.9
7+
* Removed standalone pydicom pixel data handler
8+
* ``The pylibjpeg.pydicom`` module is deprecated and will be removed in v2.0,
9+
use pydicom instead.
10+
* ``get_pixel_data_decoders`` moved from ``pylibjpeg.pydicom.utils`` to
11+
```pylibjpeg.utils``

pylibjpeg/__init__.py

+3-19
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
"""Set package shortcuts."""
22

33
import logging
4-
import sys
54

6-
7-
from ._version import __version__
8-
from .utils import decode, add_handler
5+
from pylibjpeg._version import __version__
6+
from pylibjpeg.pydicom.utils import generate_frames # deprecated
7+
from pylibjpeg.utils import decode
98

109

1110
# Setup default logging
@@ -23,18 +22,3 @@ def debug_logger():
2322
formatter = logging.Formatter('%(levelname).1s: %(message)s')
2423
handler.setFormatter(formatter)
2524
logger.addHandler(handler)
26-
27-
28-
try:
29-
import pydicom
30-
_logger.debug('pydicom module loaded')
31-
from pylibjpeg.pydicom.utils import generate_frames
32-
33-
# We only add a handler if pydicom doesn't already have one
34-
try:
35-
import pydicom.pixel_data_handlers.pylibjpeg_handler
36-
except ImportError:
37-
add_handler()
38-
39-
except ImportError:
40-
pass

pylibjpeg/_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import re
44

55

6-
__version__ = '1.2.0.dev0'
6+
__version__ = '1.2.0'
77

88

99
VERSION_PATTERN = r"""

pylibjpeg/pydicom/pixel_data_handler.py

-192
This file was deleted.

0 commit comments

Comments
 (0)