diff --git a/CHANGES.md b/CHANGES.md index 848214460..d048a45b6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,13 @@ ## __NEXT__ +### Bug Fixes + +* Fix Python 3.11 installation for Conda environments. [#1334][] (@victorlin) +* Bump `pyfastx` dependency to major versions 1 and 2. [#1335][] (@victorlin) + +[#1334]: https://github.com/nextstrain/augur/issues/1334 +[#1335]: https://github.com/nextstrain/augur/pull/1335 ## 23.1.0 (22 September 2023) diff --git a/augur/io/metadata.py b/augur/io/metadata.py index 17277d850..4ce187681 100644 --- a/augur/io/metadata.py +++ b/augur/io/metadata.py @@ -336,10 +336,11 @@ def read_metadata_with_sequences(metadata, metadata_delimiters, fasta, seq_id_co else: processed_metadata_ids.add(seq_id) - # Skip records that do not have a matching sequence - # TODO: change this to try/except to fetch sequences and catch - # KeyError for non-existing sequences when https://github.com/lmdu/pyfastx/issues/50 is resolved - if seq_id not in sequence_ids: + try: + sequence_record = sequences[seq_id] + except KeyError: + # Skip records that do not have a matching sequence + # Immediately raise an error if requested to error on the first unmatched record if unmatched_reporting is DataErrorMethod.ERROR_FIRST: raise AugurError(f"Encountered metadata record {seq_id!r} without a matching sequence.") diff --git a/setup.py b/setup.py index 072dd8825..7640a8a8f 100644 --- a/setup.py +++ b/setup.py @@ -62,7 +62,7 @@ "packaging >=19.2", "pandas >=1.0.0, ==1.*", "phylo-treetime >=0.10.0, <0.12", - "pyfastx >=0.8.4, ==0.8.*", + "pyfastx >=1.0.0, <3.0", "scipy ==1.*", "xopen[zstd] >=1.7.0, ==1.*" ],