Skip to content

Commit

Permalink
Use CharPyLS fork with newer cython version
Browse files Browse the repository at this point in the history
- should fix Python 3.11 builds
- change Python version for PR tests to 3.11
- fixes #1788
  • Loading branch information
mrbean-bremen committed Apr 27, 2023
1 parent 0f8870d commit 259961f
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 17 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/merge-pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ jobs:
python -m pip uninstall -y pillow
- name: Install and test jpeg_ls
if: ${{ matrix.python-version != '3.11' && matrix.python-version != '3.12-dev' }}
run: |
python -m pip install --upgrade cython
python -m pip install git+https://github.com/Who8MyLunch/CharPyLS
python -m pip install git+https://github.com/pydicom/CharPyLS
pytest ${{ matrix.pytest-args }} pydicom/tests/test_jpeg_ls_pixel_data.py pydicom/tests/test_JPEG_LS_transfer_syntax.py
python -m pip uninstall -y CharPyLS
Expand All @@ -92,7 +92,6 @@ jobs:
python -m pip uninstall -y python-gdcm
- name: Install and test pylibjpeg
if: ${{ matrix.python-version != '3.12-dev' }}
run: |
python -m pip install pylibjpeg
python -m pip uninstall -y pylibjpeg-openjpeg pylibjpeg-rle
Expand All @@ -101,10 +100,9 @@ jobs:
pytest ${{ matrix.pytest-args }} pydicom/tests/test_pylibjpeg.py
- name: Test all pixel handling
if: ${{ matrix.python-version != '3.11' && matrix.python-version != '3.12-dev' }}
run: |
python -m pip install pillow python-gdcm
python -m pip install git+https://github.com/Who8MyLunch/CharPyLS
python -m pip install git+https://github.com/pydicom/CharPyLS
pytest ${{ matrix.pytest-args }}
- name: Send coverage results
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pr-pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.10']
python-version: ['3.11']
include:
- os: 'ubuntu-latest'
send-coverage: true
Expand Down Expand Up @@ -155,7 +155,7 @@ jobs:
- name: Install and test jpeg_ls
run: |
python -m pip install --upgrade cython
python -m pip install git+https://github.com/Who8MyLunch/CharPyLS
python -m pip install git+https://github.com/pydicom/CharPyLS
pytest ${{ matrix.pytest-args }} pydicom/tests/test_JPEG_LS_transfer_syntax.py pydicom/tests/test_jpeg_ls_pixel_data.py
python -m pip uninstall -y CharPyLS
Expand All @@ -178,7 +178,7 @@ jobs:
- name: Test all pixel handling
run: |
python -m pip install --upgrade pillow python-gdcm
python -m pip install git+https://github.com/Who8MyLunch/CharPyLS
python -m pip install git+https://github.com/pydicom/CharPyLS
pytest ${{ matrix.pytest-args }}
- name: Send coverage results
Expand Down
7 changes: 3 additions & 4 deletions doc/old/image_data_handlers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The following packages can be used with *pydicom*:
most compressed formats
* `Pillow <http://pillow.readthedocs.io/en/latest/>`_, ideally with
``jpeg`` and ``jpeg2000`` plugins
* `jpeg_ls <https://github.com/Who8MyLunch/CharPyLS>`_
* `jpeg_ls <https://github.com/pydicom/CharPyLS>`_
* :gh:`pylibjpeg <pylibjpeg>`, with the ``-libjpeg``, ``-openjpeg`` and
``-rle`` plugins

Expand Down Expand Up @@ -51,8 +51,8 @@ handled by the given packages:

+-------------------------------------------------------------+-------+-------------+----------+-----------------+-----------------+
| Transfer Syntax | NumPy | | NumPy + | | NumPy +| | NumPy + | | NumPy + |
+------------------------------------+------------------------+ | | JPEG-LS\ | | GDCM | | Pillow | | pylibjpeg |
| Name | UID | | :sup:`7` | | | |
+------------------------------------+------------------------+ | | JPEG-LS | | GDCM | | Pillow | | pylibjpeg |
| Name | UID | | | | | |
+====================================+========================+=======+=============+==========+=================+=================+
| Explicit VR Little Endian | 1.2.840.10008.1.2.1 | |chk| | |chk| | |chk| | |chk| | |chk| |
+------------------------------------+------------------------+-------+-------------+----------+-----------------+-----------------+
Expand Down Expand Up @@ -92,7 +92,6 @@ handled by the given packages:
| :sup:`4` *with the pylibjpeg-rle plugin and using the* :meth:`~pydicom.dataset.Dataset.decompress` *method, 4-5x faster than default*
| :sup:`5` *with the pylibjpeg-libjpeg plugin*
| :sup:`6` *with the pylibjpeg-openjpeg plugin*
| :sup:`7` *only up to Python 3.10*
Usage
.....
Expand Down
2 changes: 1 addition & 1 deletion doc/release_notes/v2.4.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ Pydicom Internals
-----------------
* In test suites, renamed 'setup' and 'teardown' methods, deprecated starting
in pytest 7.2
* Do not try to use `CharPyLS` with Python > 3.10 (:issue:`1788`)
* Use own fork of `CharPyLS` to handle builds with Python 3.11 (:issue:`1788`)
7 changes: 4 additions & 3 deletions doc/tutorials/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -114,17 +114,18 @@ Installing CharPyLS

`CharPyLS <https://github.com/Who8MyLunch/CharPyLS>`_ is a Python interface to
the `CharLS <https://github.com/team-charls/charls>`_ C++ library and can
decompress JPEG-LS images.
decompress JPEG-LS images. We use `our own fork <https://github.com/pydicom/CharPyLS>`_
of the package for compatibility with the latest Python versions.

Using pip::

pip install cython
pip install git+https://github.com/Who8MyLunch/CharPyLS
pip install git+https://github.com/pydicom/CharPyLS

Through conda::

conda install cython
pip install git+https://github.com/Who8MyLunch/CharPyLS
pip install git+https://github.com/pydicom/CharPyLS


.. _tut_install_gdcm:
Expand Down
2 changes: 1 addition & 1 deletion pydicom/pixel_data_handlers/jpeg_ls_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

DEPENDENCIES = {
'numpy': ('http://www.numpy.org/', 'NumPy'),
'jpeg_ls': ('https://github.com/Who8MyLunch/CharPyLS', 'CharPyLS'),
'jpeg_ls': ('https://github.com/pydicom/CharPyLS', 'CharPyLS'),
}

SUPPORTED_TRANSFER_SYNTAXES = [
Expand Down

0 comments on commit 259961f

Please sign in to comment.