-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update develop #218
Merged
Update develop #218
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Merge changes from #184 to release
Thanks to @IbrahimTanyalcin for the suggestion
Add use case for indexing FASTA with suppressed output
Update python versions in CI
Starting with version 1.80, biopython does more stringent checks on opening bgzf files. This is causing a series of test failures in pyfaidx 0.7.1: tests/test_Fasta_bgzip.py::test_build_issue_126 XFAIL [ 11%] tests/test_Fasta_bgzip.py::test_integer_slice FAILED [ 11%] tests/test_Fasta_bgzip.py::test_integer_index FAILED [ 12%] tests/test_Fasta_bgzip.py::test_fetch_whole_fasta FAILED [ 13%] tests/test_Fasta_bgzip.py::test_line_len FAILED [ 14%] tests/test_Fasta_bgzip.py::test_mutable_bgzf PASSED [ 14%] tests/test_Fasta_bgzip.py::test_long_names FAILED [ 15%] tests/test_Fasta_bgzip.py::test_fetch_whole_entry FAILED [ 16%] tests/test_Fasta_bgzip.py::test_fetch_middle FAILED [ 17%] tests/test_Fasta_bgzip.py::test_fetch_end FAILED [ 17%] tests/test_Fasta_bgzip.py::test_fetch_border FAILED [ 18%] tests/test_Fasta_bgzip.py::test_rev FAILED [ 19%] tests/test_Fasta_bgzip.py::test_fetch_past_bounds FAILED [ 20%] tests/test_Fasta_bgzip.py::test_fetch_negative FAILED [ 20%] tests/test_Fasta_bgzip.py::test_fetch_reversed_coordinates FAILED [ 21%] tests/test_Fasta_bgzip.py::test_fetch_keyerror FAILED [ 22%] tests/test_Fasta_bgzip.py::test_blank_string FAILED [ 22%] tests/test_Fasta_bgzip.py::test_slice_from_beginning FAILED [ 23%] tests/test_Fasta_bgzip.py::test_slice_from_end FAILED [ 24%] tests/test_Fasta_bgzip.py::test_issue_74_start FAILED [ 25%] tests/test_Fasta_bgzip.py::test_issue_74_consistency FAILED [ 25%] tests/test_Fasta_bgzip.py::test_issue_74_end_faidx FAILED [ 26%] tests/test_Fasta_bgzip.py::test_issue_74_end_fasta FAILED [ 27%] tests/test_Fasta_bgzip.py::test_issue_79_fix FAILED [ 28%] tests/test_Fasta_bgzip.py::test_issue_79_fix_negate FAILED [ 28%] tests/test_Fasta_bgzip.py::test_issue_79_fix_one_based_false FAILED [ 29%] tests/test_Fasta_bgzip.py::test_issue_79_fix_one_based_false_negate FAILED [ 30%] tests/test_Fasta_bgzip.py::test_fetch_border_padded FAILED [ 31%] […] try: # mutable mode is not supported for bzgf anyways > self.file = bgzf.BgzfReader(fileobj=self.file, mode="b") /tmp/autopkgtest-lxc.i9z1xpfv/downtmp/build.bvQ/src/pyfaidx/__init__.py:412: […] if mode.lower() not in ("r", "tr", "rt", "rb", "br"): > raise ValueError( "Must use a read mode like 'r' (default), 'rt', or 'rb' for binary" ) E ValueError: Must use a read mode like 'r' (default), 'rt', or 'rb' for binary /usr/lib/python3/dist-packages/Bio/bgzf.py:597: ValueError […] try: # mutable mode is not supported for bzgf anyways self.file = bgzf.BgzfReader(fileobj=self.file, mode="b") except (ValueError, IOError): > raise UnsupportedCompressionFormat( "Compressed FASTA is only supported in BGZF format. Use " "the samtools bgzip utility (instead of gzip) to " "compress your FASTA." E pyfaidx.UnsupportedCompressionFormat: Compressed FASTA is only supported in BGZF format. Use the samtools bgzip utility (instead of gzip) to compress your FASTA. /tmp/autopkgtest-lxc.i9z1xpfv/downtmp/build.bvQ/src/pyfaidx/__init__.py:414: UnsupportedCompressionFormat A [full log] is available on Debian CI infrastructure, as I first noticed this while attempting to upgrade biopython to version 1.80 in Debian experimental. [full log]: https://ci.debian.net/data/autopkgtest/unstable/amd64/p/python-pyfaidx/28663555/log.gz Looking at the main development branch, I suspect this breakage might still occur. This patch makes opening bgzf files explicitly in read-only mode, and thus does not trigger the error anymore, without causing regression in the test suite. Note the comment in BgzfReader constructor mentions that one would: > typically use the top level ``bgzf.open(...)`` function > which will call this class internally. Direct use is discouraged. So maybe this commit is more of a workaround than the proper fix. Signed-off-by: Étienne Mollier <[email protected]>
Also, it would need to be a list, so as it was, it would be interpreted as provides = ['p', 'y', 'f', 'a', 'i', 'd', 'x']
This is the "modern" way of setting metadata for Python projects (see PEP 621: Storing project metadata in pyproject.toml). setuptools has introduced support for this in version 61, and it appears to be stable now. Some helpful tutorials: - https://packaging.python.org/en/latest/tutorials/packaging-projects/ - https://setuptools.pypa.io/en/latest/userguide/quickstart.html Also, the setuptools-scm configuration needed to be converted from setup.py, but this is documented well at <https://github.com/pypa/setuptools_scm/>. Since setup.py is gone, the README was updated to no longer recommend "python setup.py install". Similarly, "python setup.py sdist" no longer works. Instead, the "build" tool should be used: "pip install build && python -m build" (or "pipx run build" if pipx is available, as on the GitHub runners). Closes #186
fix bgzf test failure with biopython 1.80
Switch to pyproject.toml
Add a finalizer method for Faidx class - fix ResourceWarning: unclosed file
The Github Actions CI macOS job runners have some issue installing a proper pysam wheel, so for now we can just run tests requiring pysam under Linux.
'Sequence.gc' Method for IUPAC bases
Long-term solution once I stop supporting python < 3.8 should be to switch to https://docs.python.org/3/library/importlib.metadata.html#module-importlib.metadata
Related to #206
The script already imports __version__ from the package.
…-in-072 missing setuptools dependency in v0.7.2
Update codecov action
Try to use importlib from python > 3.8: https://docs.python.org/3/library/importlib.metadata.html#module-importlib.metadata Otherwise use the installed backport package: https://pypi.org/project/importlib-metadata/ Fix for #212
Add importlib_metadata install dependency for python <3.8
Replace usage of pkg_resources API
remove old Python 2 hybridation
Added the command to convert gzip to bgzip.
Update __init__.py
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.