Skip to content

Commit 462b99e

Browse files
authored
Updates in preparation for release (#26)
1 parent 9c683ad commit 462b99e

19 files changed

+170
-487
lines changed

.github/workflows/pytest-builds.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
python-version: [3.7, 3.8, 3.9]
16+
python-version: [3.6, 3.7, 3.8, 3.9]
1717
arch: ['x64', 'x86']
1818

1919
steps:
@@ -29,6 +29,7 @@ jobs:
2929

3030
- name: Install package and dependencies
3131
run: |
32+
python --version
3233
python -m pip install -U pip
3334
python -m pip install pytest cython numpy
3435
python -m pip install . -v
@@ -40,7 +41,8 @@ jobs:
4041
4142
- name: Install pydicom release and rerun pytest
4243
run: |
43-
pip install pydicom
44+
pip install pydicom pylibjpeg
45+
pip uninstall -y pylibjpeg-openjpeg
4446
pytest
4547
4648
osx:
@@ -49,7 +51,7 @@ jobs:
4951
strategy:
5052
fail-fast: false
5153
matrix:
52-
python-version: [3.7, 3.8, 3.9]
54+
python-version: [3.6, 3.7, 3.8, 3.9]
5355

5456
steps:
5557
- uses: actions/checkout@v2
@@ -63,7 +65,9 @@ jobs:
6365

6466
- name: Install package and dependencies
6567
run: |
68+
python --version
6669
python -m pip install -U pip
70+
python -m pip install cython numpy
6771
python -m pip install . -v
6872
python -m pip install pytest
6973
python -m pip install git+https://github.com/pydicom/pylibjpeg-data
@@ -74,7 +78,8 @@ jobs:
7478
7579
- name: Install pydicom release and rerun pytest
7680
run: |
77-
pip install pydicom
81+
pip install pydicom pylibjpeg
82+
pip uninstall -y pylibjpeg-openjpeg
7883
pytest
7984
8085
ubuntu:
@@ -83,7 +88,7 @@ jobs:
8388
strategy:
8489
fail-fast: false
8590
matrix:
86-
python-version: [3.7, 3.8, 3.9]
91+
python-version: [3.6, 3.7, 3.8, 3.9]
8792

8893
steps:
8994
- uses: actions/checkout@v2
@@ -97,7 +102,9 @@ jobs:
97102

98103
- name: Install package and dependencies
99104
run: |
105+
python --version
100106
python -m pip install -U pip
107+
python -m pip install cython numpy
101108
python -m pip install .
102109
python -m pip install pytest coverage pytest-cov
103110
python -m pip install git+https://github.com/pydicom/pylibjpeg-data
@@ -108,7 +115,8 @@ jobs:
108115
109116
- name: Install pydicom release and rerun pytest
110117
run: |
111-
pip install pydicom
118+
pip install pydicom pylibjpeg
119+
pip uninstall -y pylibjpeg-openjpeg
112120
pytest --cov=libjpeg --cov-append libjpeg/tests
113121
114122
- name: Switch to pydicom dev and rerun pytest

.github/workflows/release-wheels.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Build wheels and deploy to PyPI
2+
3+
on:
4+
release:
5+
types: [ published ]
6+
7+
jobs:
8+
build_wheels:
9+
name: Build wheels for ${{ matrix.os }}
10+
runs-on: ${{ matrix.os }}
11+
env:
12+
CIBW_BUILD: "cp3*-*"
13+
CIBW_SKIP: "cp35-*"
14+
strategy:
15+
matrix:
16+
os: [ubuntu-latest, windows-latest, macos-latest]
17+
python-version: [3.9]
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
with:
22+
submodules: true
23+
24+
- uses: actions/setup-python@v2
25+
name: Install Python
26+
with:
27+
python-version: ${{ matrix.python-version }}
28+
29+
- name: Install cibuildwheel
30+
31+
run: |
32+
python -m pip install cibuildwheel==1.10.0
33+
34+
- name: Build sdist
35+
run: |
36+
python setup.py sdist
37+
38+
- name: Build wheels
39+
run: |
40+
python --version
41+
python -m cibuildwheel --output-dir dist
42+
43+
- uses: actions/upload-artifact@v2
44+
with:
45+
name: wheels
46+
path: ./dist
47+
48+
# The pypi upload fails with non-linux containers, so grab the uploaded
49+
# artifacts and run using those
50+
# See: https://github.com/pypa/gh-action-pypi-publish/discussions/15
51+
deploy:
52+
name: Upload wheels to PyPI
53+
needs:
54+
- build_wheels
55+
runs-on: ubuntu-latest
56+
57+
steps:
58+
- name: Download the wheels
59+
uses: actions/download-artifact@v2
60+
with:
61+
name: wheels
62+
path: dist/
63+
64+
- name: Publish package to PyPi
65+
uses: pypa/gh-action-pypi-publish@master
66+
with:
67+
user: __token__
68+
password: ${{ secrets.PYPI_PASSWORD }}

.github/workflows/wheel-builds.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ Encoding of JPEG images is not currently supported
5858
from pydicom import dcmread
5959
from pydicom.data import get_testdata_file
6060

61-
import pylibjpeg
62-
6361
ds = dcmread(get_testdata_file('JPEG-LL.dcm'))
6462
arr = ds.pixel_array
6563
```
@@ -76,4 +74,7 @@ from libjpeg import decode
7674
with open('filename.jpg', 'rb') as f:
7775
# Returns a numpy array
7876
arr = decode(f.read())
77+
78+
# Or simply...
79+
arr = decode('filename.jpg')
7980
```
File renamed without changes.
File renamed without changes.

docs/changes/v1.2.0.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.. _v1.2.0:
2+
3+
1.2.0
4+
=====
5+
6+
Changes
7+
.......
8+
9+
* Added support for Python 3.9
10+
* Removed ``_config`` module
11+
12+
13+
Enhancements
14+
............
15+
16+
* Add support for passing the path to the JPEG file to
17+
:func:`~libjpeg.utils.decode` and :func:`~libjpeg.utils.get_parameters`
18+
as either :class:`str` or :class:`pathlib.Path`

libjpeg/__init__.py

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

3-
from ._config import DICOM_ENCODERS, DICOM_DECODERS
43
from ._version import __version__
54
from .utils import decode, decode_pixel_data, get_parameters

libjpeg/_config.py

Lines changed: 0 additions & 32 deletions
This file was deleted.

libjpeg/_version.py

Lines changed: 1 addition & 1 deletion
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"""

0 commit comments

Comments
 (0)