From 0f3599c4af49708b10242aa790b75f6468c0687e Mon Sep 17 00:00:00 2001 From: Patrick Kunzmann Date: Sat, 14 Dec 2024 21:03:22 +0100 Subject: [PATCH 1/4] Downgrade Python version in test environment to make DSSP work --- .github/workflows/test_and_deploy.yml | 2 +- doc/tutorial/structure/io.rst | 4 ++-- environment.yml | 2 +- src/biotite/sequence/io/genbank/file.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test_and_deploy.yml b/.github/workflows/test_and_deploy.yml index 85937ceb0..75d25c912 100644 --- a/.github/workflows/test_and_deploy.yml +++ b/.github/workflows/test_and_deploy.yml @@ -31,7 +31,7 @@ env: # mussllinux takes 6+ hrs to build and test so ignore it CIBW_TEST_SKIP: "*musllinux* *-macosx_arm64" # Configuration for the architecture-agnostic jobs - PY_VERSION: "3.12" # Keep in sync with version in environment.yml + PY_VERSION: "3.11" # Keep in sync with version in environment.yml jobs: diff --git a/doc/tutorial/structure/io.rst b/doc/tutorial/structure/io.rst index a9fa0eb87..28c5b1690 100644 --- a/doc/tutorial/structure/io.rst +++ b/doc/tutorial/structure/io.rst @@ -211,9 +211,9 @@ automatically - from a single :class:`BinaryCIFData` to an entire .. jupyter-execute:: uncompressed_data = pdbx.BinaryCIFData(np.arange(100)) - print(f"Uncompressed size: {len(uncompressed_data.serialize()["data"])} bytes") + print(f"Uncompressed size: {len(uncompressed_data.serialize()['data'])} bytes") compressed_data = pdbx.compress(uncompressed_data) - print(f"Compressed size: {len(compressed_data.serialize()["data"])} bytes") + print(f"Compressed size: {len(compressed_data.serialize()['data'])} bytes") Using structures from a PDBx file diff --git a/environment.yml b/environment.yml index f04b1aa5b..6c51298f3 100644 --- a/environment.yml +++ b/environment.yml @@ -10,7 +10,7 @@ channels: - salilab dependencies: - - python =3.12 + - python =3.11 # Package building - cython >=3.0 - pip >=10.0 diff --git a/src/biotite/sequence/io/genbank/file.py b/src/biotite/sequence/io/genbank/file.py index eb6a14628..0fdd99c63 100644 --- a/src/biotite/sequence/io/genbank/file.py +++ b/src/biotite/sequence/io/genbank/file.py @@ -80,7 +80,7 @@ class GenBankFile(TextFile): >>> print(content) ['One line', 'A second line'] >>> print(subfields) - OrderedDict({'SUBFIELD1': ['Single Line'], 'SUBFIELD2': ['Two', 'lines']}) + OrderedDict([('SUBFIELD1', ['Single Line']), ('SUBFIELD2', ['Two', 'lines'])]) Adding an additional field: From 8750b0ba5d5434405357cc2f9f57645b60420a2e Mon Sep 17 00:00:00 2001 From: Patrick Kunzmann Date: Sun, 15 Dec 2024 13:33:03 +0100 Subject: [PATCH 2/4] Skip SRA-tools test, if not installed --- tests/application/test_sra.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/application/test_sra.py b/tests/application/test_sra.py index 7728ae33a..c758a4ffd 100644 --- a/tests/application/test_sra.py +++ b/tests/application/test_sra.py @@ -9,8 +9,12 @@ from biotite.application.sra import FastaDumpApp, FastqDumpApp from biotite.sequence.io.fasta import FastaFile from biotite.sequence.io.fastq import FastqFile +from tests.util import is_not_installed +@pytest.mark.skipif( + is_not_installed("fasterq-dump"), reason="sra-tools is not installed" +) @pytest.mark.parametrize( "app_class, custom_prefix", itertools.product([FastqDumpApp, FastaDumpApp], [False, True]), @@ -42,6 +46,9 @@ def test_objects(app_class, custom_prefix): assert isinstance(fasta_file, FastaFile) +@pytest.mark.skipif( + is_not_installed("fasterq-dump"), reason="sra-tools is not installed" +) @pytest.mark.parametrize( "app_class, custom_prefix", itertools.product([FastqDumpApp, FastaDumpApp], [False, True]), From 6de37669937635365979128ebd9ae1dc7564a077 Mon Sep 17 00:00:00 2001 From: Patrick Kunzmann Date: Sun, 15 Dec 2024 14:20:20 +0100 Subject: [PATCH 3/4] Fix exception on empty list --- doc/switcher.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/switcher.py b/doc/switcher.py index b9eb57059..5bd6202fc 100644 --- a/doc/switcher.py +++ b/doc/switcher.py @@ -92,6 +92,7 @@ def create_switcher_json(file_path, min_tag, n_versions): } ) # Mark the latest version as preferred - version_config[-1]["preferred"] = True + if len(version_config) > 0: + version_config[-1]["preferred"] = True with open(file_path, "w") as file: json.dump(version_config, file, indent=4) From 8e8c86e3dbb0fc172dbfa7366b6527a89b21e8bc Mon Sep 17 00:00:00 2001 From: Patrick Kunzmann Date: Thu, 19 Dec 2024 16:09:03 +0100 Subject: [PATCH 4/4] Update mandatory SRA Toolkit version to fix TLS handshake error --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index 6c51298f3..f384f9b95 100644 --- a/environment.yml +++ b/environment.yml @@ -34,7 +34,7 @@ dependencies: - dssp =3 - mafft - muscle =3 - - sra-tools + - sra-tools =3 - tantan - viennarna >=2.5.0 # Documentation building