Skip to content

Commit

Permalink
Backport C-FIND fix (#576)
Browse files Browse the repository at this point in the history
  • Loading branch information
scaramallion committed Jan 7, 2021
1 parent a369615 commit d1701fa
Show file tree
Hide file tree
Showing 10 changed files with 339 additions and 69 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/pypi-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: pypi-deploy

on:
release:
types: [ published ]

jobs:

deploy:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: [3.8]

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Build package
run: |
python -m pip install --upgrade pip
pip install wheel
python setup.py sdist bdist_wheel
- name: Upload artifacts
if: ${{ success() }}
uses: actions/upload-artifact@v2
with:
name: wheels
path: dist/*.whl

- name: Publish package to Test PyPi
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.test_pypi_password }}
repository_url: https://test.pypi.org/legacy/

- name: Install dependencies
run: |
pip install virtualenvwrapper
mkvirtualenvwrapper testpynd
pip install pytest pydicom
pip install -i https://test.pypi.org/simple/ pynetdicom
- name: Test with pytest
run: |
cd ${HOME}
python -c "import pytest; pytest.main(['--pyargs', 'pynetdicom.tests'])"
deactivate
cd ${GITHUB_WORKSPACE}
- name: Publish package to PyPi
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
101 changes: 101 additions & 0 deletions .github/workflows/pytest-builds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: build

on:
push:
branches: [ 1.5.X ]
pull_request:
branches: [ 1.5.X ]

jobs:

conda:
# Test conda build with latest Python version
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
python-version: [3.8]

steps:
- uses: actions/checkout@v2
- name: Setup conda
uses: s-weigand/setup-conda@v1
with:
update-conda: true
python-version: ${{ matrix.python-version }}
conda-channels: anaconda, conda-forge
- name: Install dependencies
run: |
conda install pytest coverage pytest-cov
conda install -c conda-forge pydicom
- name: Test with pytest
env:
PYTHON_VERSION: ${{ matrix.python-version }}
run: |
pytest --ignore=pynetdicom/apps
pydicom-dev:
# Matrix builds with development pydicom
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
python-version: [3.6, 3.7, 3.8]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest coverage pytest-cov
pip install git+https://github.com/pydicom/pydicom
- name: Test with pytest
env:
PYTHON_VERSION: ${{ matrix.python-version }}
run: |
pytest --cov pynetdicom --ignore=pynetdicom/apps
- name: Send coverage results
if: ${{ success() }}
run: |
bash <(curl --connect-timeout 10 --retry 10 --retry-max-time \
0 https://codecov.io/bash) || (sleep 30 && bash <(curl \
--connect-timeout 10 --retry 10 --retry-max-time \
0 https://codecov.io/bash))
pydicom-release:
# Matrix builds with released pydicom
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
python-version: [3.6, 3.7, 3.8]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pydicom coverage pytest-cov
- name: Test with pytest
env:
PYTHON_VERSION: ${{ matrix.python-version }}
run: |
pytest --cov pynetdicom --ignore=pynetdicom/apps
- name: Send coverage results
if: ${{ success() }}
run: |
bash <(curl --connect-timeout 10 --retry 10 --retry-max-time \
0 https://codecov.io/bash) || (sleep 30 && bash <(curl \
--connect-timeout 10 --retry 10 --retry-max-time \
0 https://codecov.io/bash))
39 changes: 0 additions & 39 deletions .travis.yml

This file was deleted.

28 changes: 0 additions & 28 deletions build_tools/travis/install.sh

This file was deleted.

1 change: 1 addition & 0 deletions docs/changelog/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Release Notes
.. toctree::
:maxdepth: 1

v1.5.5
v1.5.4
v1.5.3
v1.5.2
Expand Down
10 changes: 10 additions & 0 deletions docs/changelog/v1.5.5.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _v1.5.5:

1.5.5
=====

Fixes
.....

* Fixed C-FIND SCPs sending the previous pending Identifier with the final
success response (#571)
3 changes: 3 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ Applications
Release Notes
=============

* :doc:`v1.5.5 </changelog/v1.5.5>`
* :doc:`v1.5.4 </changelog/v1.5.4>`
* :doc:`v1.5.3 </changelog/v1.5.3>`
* :doc:`v1.5.2 </changelog/v1.5.2>`
* :doc:`v1.5.1 </changelog/v1.5.1>`
* :doc:`v1.5.0 </changelog/v1.5.0>`
Expand Down
2 changes: 1 addition & 1 deletion pynetdicom/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import re


__version__ = '1.5.4'
__version__ = '1.5.5'


VERSION_PATTERN = r"""
Expand Down
5 changes: 4 additions & 1 deletion pynetdicom/service_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,8 @@ def _c_find_scp(self, req, context):
if not self.assoc.is_established:
return

# Send final success response
# Send final success response - make sure the identifier isn't present
rsp.Identifier = None
rsp.Status = 0x0000
LOGGER.info('Find SCP Response {}: 0x0000 (Success)'.format(ii + 2))
self.dimse.send_msg(rsp, cx_id)
Expand Down Expand Up @@ -1861,6 +1862,7 @@ def _add_failed_instance(ds):
# Success response - no failures or warnings
LOGGER.info('Get SCP Response {}: 0x0000 (Success)'.format(ii + 2))
rsp.Status = 0x0000
rsp.Identifier = None
else:
# Warning response - one or more failures or warnings
LOGGER.info('Get SCP Response {}: 0xB000 (Warning)'.format(ii + 2))
Expand Down Expand Up @@ -2271,6 +2273,7 @@ def _add_failed_instance(ds):
'Move SCP Response {}: 0x0000 (Success)'.format(ii + 2)
)
rsp.Status = 0x0000
rsp.Identifier = None
else:
# Warning response - one or more failures or warnings
LOGGER.info(
Expand Down
Loading

0 comments on commit d1701fa

Please sign in to comment.