From dea7e76250ca2e0aa6b0a48246a9bd53e83c0ca6 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Tue, 29 Aug 2023 17:43:06 +0100 Subject: [PATCH 1/7] switch out xdrlib to mda_xdrlib --- .github/actions/setup-deps/action.yaml | 3 +++ package/MDAnalysis/topology/TPRParser.py | 1 - package/MDAnalysis/topology/tpr/utils.py | 4 ++-- package/pyproject.toml | 1 + package/setup.py | 1 + 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/actions/setup-deps/action.yaml b/.github/actions/setup-deps/action.yaml index 6af3dd3f9dc..d6c8cdc6c91 100644 --- a/.github/actions/setup-deps/action.yaml +++ b/.github/actions/setup-deps/action.yaml @@ -33,6 +33,8 @@ inputs: default: 'hypothesis' matplotlib: default: 'matplotlib-base' + mda_xdrlib: + default: 'mda_xdrlib' mmtf-python: default: 'mmtf-python' networkx: @@ -111,6 +113,7 @@ runs: ${{ inputs.griddataformats }} ${{ inputs.hypothesis }} ${{ inputs.matplotlib }} + ${{ inputs.mda_xdrlib }} ${{ inputs.mmtf-python }} ${{ inputs.networkx }} ${{ inputs.numpy }} diff --git a/package/MDAnalysis/topology/TPRParser.py b/package/MDAnalysis/topology/TPRParser.py index 733d8bd994f..6e0093304b7 100644 --- a/package/MDAnalysis/topology/TPRParser.py +++ b/package/MDAnalysis/topology/TPRParser.py @@ -158,7 +158,6 @@ __author__ = "Zhuyi Xue" __copyright__ = "GNU Public Licence, v2" -import xdrlib from . import guessers from ..lib.util import openany diff --git a/package/MDAnalysis/topology/tpr/utils.py b/package/MDAnalysis/topology/tpr/utils.py index a72fb5dce71..7b399da8b09 100644 --- a/package/MDAnalysis/topology/tpr/utils.py +++ b/package/MDAnalysis/topology/tpr/utils.py @@ -48,7 +48,7 @@ """ import numpy as np -import xdrlib +import mda_xdrlib import struct from . import obj @@ -74,7 +74,7 @@ ) -class TPXUnpacker(xdrlib.Unpacker): +class TPXUnpacker(mda_xdrlib.Unpacker): """ Extend the standard XDR unpacker for the specificity of TPX files. """ diff --git a/package/pyproject.toml b/package/pyproject.toml index 6d81f5be713..e3585101d4b 100644 --- a/package/pyproject.toml +++ b/package/pyproject.toml @@ -46,6 +46,7 @@ dependencies = [ 'threadpoolctl', 'packaging', 'fasteners', + 'mda_xdrlib', ] keywords = [ "python", "science", "chemistry", "biophysics", "molecular-dynamics", diff --git a/package/setup.py b/package/setup.py index 505b55e6546..e6877afa6d0 100755 --- a/package/setup.py +++ b/package/setup.py @@ -604,6 +604,7 @@ def long_description(readme): 'threadpoolctl', 'packaging', 'fasteners', + 'mda_xdrlib', ] setup(name='MDAnalysis', From bb7e46c8ab8ed59beb302de060d9b6a67a637e70 Mon Sep 17 00:00:00 2001 From: Irfan Alibay Date: Tue, 29 Aug 2023 17:46:03 +0100 Subject: [PATCH 2/7] Update action.yaml --- .github/actions/setup-deps/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-deps/action.yaml b/.github/actions/setup-deps/action.yaml index d6c8cdc6c91..3152caabe76 100644 --- a/.github/actions/setup-deps/action.yaml +++ b/.github/actions/setup-deps/action.yaml @@ -34,7 +34,7 @@ inputs: matplotlib: default: 'matplotlib-base' mda_xdrlib: - default: 'mda_xdrlib' + default: 'mda-xdrlib' mmtf-python: default: 'mmtf-python' networkx: From 33f072850b2e3ecf32952f77d948031458bff512 Mon Sep 17 00:00:00 2001 From: Irfan Alibay Date: Tue, 29 Aug 2023 17:46:33 +0100 Subject: [PATCH 3/7] Update pyproject.toml --- package/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/pyproject.toml b/package/pyproject.toml index e3585101d4b..159f3155397 100644 --- a/package/pyproject.toml +++ b/package/pyproject.toml @@ -46,7 +46,7 @@ dependencies = [ 'threadpoolctl', 'packaging', 'fasteners', - 'mda_xdrlib', + 'mda-xdrlib', ] keywords = [ "python", "science", "chemistry", "biophysics", "molecular-dynamics", From eae81a89ddd89514cf79427fef327f129928c7f6 Mon Sep 17 00:00:00 2001 From: Irfan Alibay Date: Tue, 29 Aug 2023 17:46:51 +0100 Subject: [PATCH 4/7] Update setup.py --- package/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/setup.py b/package/setup.py index e6877afa6d0..ff5c864b315 100755 --- a/package/setup.py +++ b/package/setup.py @@ -604,7 +604,7 @@ def long_description(readme): 'threadpoolctl', 'packaging', 'fasteners', - 'mda_xdrlib', + 'mda-xdrlib', ] setup(name='MDAnalysis', From 502b1d0f0788870c854d4fdb26b781903b3cb00d Mon Sep 17 00:00:00 2001 From: Irfan Alibay Date: Tue, 29 Aug 2023 17:57:24 +0100 Subject: [PATCH 5/7] update xdrlib import --- package/MDAnalysis/topology/tpr/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/MDAnalysis/topology/tpr/utils.py b/package/MDAnalysis/topology/tpr/utils.py index 7b399da8b09..2f13ea5fe3c 100644 --- a/package/MDAnalysis/topology/tpr/utils.py +++ b/package/MDAnalysis/topology/tpr/utils.py @@ -48,7 +48,7 @@ """ import numpy as np -import mda_xdrlib +import mda_xdrlib import xdrlib import struct from . import obj @@ -74,7 +74,7 @@ ) -class TPXUnpacker(mda_xdrlib.Unpacker): +class TPXUnpacker(xdrlib.Unpacker): """ Extend the standard XDR unpacker for the specificity of TPX files. """ From 38b6f03820eb8a9209cbe65cdcc5316d362fff48 Mon Sep 17 00:00:00 2001 From: Irfan Alibay Date: Tue, 29 Aug 2023 18:48:18 +0100 Subject: [PATCH 6/7] Update utils.py --- package/MDAnalysis/topology/tpr/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/MDAnalysis/topology/tpr/utils.py b/package/MDAnalysis/topology/tpr/utils.py index 2f13ea5fe3c..cbe4e47fe8d 100644 --- a/package/MDAnalysis/topology/tpr/utils.py +++ b/package/MDAnalysis/topology/tpr/utils.py @@ -48,7 +48,7 @@ """ import numpy as np -import mda_xdrlib import xdrlib +from mda_xdrlib import xdrlib import struct from . import obj From 74f47d0384d380ab24544c57752d229d8b5dd370 Mon Sep 17 00:00:00 2001 From: Irfan Alibay Date: Tue, 29 Aug 2023 20:30:48 +0100 Subject: [PATCH 7/7] Update CHANGELOG --- package/CHANGELOG | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package/CHANGELOG b/package/CHANGELOG index eaeb5f1c71e..f7ce77c8555 100644 --- a/package/CHANGELOG +++ b/package/CHANGELOG @@ -22,6 +22,9 @@ Fixes Enhancements Changes + * The `mda-xdrlib` module is now a core dependency of MDAnalysis + replacing the now deprecated `xdrlib` core Python library + (PR #4271) Deprecations