From bd9a06e53f53c3403e30567cbd2c90e4a70c5f6a Mon Sep 17 00:00:00 2001 From: scaramallion Date: Thu, 30 May 2024 11:21:02 +1000 Subject: [PATCH] Prepare for v2.1 release (#939) --- .circleci/config.yml | 4 +-- .github/workflows/publish-pypi-deploy.yml | 41 ++++++----------------- build_tools/circle/build_doc.sh | 6 ++-- docs/changelog/v2.1.0.rst | 12 +++---- docs/reference/service_classes.rst | 1 + docs/user/association.rst | 11 ------ pynetdicom/_version.py | 4 +-- pynetdicom/presentation.py | 17 ++++++++-- pyproject.toml | 3 +- 9 files changed, 40 insertions(+), 59 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3687a436b..86e07badf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ version: 2 jobs: build: docker: - - image: cimg/python:3.10 + - image: python:3.10 steps: - checkout - run: @@ -14,7 +14,7 @@ jobs: - add_ssh_keys: fingerprints: - "13:8e:b6:7a:d2:8f:a0:4d:56:08:97:f2:c8:9c:10:e9" - - deploy: + - run: name: Deploy documentation environment: USERNAME: scaramallion diff --git a/.github/workflows/publish-pypi-deploy.yml b/.github/workflows/publish-pypi-deploy.yml index df85f807f..cdaf0931f 100644 --- a/.github/workflows/publish-pypi-deploy.yml +++ b/.github/workflows/publish-pypi-deploy.yml @@ -6,8 +6,8 @@ on: jobs: - build_and_test: - name: Build and test the package + build: + name: Build the package runs-on: ubuntu-latest steps: @@ -36,41 +36,22 @@ jobs: name: wheels path: dist/ - - 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: Set up test environment - run: | - poetry install --no-interaction --extras tests - pip install -i https://test.pypi.org/simple/ pynetdicom - - - name: Test with pytest - env: - PYTHON_VERSION: ${{ matrix.python-version }} - run: | - cd ${HOME} - python -m pynetdicom --version - python -c "import pytest; pytest.main(['--pyargs', 'pynetdicom.tests'])" - deploy: - name: Upload package to PyPI - needs: - - build_and_test + name: Upload release to PyPI + needs: [ build ] runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/project/pylibjpeg-libjpeg/ + permissions: + id-token: write steps: - name: Download the package files uses: actions/download-artifact@v4 with: - name: wheels path: dist/ + merge-multiple: true - name: Publish package to PyPi - uses: pypa/gh-action-pypi-publish@master - with: - user: __token__ - password: ${{ secrets.PYPI_PASSWORD }} + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/build_tools/circle/build_doc.sh b/build_tools/circle/build_doc.sh index 8eae305bc..ffaf6a3e5 100755 --- a/build_tools/circle/build_doc.sh +++ b/build_tools/circle/build_doc.sh @@ -85,9 +85,9 @@ fi # Installing required system packages to support the rendering of math # notation in the HTML documentation -sudo -E apt-get -yq update -sudo -E apt-get -yq remove texlive-binaries --purge -sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes \ +apt-get -yq update +apt-get -yq remove texlive-binaries --purge +apt-get -yq --no-install-suggests --no-install-recommends --force-yes \ install dvipng texlive-latex-base texlive-latex-extra \ texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended\ latexmk diff --git a/docs/changelog/v2.1.0.rst b/docs/changelog/v2.1.0.rst index 41f3d65c1..b4b84e75b 100644 --- a/docs/changelog/v2.1.0.rst +++ b/docs/changelog/v2.1.0.rst @@ -12,10 +12,10 @@ Fixes * Fixed maximum length of *Patient ID* attribute in ``qrscp`` app (:issue:`785`) * Sanitise filenames for received datasets for non-conformant SOP Instance UIDs (:issue:`823`) -* Fixed :attr:~pynetdicom._config.LOG_REQUEST_IDENTIFIERS` not applying to - meth:`Association.send_c_find()`, - meth:`Association.send_c_move()` and - meth:`Association.send_c_get()` (:issue:`911`) +* Fixed :attr:`~pynetdicom._config.LOG_REQUEST_IDENTIFIERS` not applying to + :meth:`Association.send_c_find()`, + :meth:`Association.send_c_move()` and + :meth:`Association.send_c_get()` (:issue:`911`) Enhancements @@ -29,13 +29,13 @@ Enhancements * Added support for :class:`Inventory Query/Retrieve Service Class ` (:issue:`879`) * Added support for :class:`Storage Management Service Class - ` (:issue:`880`) + ` (:issue:`880`) * Added :meth:`~pynetdicom.events.Event.encoded_dataset` to simplify accessing the encoded dataset without first decoding it * Added a check to :meth:`~pynetdicom.association.Association.send_c_store` to ensure that the *Transfer Syntax UID* matches the encoding of the dataset (:issue:`891`) -* Updated SOP Classes to version 2023e of the DICOM Standard +* Updated SOP Classes to version 2024b of the DICOM Standard Changes diff --git a/docs/reference/service_classes.rst b/docs/reference/service_classes.rst index 0d8a092a0..8a70727e2 100644 --- a/docs/reference/service_classes.rst +++ b/docs/reference/service_classes.rst @@ -39,4 +39,5 @@ pynetdicom supports the following Service Classes ProcedureStepServiceClass RTMachineVerificationServiceClass StorageCommitmentServiceClass + StorageManagementServiceClass UnifiedProcedureStepServiceClass diff --git a/docs/user/association.rst b/docs/user/association.rst index df2750abf..42ead28a6 100644 --- a/docs/user/association.rst +++ b/docs/user/association.rst @@ -213,10 +213,6 @@ Handlers can also be bound and unbound from events in an existing TLS ... -.. warning:: - - TLS v1.3 is not currently supported - The client socket used for the association can be wrapped in TLS by supplying the *tls_args* keyword parameter to :meth:`~pynetdicom.ae.ApplicationEntity.associate`: @@ -493,10 +489,6 @@ unaffected. TLS ... -.. warning:: - - TLS v1.3 is not currently supported - The client sockets generated by the association server can also be wrapped in TLS by supplying a :class:`ssl.SSLContext` instance via the *ssl_context* keyword parameter: @@ -516,9 +508,6 @@ keyword parameter: ssl_cx.verify_mode = ssl.CERT_REQUIRED ssl_cx.load_cert_chain(certfile='server.crt', keyfile='server.key') ssl_cx.load_verify_locations(cafile='client.crt') - # Python 3.7+ w/ OpenSSL 1.1.0g+, other versions may require a different - # method to set the TLS version - check the Python documentation - ssl_cx.maximum_version = ssl.TLSVersion.TLSv1_2 server = ae.start_server(("127.0.0.1", 11112), block=False, ssl_context=ssl_cx) diff --git a/pynetdicom/_version.py b/pynetdicom/_version.py index 73bdd6902..067fb2b72 100644 --- a/pynetdicom/_version.py +++ b/pynetdicom/_version.py @@ -4,10 +4,10 @@ # pynetdicom version -__version__ = "2.1.0.dev0" +__version__ = "2.1.0" # DICOM Standard version used for SOP classes and instances -__dicom_version__: str = "2023e" +__dicom_version__: str = "2024b" VERSION_PATTERN = r""" v? diff --git a/pynetdicom/presentation.py b/pynetdicom/presentation.py index a2de25b14..0b84cfa98 100644 --- a/pynetdicom/presentation.py +++ b/pynetdicom/presentation.py @@ -129,7 +129,14 @@ class PresentationContextTuple(NamedTuple): (False, True): CONTEXT_REJECTED, # Invalid }, } - +# Transfer Syntaxes not in pydicom v2.4 +_PYDICOM_ADDITIONS = [ + "1.2.840.10008.1.2.4.201", # HTJ2KLossless + "1.2.840.10008.1.2.4.202", # HTJ2KLosslessRPCL + "1.2.840.10008.1.2.4.203", # HTJ2K + "1.2.840.10008.1.2.4.204", # JPIPHTJ2KReferenced + "1.2.840.10008.1.2.4.205", # JPIPHTJ2KReferencedDeflate +] class PresentationContext: """A Presentation Context primitive. @@ -282,10 +289,14 @@ def add_transfer_syntax(self, syntax: Union[None, str, bytes, UID]) -> None: "A non-conformant UID has been added to 'transfer_syntax'" ) - if not syntax.is_private and not syntax.is_transfer_syntax: + if ( + not syntax.is_private + and not syntax.is_transfer_syntax + and syntax not in _PYDICOM_ADDITIONS + ): LOGGER.warning( "A UID has been added to 'transfer_syntax' that is not a " - "transfer syntax" + f"transfer syntax: '{syntax}'" ) self._transfer_syntax.append(syntax) diff --git a/pyproject.toml b/pyproject.toml index 8878eba0a..46f12ad62 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,6 @@ include = [ "pynetdicom/tests/dicom_files/*", "pynetdicom/apps/qrscp/default.ini", "pynetdicom/py.typed", - "LICENCE", ] @@ -40,7 +39,7 @@ maintainers = [ ] name = "pynetdicom" readme = "README.rst" -version = "2.1.0.dev0" +version = "2.1.0" [tool.poetry.dependencies]